mirror of
https://github.com/hanzoai/swift-sdk.git
synced 2026-10-30 18:20:19 +00:00
The projection was 113 commits behind the document it claims to describe, and `generate.py --all --check` reported every one of the thirteen clients DRIFTED — the same +19 models in each, because they all fell behind the same emission. Regenerated in place from hanzo-inc/cloud openapi.yaml at 939b09d4 (sha256 087024f6…), which is the only description of this API that cannot name a route the binary does not serve. `--check` is clean across all thirteen after. .spec-lock moved with the code. The generator READS that file and never writes it — hanzoai/ci`s lane does — so a hand run leaves every lock naming the previous document. A lock that disagrees with the tree beside it is worse than no lock: the next `--check` without `--spec` fetches what production serves, compares it to a digest that was already wrong, and reports drift that is really staleness.
118 lines
6.7 KiB
Swift
118 lines
6.7 KiB
Swift
//
|
|
// IamKey.swift
|
|
//
|
|
// Generated by openapi-generator
|
|
// https://openapi-generator.tech
|
|
//
|
|
|
|
import Foundation
|
|
|
|
public struct IamKey: Sendable, Codable, ParameterConvertible, Hashable {
|
|
|
|
/** AccessKey (pk-*) is the publishable identifier and lookup index; AccessSecret (sk-*) is the confidential secret. AccessSecret IS NOT PERSISTED for a key minted at or after the digest change: it carries the secret out to its holder once, in the mint response, and the row keeps only AccessSecretDigest. It stays on the struct because that one-time reveal is the whole point of minting, and it stays in the schema because rows written before the change still hold a plaintext secret that the resolver drains on first use. */
|
|
public var accessKey: String?
|
|
public var accessSecret: String?
|
|
/** AccessSecretDigest is how a presented secret finds its key: the resolver digests what the caller sent and looks THAT up. It is what lets the row hold no plaintext and still be found in one indexed read — a salted hash cannot be looked up by value, which is the reason the plaintext was here. */
|
|
public var accessSecretDigest: String?
|
|
/** Act is the durable, opt-in grant that lets this key act FOR a user in its own org — the credential behind as(): presenting it authorizes minting a short-lived, user-bound token for a member of the key's tenant. Default false, so a server key mints nothing on anyone's behalf until the grant is set deliberately — the capability is never inherited by every key. It is confined at mint time to the key's OWN Owner, and a reserved-org or SuperAdmin target is refused, so the grant reaches only ordinary members of the one tenant that holds the key. */
|
|
public var act: Bool?
|
|
public var application: String?
|
|
public var createdAt: Date?
|
|
/** CreatedTime and UpdatedTime are RFC3339 audit stamps carried as strings for byte-parity with the v1 row (orm.Model separately tracks CreatedAt / UpdatedAt as time.Time for the store's own lifecycle). */
|
|
public var createdTime: String?
|
|
public var deleted: Bool?
|
|
/** DisplayName is the human-facing label. */
|
|
public var displayName: String?
|
|
/** ExpireTime is when the key stops being honored (empty = never). State is the lifecycle flag (\"Active\", \"test\", …); \"test\" mints test-env credentials instead of live ones. */
|
|
public var expireTime: String?
|
|
public var id: String?
|
|
public var name: String?
|
|
public var organization: String?
|
|
/** Owner is the tenant that holds the key; Name is unique within Owner. */
|
|
public var owner: String?
|
|
/** Scope is the key's ACCESS CLASS, orthogonal to Type (which names the bound principal). Empty (the default, \"secret\") is a full key: a pk- publishable half AND a confidential sk- half, the sk- authenticating a server-side reader. KeyScopePublish is a WRITE-ONLY publishable key — a pk- half only, no secret — that resolves to just an ORG (never a principal) at the ingest endpoint and is safe to ship in client JS. A missing value on an existing row reads as the default, so every pre-Scope key is a secret key unchanged. */
|
|
public var scope: String?
|
|
public var state: String?
|
|
/** Type is the scope the key is bound to — \"Organization\", \"Application\", \"User\", or \"General\" — and Organization / Application / User name the concrete principal for whichever scope Type selects. */
|
|
public var type: String?
|
|
public var updatedAt: Date?
|
|
public var updatedTime: String?
|
|
public var user: String?
|
|
|
|
public init(accessKey: String? = nil, accessSecret: String? = nil, accessSecretDigest: String? = nil, act: Bool? = nil, application: String? = nil, createdAt: Date? = nil, createdTime: String? = nil, deleted: Bool? = nil, displayName: String? = nil, expireTime: String? = nil, id: String? = nil, name: String? = nil, organization: String? = nil, owner: String? = nil, scope: String? = nil, state: String? = nil, type: String? = nil, updatedAt: Date? = nil, updatedTime: String? = nil, user: String? = nil) {
|
|
self.accessKey = accessKey
|
|
self.accessSecret = accessSecret
|
|
self.accessSecretDigest = accessSecretDigest
|
|
self.act = act
|
|
self.application = application
|
|
self.createdAt = createdAt
|
|
self.createdTime = createdTime
|
|
self.deleted = deleted
|
|
self.displayName = displayName
|
|
self.expireTime = expireTime
|
|
self.id = id
|
|
self.name = name
|
|
self.organization = organization
|
|
self.owner = owner
|
|
self.scope = scope
|
|
self.state = state
|
|
self.type = type
|
|
self.updatedAt = updatedAt
|
|
self.updatedTime = updatedTime
|
|
self.user = user
|
|
}
|
|
|
|
public enum CodingKeys: String, CodingKey, CaseIterable {
|
|
case accessKey
|
|
case accessSecret
|
|
case accessSecretDigest
|
|
case act
|
|
case application
|
|
case createdAt
|
|
case createdTime
|
|
case deleted
|
|
case displayName
|
|
case expireTime
|
|
case id
|
|
case name
|
|
case organization
|
|
case owner
|
|
case scope
|
|
case state
|
|
case type
|
|
case updatedAt
|
|
case updatedTime
|
|
case user
|
|
}
|
|
|
|
// Encodable protocol methods
|
|
|
|
public func encode(to encoder: Encoder) throws {
|
|
var container = encoder.container(keyedBy: CodingKeys.self)
|
|
try container.encodeIfPresent(accessKey, forKey: .accessKey)
|
|
try container.encodeIfPresent(accessSecret, forKey: .accessSecret)
|
|
try container.encodeIfPresent(accessSecretDigest, forKey: .accessSecretDigest)
|
|
try container.encodeIfPresent(act, forKey: .act)
|
|
try container.encodeIfPresent(application, forKey: .application)
|
|
try container.encodeIfPresent(createdAt, forKey: .createdAt)
|
|
try container.encodeIfPresent(createdTime, forKey: .createdTime)
|
|
try container.encodeIfPresent(deleted, forKey: .deleted)
|
|
try container.encodeIfPresent(displayName, forKey: .displayName)
|
|
try container.encodeIfPresent(expireTime, forKey: .expireTime)
|
|
try container.encodeIfPresent(id, forKey: .id)
|
|
try container.encodeIfPresent(name, forKey: .name)
|
|
try container.encodeIfPresent(organization, forKey: .organization)
|
|
try container.encodeIfPresent(owner, forKey: .owner)
|
|
try container.encodeIfPresent(scope, forKey: .scope)
|
|
try container.encodeIfPresent(state, forKey: .state)
|
|
try container.encodeIfPresent(type, forKey: .type)
|
|
try container.encodeIfPresent(updatedAt, forKey: .updatedAt)
|
|
try container.encodeIfPresent(updatedTime, forKey: .updatedTime)
|
|
try container.encodeIfPresent(user, forKey: .user)
|
|
}
|
|
}
|
|
|
|
|
|
@available(iOS 13, tvOS 13, watchOS 6, macOS 10.15, *)
|
|
extension IamKey: Identifiable {}
|