feat(protocol): include Apollo client identity in session work
Verify Protocol / verify (push) Canceled after 0s
Verify Protocol / module (push) Successful in 2m35s

This commit is contained in:
sechmachine
2026-07-29 11:28:25 +07:00
parent 357e5e0dbc
commit 36f6edffca
8 changed files with 36 additions and 10 deletions
+9 -3
View File
@@ -1,7 +1,7 @@
// Code generated by tools/generate.py; DO NOT EDIT.
import Foundation
public typealias JSONObject = [String: String]
public let schemaSHA256 = "c075c6fc472ce858337c3ad6c4b2f4dcfa88446d5471afb46c2f6931cbcf1b1d"
public let schemaSHA256 = "792abfb9cfe70e79911d499d76c009ab848713278bc240b88576df520580e480"
public let currentWireVersion = "1"
public let nMinus1WireVersion = "0"
public let nMinus2WireVersion = "-1"
@@ -1320,6 +1320,7 @@ public struct ProviderSessionWork: Codable, Equatable {
public let providerIdentity: String
public let policyVersionId: String
public let applicationId: String
public let clientId: String
public let managementHost: String
public let managementPort: Int64
public let streamHost: String
@@ -1337,6 +1338,7 @@ public struct ProviderSessionWork: Codable, Equatable {
case providerIdentity = "provider_identity"
case policyVersionId = "policy_version_id"
case applicationId = "application_id"
case clientId = "client_id"
case managementHost = "management_host"
case managementPort = "management_port"
case streamHost = "stream_host"
@@ -1346,7 +1348,7 @@ public struct ProviderSessionWork: Codable, Equatable {
case serverCertificatePem = "server_certificate_pem"
}
public init(version: String, sessionId: String, gatewayId: String, reconnectSequence: Int64, expiresAt: String, providerProfile: String, providerIdentity: String, policyVersionId: String, applicationId: String, managementHost: String, managementPort: Int64, streamHost: String, streamPort: Int64, clientCertificatePem: String, clientPrivateKeyPem: String, serverCertificatePem: String) throws {
public init(version: String, sessionId: String, gatewayId: String, reconnectSequence: Int64, expiresAt: String, providerProfile: String, providerIdentity: String, policyVersionId: String, applicationId: String, clientId: String, managementHost: String, managementPort: Int64, streamHost: String, streamPort: Int64, clientCertificatePem: String, clientPrivateKeyPem: String, serverCertificatePem: String) throws {
self.version = version
self.sessionId = sessionId
self.gatewayId = gatewayId
@@ -1356,6 +1358,7 @@ public struct ProviderSessionWork: Codable, Equatable {
self.providerIdentity = providerIdentity
self.policyVersionId = policyVersionId
self.applicationId = applicationId
self.clientId = clientId
self.managementHost = managementHost
self.managementPort = managementPort
self.streamHost = streamHost
@@ -1370,7 +1373,7 @@ public struct ProviderSessionWork: Codable, Equatable {
let all = try decoder.container(keyedBy: AnyCodingKey.self)
for key in all.allKeys where CodingKeys(stringValue: key.stringValue) == nil { throw ContractValidationError(field: key.stringValue, code: "unknown_field") }
let c = try decoder.container(keyedBy: CodingKeys.self)
try self.init(version: try c.decode(String.self, forKey: .version), sessionId: try c.decode(String.self, forKey: .sessionId), gatewayId: try c.decode(String.self, forKey: .gatewayId), reconnectSequence: try c.decode(Int64.self, forKey: .reconnectSequence), expiresAt: try c.decode(String.self, forKey: .expiresAt), providerProfile: try c.decode(String.self, forKey: .providerProfile), providerIdentity: try c.decode(String.self, forKey: .providerIdentity), policyVersionId: try c.decode(String.self, forKey: .policyVersionId), applicationId: try c.decode(String.self, forKey: .applicationId), managementHost: try c.decode(String.self, forKey: .managementHost), managementPort: try c.decode(Int64.self, forKey: .managementPort), streamHost: try c.decode(String.self, forKey: .streamHost), streamPort: try c.decode(Int64.self, forKey: .streamPort), clientCertificatePem: try c.decode(String.self, forKey: .clientCertificatePem), clientPrivateKeyPem: try c.decode(String.self, forKey: .clientPrivateKeyPem), serverCertificatePem: try c.decode(String.self, forKey: .serverCertificatePem))
try self.init(version: try c.decode(String.self, forKey: .version), sessionId: try c.decode(String.self, forKey: .sessionId), gatewayId: try c.decode(String.self, forKey: .gatewayId), reconnectSequence: try c.decode(Int64.self, forKey: .reconnectSequence), expiresAt: try c.decode(String.self, forKey: .expiresAt), providerProfile: try c.decode(String.self, forKey: .providerProfile), providerIdentity: try c.decode(String.self, forKey: .providerIdentity), policyVersionId: try c.decode(String.self, forKey: .policyVersionId), applicationId: try c.decode(String.self, forKey: .applicationId), clientId: try c.decode(String.self, forKey: .clientId), managementHost: try c.decode(String.self, forKey: .managementHost), managementPort: try c.decode(Int64.self, forKey: .managementPort), streamHost: try c.decode(String.self, forKey: .streamHost), streamPort: try c.decode(Int64.self, forKey: .streamPort), clientCertificatePem: try c.decode(String.self, forKey: .clientCertificatePem), clientPrivateKeyPem: try c.decode(String.self, forKey: .clientPrivateKeyPem), serverCertificatePem: try c.decode(String.self, forKey: .serverCertificatePem))
}
public func validate() throws {
@@ -1394,6 +1397,9 @@ public struct ProviderSessionWork: Codable, Equatable {
if self.applicationId.isEmpty { throw ContractValidationError(field: "application_id", code: "required") }
if !self.applicationId.isEmpty && self.applicationId.utf8.count < 1 { throw ContractValidationError(field: "application_id", code: "min_length") }
if self.applicationId.utf8.count > 128 { throw ContractValidationError(field: "application_id", code: "max_length") }
if self.clientId.isEmpty { throw ContractValidationError(field: "client_id", code: "required") }
if !self.clientId.isEmpty && self.clientId.utf8.count < 1 { throw ContractValidationError(field: "client_id", code: "min_length") }
if self.clientId.utf8.count > 128 { throw ContractValidationError(field: "client_id", code: "max_length") }
if self.managementHost.isEmpty { throw ContractValidationError(field: "management_host", code: "required") }
if !self.managementHost.isEmpty && self.managementHost.utf8.count < 1 { throw ContractValidationError(field: "management_host", code: "min_length") }
if self.managementHost.utf8.count > 256 { throw ContractValidationError(field: "management_host", code: "max_length") }