mirror of
https://github.com/hanzoai/swift-sdk.git
synced 2026-10-30 18:20:19 +00:00
The forge tree held the package scaffolding and none of the generated sources — 2,435 files of APIs, Models and Infrastructure, including BaseAPI, were simply absent, so anything depending on this copy had a package that compiled to nothing usable. Generated from the current API document rather than reconciled with the other copy: a client is a function of the spec, so regenerating answers "which history wins" without anyone having to choose. .spec-lock records which document, so the next reader can tell.
468 lines
30 KiB
Swift
468 lines
30 KiB
Swift
//
|
|
// LicensingAPI.swift
|
|
//
|
|
// Generated by openapi-generator
|
|
// https://openapi-generator.tech
|
|
//
|
|
|
|
import Foundation
|
|
|
|
open class LicensingAPI {
|
|
|
|
/**
|
|
Download resolves a release to its artifact, gated on a valid license.
|
|
|
|
- parameter release: (path)
|
|
- parameter xLicenseToken: (header) (optional)
|
|
- parameter token: (query) (optional)
|
|
- parameter apiConfiguration: The configuration for the http request.
|
|
- returns: LicensingReleaseAsset
|
|
*/
|
|
@available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *)
|
|
open class func getLicensingDownloadByRelease(release: String, xLicenseToken: String? = nil, token: String? = nil, apiConfiguration: HanzoAPIConfiguration = HanzoAPIConfiguration.shared) async throws(ErrorResponse) -> LicensingReleaseAsset {
|
|
return try await getLicensingDownloadByReleaseWithRequestBuilder(release: release, xLicenseToken: xLicenseToken, token: token, apiConfiguration: apiConfiguration).execute().body
|
|
}
|
|
|
|
/**
|
|
Download resolves a release to its artifact, gated on a valid license.
|
|
- GET /v1/licensing/download/{release}
|
|
- Download resolves a release to its artifact, gated on a valid license. The gate is the LICENSE token, not the IAM bearer: being signed in is not permission to download a paid binary — holding a good license for it is. The token must verify against this deployment's public key, be unrevoked, be scoped to the release's app, and carry every feature the release requires. Present it as the `X-License-Token` header (preferred, since a header does not land in proxy logs) or as `?token=`. The response pairs the artifact URL with its cosign signature so the client verifies the binary BEFORE trusting it: a signed URL alone proves where the bytes came from, not what they are. A yanked release is 410 Gone.
|
|
- Bearer Token:
|
|
- type: http
|
|
- name: bearer
|
|
- parameter release: (path)
|
|
- parameter xLicenseToken: (header) (optional)
|
|
- parameter token: (query) (optional)
|
|
- parameter apiConfiguration: The configuration for the http request.
|
|
- returns: RequestBuilder<LicensingReleaseAsset>
|
|
*/
|
|
open class func getLicensingDownloadByReleaseWithRequestBuilder(release: String, xLicenseToken: String? = nil, token: String? = nil, apiConfiguration: HanzoAPIConfiguration = HanzoAPIConfiguration.shared) -> RequestBuilder<LicensingReleaseAsset> {
|
|
var localVariablePath = "/v1/licensing/download/{release}"
|
|
let releasePreEscape = "\(APIHelper.mapValueToPathItem(release))"
|
|
let releasePostEscape = releasePreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? ""
|
|
localVariablePath = localVariablePath.replacingOccurrences(of: "{release}", with: releasePostEscape, options: .literal, range: nil)
|
|
let localVariableURLString = apiConfiguration.basePath + localVariablePath
|
|
let localVariableParameters: [String: any Sendable]? = nil
|
|
|
|
var localVariableUrlComponents = URLComponents(string: localVariableURLString)
|
|
localVariableUrlComponents?.queryItems = APIHelper.mapValuesToQueryItems([
|
|
"token": (wrappedValue: token?.asParameter(codableHelper: apiConfiguration.codableHelper), isExplode: true),
|
|
])
|
|
|
|
let localVariableNillableHeaders: [String: (any Sendable)?] = [
|
|
"X-License-Token": xLicenseToken?.asParameter(codableHelper: apiConfiguration.codableHelper),
|
|
]
|
|
|
|
let localVariableHeaderParameters = APIHelper.rejectNilHeaders(localVariableNillableHeaders)
|
|
|
|
let localVariableRequestBuilder: RequestBuilder<LicensingReleaseAsset>.Type = apiConfiguration.requestBuilderFactory.getBuilder()
|
|
|
|
return localVariableRequestBuilder.init(method: "GET", URLString: (localVariableUrlComponents?.string ?? localVariableURLString), parameters: localVariableParameters, headers: localVariableHeaderParameters, requiresAuthentication: true, apiConfiguration: apiConfiguration)
|
|
}
|
|
|
|
/**
|
|
Health reports which signer this deployment mints with, and in which env.
|
|
|
|
- parameter apiConfiguration: The configuration for the http request.
|
|
- returns: LicensingHealthView
|
|
*/
|
|
@available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *)
|
|
open class func getLicensingHealthz(apiConfiguration: HanzoAPIConfiguration = HanzoAPIConfiguration.shared) async throws(ErrorResponse) -> LicensingHealthView {
|
|
return try await getLicensingHealthzWithRequestBuilder(apiConfiguration: apiConfiguration).execute().body
|
|
}
|
|
|
|
/**
|
|
Health reports which signer this deployment mints with, and in which env.
|
|
- GET /v1/licensing/healthz
|
|
- Health reports which signer this deployment mints with, and in which env. It answers 200 whenever the process is up: there is nothing downstream to probe, since the KMS is reached only when a token is actually minted. Its value is the `signer` field — `\"signer\":\"local\"` on a production host says that deployment is signing licenses with a development key, which is a misconfiguration worth paging on rather than a healthy 200.
|
|
- Bearer Token:
|
|
- type: http
|
|
- name: bearer
|
|
- parameter apiConfiguration: The configuration for the http request.
|
|
- returns: RequestBuilder<LicensingHealthView>
|
|
*/
|
|
open class func getLicensingHealthzWithRequestBuilder(apiConfiguration: HanzoAPIConfiguration = HanzoAPIConfiguration.shared) -> RequestBuilder<LicensingHealthView> {
|
|
let localVariablePath = "/v1/licensing/healthz"
|
|
let localVariableURLString = apiConfiguration.basePath + localVariablePath
|
|
let localVariableParameters: [String: any Sendable]? = nil
|
|
|
|
let localVariableUrlComponents = URLComponents(string: localVariableURLString)
|
|
|
|
let localVariableNillableHeaders: [String: (any Sendable)?] = [
|
|
:
|
|
]
|
|
|
|
let localVariableHeaderParameters = APIHelper.rejectNilHeaders(localVariableNillableHeaders)
|
|
|
|
let localVariableRequestBuilder: RequestBuilder<LicensingHealthView>.Type = apiConfiguration.requestBuilderFactory.getBuilder()
|
|
|
|
return localVariableRequestBuilder.init(method: "GET", URLString: (localVariableUrlComponents?.string ?? localVariableURLString), parameters: localVariableParameters, headers: localVariableHeaderParameters, requiresAuthentication: true, apiConfiguration: apiConfiguration)
|
|
}
|
|
|
|
/**
|
|
Pubkey publishes the Ed25519 PUBLIC verification key, at both /pubkey and /jwks.
|
|
|
|
- parameter apiConfiguration: The configuration for the http request.
|
|
- returns: LicensingPubkeyView
|
|
*/
|
|
@available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *)
|
|
open class func getLicensingJwks(apiConfiguration: HanzoAPIConfiguration = HanzoAPIConfiguration.shared) async throws(ErrorResponse) -> LicensingPubkeyView {
|
|
return try await getLicensingJwksWithRequestBuilder(apiConfiguration: apiConfiguration).execute().body
|
|
}
|
|
|
|
/**
|
|
Pubkey publishes the Ed25519 PUBLIC verification key, at both /pubkey and /jwks.
|
|
- GET /v1/licensing/jwks
|
|
- Pubkey publishes the Ed25519 PUBLIC verification key, at both /pubkey and /jwks. This is the only public-safe surface here and the reason the whole scheme works offline: the engine embeds or fetches this key once and then verifies every license itself, with no call home per launch. The private half never enters this process — it lives in the KMS — so nothing served here is a secret. `provider` names the KMS holding that half; `\"local\"` means a development key, and a token signed by one is not a production credential.
|
|
- Bearer Token:
|
|
- type: http
|
|
- name: bearer
|
|
- parameter apiConfiguration: The configuration for the http request.
|
|
- returns: RequestBuilder<LicensingPubkeyView>
|
|
*/
|
|
open class func getLicensingJwksWithRequestBuilder(apiConfiguration: HanzoAPIConfiguration = HanzoAPIConfiguration.shared) -> RequestBuilder<LicensingPubkeyView> {
|
|
let localVariablePath = "/v1/licensing/jwks"
|
|
let localVariableURLString = apiConfiguration.basePath + localVariablePath
|
|
let localVariableParameters: [String: any Sendable]? = nil
|
|
|
|
let localVariableUrlComponents = URLComponents(string: localVariableURLString)
|
|
|
|
let localVariableNillableHeaders: [String: (any Sendable)?] = [
|
|
:
|
|
]
|
|
|
|
let localVariableHeaderParameters = APIHelper.rejectNilHeaders(localVariableNillableHeaders)
|
|
|
|
let localVariableRequestBuilder: RequestBuilder<LicensingPubkeyView>.Type = apiConfiguration.requestBuilderFactory.getBuilder()
|
|
|
|
return localVariableRequestBuilder.init(method: "GET", URLString: (localVariableUrlComponents?.string ?? localVariableURLString), parameters: localVariableParameters, headers: localVariableHeaderParameters, requiresAuthentication: true, apiConfiguration: apiConfiguration)
|
|
}
|
|
|
|
/**
|
|
Pubkey publishes the Ed25519 PUBLIC verification key, at both /pubkey and /jwks.
|
|
|
|
- parameter apiConfiguration: The configuration for the http request.
|
|
- returns: LicensingPubkeyView
|
|
*/
|
|
@available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *)
|
|
open class func getLicensingPubkey(apiConfiguration: HanzoAPIConfiguration = HanzoAPIConfiguration.shared) async throws(ErrorResponse) -> LicensingPubkeyView {
|
|
return try await getLicensingPubkeyWithRequestBuilder(apiConfiguration: apiConfiguration).execute().body
|
|
}
|
|
|
|
/**
|
|
Pubkey publishes the Ed25519 PUBLIC verification key, at both /pubkey and /jwks.
|
|
- GET /v1/licensing/pubkey
|
|
- Pubkey publishes the Ed25519 PUBLIC verification key, at both /pubkey and /jwks. This is the only public-safe surface here and the reason the whole scheme works offline: the engine embeds or fetches this key once and then verifies every license itself, with no call home per launch. The private half never enters this process — it lives in the KMS — so nothing served here is a secret. `provider` names the KMS holding that half; `\"local\"` means a development key, and a token signed by one is not a production credential.
|
|
- Bearer Token:
|
|
- type: http
|
|
- name: bearer
|
|
- parameter apiConfiguration: The configuration for the http request.
|
|
- returns: RequestBuilder<LicensingPubkeyView>
|
|
*/
|
|
open class func getLicensingPubkeyWithRequestBuilder(apiConfiguration: HanzoAPIConfiguration = HanzoAPIConfiguration.shared) -> RequestBuilder<LicensingPubkeyView> {
|
|
let localVariablePath = "/v1/licensing/pubkey"
|
|
let localVariableURLString = apiConfiguration.basePath + localVariablePath
|
|
let localVariableParameters: [String: any Sendable]? = nil
|
|
|
|
let localVariableUrlComponents = URLComponents(string: localVariableURLString)
|
|
|
|
let localVariableNillableHeaders: [String: (any Sendable)?] = [
|
|
:
|
|
]
|
|
|
|
let localVariableHeaderParameters = APIHelper.rejectNilHeaders(localVariableNillableHeaders)
|
|
|
|
let localVariableRequestBuilder: RequestBuilder<LicensingPubkeyView>.Type = apiConfiguration.requestBuilderFactory.getBuilder()
|
|
|
|
return localVariableRequestBuilder.init(method: "GET", URLString: (localVariableUrlComponents?.string ?? localVariableURLString), parameters: localVariableParameters, headers: localVariableHeaderParameters, requiresAuthentication: true, apiConfiguration: apiConfiguration)
|
|
}
|
|
|
|
/**
|
|
Lists the signed binary releases this deployment can serve.
|
|
|
|
- parameter apiConfiguration: The configuration for the http request.
|
|
- returns: LicensingReleaseList
|
|
*/
|
|
@available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *)
|
|
open class func getLicensingReleases(apiConfiguration: HanzoAPIConfiguration = HanzoAPIConfiguration.shared) async throws(ErrorResponse) -> LicensingReleaseList {
|
|
return try await getLicensingReleasesWithRequestBuilder(apiConfiguration: apiConfiguration).execute().body
|
|
}
|
|
|
|
/**
|
|
Lists the signed binary releases this deployment can serve.
|
|
- GET /v1/licensing/releases
|
|
- Lists the signed binary releases this deployment can serve. Metadata only, and no download URL: the artifact is behind GET /v1/licensing/download/{release}, which is gated on a valid license token. Knowing that a release exists is not permission to run it, which is why this list needs no license of its own.
|
|
- Bearer Token:
|
|
- type: http
|
|
- name: bearer
|
|
- parameter apiConfiguration: The configuration for the http request.
|
|
- returns: RequestBuilder<LicensingReleaseList>
|
|
*/
|
|
open class func getLicensingReleasesWithRequestBuilder(apiConfiguration: HanzoAPIConfiguration = HanzoAPIConfiguration.shared) -> RequestBuilder<LicensingReleaseList> {
|
|
let localVariablePath = "/v1/licensing/releases"
|
|
let localVariableURLString = apiConfiguration.basePath + localVariablePath
|
|
let localVariableParameters: [String: any Sendable]? = nil
|
|
|
|
let localVariableUrlComponents = URLComponents(string: localVariableURLString)
|
|
|
|
let localVariableNillableHeaders: [String: (any Sendable)?] = [
|
|
:
|
|
]
|
|
|
|
let localVariableHeaderParameters = APIHelper.rejectNilHeaders(localVariableNillableHeaders)
|
|
|
|
let localVariableRequestBuilder: RequestBuilder<LicensingReleaseList>.Type = apiConfiguration.requestBuilderFactory.getBuilder()
|
|
|
|
return localVariableRequestBuilder.init(method: "GET", URLString: (localVariableUrlComponents?.string ?? localVariableURLString), parameters: localVariableParameters, headers: localVariableHeaderParameters, requiresAuthentication: true, apiConfiguration: apiConfiguration)
|
|
}
|
|
|
|
/**
|
|
Reads one release's metadata: its product, version, platform and the cosign material a client verifies the binary against.
|
|
|
|
- parameter release: (path)
|
|
- parameter apiConfiguration: The configuration for the http request.
|
|
- returns: LicensingRelease
|
|
*/
|
|
@available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *)
|
|
open class func getLicensingReleasesByRelease(release: String, apiConfiguration: HanzoAPIConfiguration = HanzoAPIConfiguration.shared) async throws(ErrorResponse) -> LicensingRelease {
|
|
return try await getLicensingReleasesByReleaseWithRequestBuilder(release: release, apiConfiguration: apiConfiguration).execute().body
|
|
}
|
|
|
|
/**
|
|
Reads one release's metadata: its product, version, platform and the cosign material a client verifies the binary against.
|
|
- GET /v1/licensing/releases/{release}
|
|
- Reads one release's metadata: its product, version, platform and the cosign material a client verifies the binary against. An unknown id is 404. Like the list, this is metadata only — the bytes are behind the license-gated download.
|
|
- Bearer Token:
|
|
- type: http
|
|
- name: bearer
|
|
- parameter release: (path)
|
|
- parameter apiConfiguration: The configuration for the http request.
|
|
- returns: RequestBuilder<LicensingRelease>
|
|
*/
|
|
open class func getLicensingReleasesByReleaseWithRequestBuilder(release: String, apiConfiguration: HanzoAPIConfiguration = HanzoAPIConfiguration.shared) -> RequestBuilder<LicensingRelease> {
|
|
var localVariablePath = "/v1/licensing/releases/{release}"
|
|
let releasePreEscape = "\(APIHelper.mapValueToPathItem(release))"
|
|
let releasePostEscape = releasePreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? ""
|
|
localVariablePath = localVariablePath.replacingOccurrences(of: "{release}", with: releasePostEscape, options: .literal, range: nil)
|
|
let localVariableURLString = apiConfiguration.basePath + localVariablePath
|
|
let localVariableParameters: [String: any Sendable]? = nil
|
|
|
|
let localVariableUrlComponents = URLComponents(string: localVariableURLString)
|
|
|
|
let localVariableNillableHeaders: [String: (any Sendable)?] = [
|
|
:
|
|
]
|
|
|
|
let localVariableHeaderParameters = APIHelper.rejectNilHeaders(localVariableNillableHeaders)
|
|
|
|
let localVariableRequestBuilder: RequestBuilder<LicensingRelease>.Type = apiConfiguration.requestBuilderFactory.getBuilder()
|
|
|
|
return localVariableRequestBuilder.init(method: "GET", URLString: (localVariableUrlComponents?.string ?? localVariableURLString), parameters: localVariableParameters, headers: localVariableHeaderParameters, requiresAuthentication: true, apiConfiguration: apiConfiguration)
|
|
}
|
|
|
|
/**
|
|
Fingerprint turns raw device signals into the opaque value that binds a license to one machine.
|
|
|
|
- parameter licensingFingerprintRequest: (body)
|
|
- parameter apiConfiguration: The configuration for the http request.
|
|
- returns: LicensingFingerprintResponse
|
|
*/
|
|
@available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *)
|
|
open class func postLicensingFingerprint(licensingFingerprintRequest: LicensingFingerprintRequest, apiConfiguration: HanzoAPIConfiguration = HanzoAPIConfiguration.shared) async throws(ErrorResponse) -> LicensingFingerprintResponse {
|
|
return try await postLicensingFingerprintWithRequestBuilder(licensingFingerprintRequest: licensingFingerprintRequest, apiConfiguration: apiConfiguration).execute().body
|
|
}
|
|
|
|
/**
|
|
Fingerprint turns raw device signals into the opaque value that binds a license to one machine.
|
|
- POST /v1/licensing/fingerprint
|
|
- Fingerprint turns raw device signals into the opaque value that binds a license to one machine. This is the anti-copy step: the value returned here is folded into the signed token, so a token minted with it runs only on the device it was bound to. The derivation is one-way and salted — the signals are never stored and never echoed back — so the response is safe to persist client-side and pass to issue. Signals too weak to identify a machine (a hostname alone) are refused rather than turned into a binding that would collide with other machines.
|
|
- Bearer Token:
|
|
- type: http
|
|
- name: bearer
|
|
- parameter licensingFingerprintRequest: (body)
|
|
- parameter apiConfiguration: The configuration for the http request.
|
|
- returns: RequestBuilder<LicensingFingerprintResponse>
|
|
*/
|
|
open class func postLicensingFingerprintWithRequestBuilder(licensingFingerprintRequest: LicensingFingerprintRequest, apiConfiguration: HanzoAPIConfiguration = HanzoAPIConfiguration.shared) -> RequestBuilder<LicensingFingerprintResponse> {
|
|
let localVariablePath = "/v1/licensing/fingerprint"
|
|
let localVariableURLString = apiConfiguration.basePath + localVariablePath
|
|
let localVariableParameters = JSONEncodingHelper.encodingParameters(forEncodableObject: licensingFingerprintRequest, codableHelper: apiConfiguration.codableHelper)
|
|
|
|
let localVariableUrlComponents = URLComponents(string: localVariableURLString)
|
|
|
|
let localVariableNillableHeaders: [String: (any Sendable)?] = [
|
|
"Content-Type": "application/json",
|
|
]
|
|
|
|
let localVariableHeaderParameters = APIHelper.rejectNilHeaders(localVariableNillableHeaders)
|
|
|
|
let localVariableRequestBuilder: RequestBuilder<LicensingFingerprintResponse>.Type = apiConfiguration.requestBuilderFactory.getBuilder()
|
|
|
|
return localVariableRequestBuilder.init(method: "POST", URLString: (localVariableUrlComponents?.string ?? localVariableURLString), parameters: localVariableParameters, headers: localVariableHeaderParameters, requiresAuthentication: true, apiConfiguration: apiConfiguration)
|
|
}
|
|
|
|
/**
|
|
Issue mints a signed license token for a product the caller's org already pays for.
|
|
|
|
- parameter licensingIssueRequest: (body)
|
|
- parameter apiConfiguration: The configuration for the http request.
|
|
- returns: LicensingIssueResponse
|
|
*/
|
|
@available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *)
|
|
open class func postLicensingIssue(licensingIssueRequest: LicensingIssueRequest, apiConfiguration: HanzoAPIConfiguration = HanzoAPIConfiguration.shared) async throws(ErrorResponse) -> LicensingIssueResponse {
|
|
return try await postLicensingIssueWithRequestBuilder(licensingIssueRequest: licensingIssueRequest, apiConfiguration: apiConfiguration).execute().body
|
|
}
|
|
|
|
/**
|
|
Issue mints a signed license token for a product the caller's org already pays for.
|
|
- POST /v1/licensing/issue
|
|
- Issue mints a signed license token for a product the caller's org already pays for. The order is the whole security argument: the caller is an IAM-validated principal, commerce is then asked whether that principal's ORG holds an ACTIVE entitlement for the product, and only then is a token signed — by the KMS, never by key material in this process. A product the org does not own answers 403 and no token. The signed features are the plan's features verbatim, so the engine enforces exactly what was bought, and the expiry is clamped to the entitlement's so a token cannot outlive the subscription that paid for it. The token is the credential the engine runs on. Treat it as a secret.
|
|
- Bearer Token:
|
|
- type: http
|
|
- name: bearer
|
|
- parameter licensingIssueRequest: (body)
|
|
- parameter apiConfiguration: The configuration for the http request.
|
|
- returns: RequestBuilder<LicensingIssueResponse>
|
|
*/
|
|
open class func postLicensingIssueWithRequestBuilder(licensingIssueRequest: LicensingIssueRequest, apiConfiguration: HanzoAPIConfiguration = HanzoAPIConfiguration.shared) -> RequestBuilder<LicensingIssueResponse> {
|
|
let localVariablePath = "/v1/licensing/issue"
|
|
let localVariableURLString = apiConfiguration.basePath + localVariablePath
|
|
let localVariableParameters = JSONEncodingHelper.encodingParameters(forEncodableObject: licensingIssueRequest, codableHelper: apiConfiguration.codableHelper)
|
|
|
|
let localVariableUrlComponents = URLComponents(string: localVariableURLString)
|
|
|
|
let localVariableNillableHeaders: [String: (any Sendable)?] = [
|
|
"Content-Type": "application/json",
|
|
]
|
|
|
|
let localVariableHeaderParameters = APIHelper.rejectNilHeaders(localVariableNillableHeaders)
|
|
|
|
let localVariableRequestBuilder: RequestBuilder<LicensingIssueResponse>.Type = apiConfiguration.requestBuilderFactory.getBuilder()
|
|
|
|
return localVariableRequestBuilder.init(method: "POST", URLString: (localVariableUrlComponents?.string ?? localVariableURLString), parameters: localVariableParameters, headers: localVariableHeaderParameters, requiresAuthentication: true, apiConfiguration: apiConfiguration)
|
|
}
|
|
|
|
/**
|
|
Publishes a signed binary release, answering 201 Created.
|
|
|
|
- parameter licensingRelease: (body)
|
|
- parameter apiConfiguration: The configuration for the http request.
|
|
- returns: LicensingRelease
|
|
*/
|
|
@available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *)
|
|
open class func postLicensingReleases(licensingRelease: LicensingRelease, apiConfiguration: HanzoAPIConfiguration = HanzoAPIConfiguration.shared) async throws(ErrorResponse) -> LicensingRelease {
|
|
return try await postLicensingReleasesWithRequestBuilder(licensingRelease: licensingRelease, apiConfiguration: apiConfiguration).execute().body
|
|
}
|
|
|
|
/**
|
|
Publishes a signed binary release, answering 201 Created.
|
|
- POST /v1/licensing/releases
|
|
- Publishes a signed binary release, answering 201 Created. Outside dev a release MUST carry its cosign signature: this is how a binary becomes downloadable, so accepting an unsigned one would let an unverifiable artifact into the distribution path. Org-admin only — publishing is an operator action, not something a licensee does.
|
|
- Bearer Token:
|
|
- type: http
|
|
- name: bearer
|
|
- parameter licensingRelease: (body)
|
|
- parameter apiConfiguration: The configuration for the http request.
|
|
- returns: RequestBuilder<LicensingRelease>
|
|
*/
|
|
open class func postLicensingReleasesWithRequestBuilder(licensingRelease: LicensingRelease, apiConfiguration: HanzoAPIConfiguration = HanzoAPIConfiguration.shared) -> RequestBuilder<LicensingRelease> {
|
|
let localVariablePath = "/v1/licensing/releases"
|
|
let localVariableURLString = apiConfiguration.basePath + localVariablePath
|
|
let localVariableParameters = JSONEncodingHelper.encodingParameters(forEncodableObject: licensingRelease, codableHelper: apiConfiguration.codableHelper)
|
|
|
|
let localVariableUrlComponents = URLComponents(string: localVariableURLString)
|
|
|
|
let localVariableNillableHeaders: [String: (any Sendable)?] = [
|
|
"Content-Type": "application/json",
|
|
]
|
|
|
|
let localVariableHeaderParameters = APIHelper.rejectNilHeaders(localVariableNillableHeaders)
|
|
|
|
let localVariableRequestBuilder: RequestBuilder<LicensingRelease>.Type = apiConfiguration.requestBuilderFactory.getBuilder()
|
|
|
|
return localVariableRequestBuilder.init(method: "POST", URLString: (localVariableUrlComponents?.string ?? localVariableURLString), parameters: localVariableParameters, headers: localVariableHeaderParameters, requiresAuthentication: true, apiConfiguration: apiConfiguration)
|
|
}
|
|
|
|
/**
|
|
Revoke turns off tokens that have already been issued.
|
|
|
|
- parameter licensingRevokeRequest: (body)
|
|
- parameter apiConfiguration: The configuration for the http request.
|
|
- returns: LicensingRevokeResponse
|
|
*/
|
|
@available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *)
|
|
open class func postLicensingRevoke(licensingRevokeRequest: LicensingRevokeRequest, apiConfiguration: HanzoAPIConfiguration = HanzoAPIConfiguration.shared) async throws(ErrorResponse) -> LicensingRevokeResponse {
|
|
return try await postLicensingRevokeWithRequestBuilder(licensingRevokeRequest: licensingRevokeRequest, apiConfiguration: apiConfiguration).execute().body
|
|
}
|
|
|
|
/**
|
|
Revoke turns off tokens that have already been issued.
|
|
- POST /v1/licensing/revoke
|
|
- Revoke turns off tokens that have already been issued. A signed token cannot be un-signed, so revocation is the only way to withdraw one: this appends an entry that verify and the license-gated download both consult. It is a POST rather than a DELETE because it APPENDS a durable, attributed record — the entry names the admin who recorded it and when — rather than removing one. Org-admin only. Scope it as narrowly as the incident allows: \"nonce\" for one leaked token, \"holder\" for one compromised account, \"fingerprint\" for one stolen machine, \"release\" when a whole build is bad.
|
|
- Bearer Token:
|
|
- type: http
|
|
- name: bearer
|
|
- parameter licensingRevokeRequest: (body)
|
|
- parameter apiConfiguration: The configuration for the http request.
|
|
- returns: RequestBuilder<LicensingRevokeResponse>
|
|
*/
|
|
open class func postLicensingRevokeWithRequestBuilder(licensingRevokeRequest: LicensingRevokeRequest, apiConfiguration: HanzoAPIConfiguration = HanzoAPIConfiguration.shared) -> RequestBuilder<LicensingRevokeResponse> {
|
|
let localVariablePath = "/v1/licensing/revoke"
|
|
let localVariableURLString = apiConfiguration.basePath + localVariablePath
|
|
let localVariableParameters = JSONEncodingHelper.encodingParameters(forEncodableObject: licensingRevokeRequest, codableHelper: apiConfiguration.codableHelper)
|
|
|
|
let localVariableUrlComponents = URLComponents(string: localVariableURLString)
|
|
|
|
let localVariableNillableHeaders: [String: (any Sendable)?] = [
|
|
"Content-Type": "application/json",
|
|
]
|
|
|
|
let localVariableHeaderParameters = APIHelper.rejectNilHeaders(localVariableNillableHeaders)
|
|
|
|
let localVariableRequestBuilder: RequestBuilder<LicensingRevokeResponse>.Type = apiConfiguration.requestBuilderFactory.getBuilder()
|
|
|
|
return localVariableRequestBuilder.init(method: "POST", URLString: (localVariableUrlComponents?.string ?? localVariableURLString), parameters: localVariableParameters, headers: localVariableHeaderParameters, requiresAuthentication: true, apiConfiguration: apiConfiguration)
|
|
}
|
|
|
|
/**
|
|
Verify checks a license token online: signature, schema, expiry, app_id and the revocation list.
|
|
|
|
- parameter licensingVerifyRequest: (body)
|
|
- parameter apiConfiguration: The configuration for the http request.
|
|
- returns: LicensingVerifyResponse
|
|
*/
|
|
@available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *)
|
|
open class func postLicensingVerify(licensingVerifyRequest: LicensingVerifyRequest, apiConfiguration: HanzoAPIConfiguration = HanzoAPIConfiguration.shared) async throws(ErrorResponse) -> LicensingVerifyResponse {
|
|
return try await postLicensingVerifyWithRequestBuilder(licensingVerifyRequest: licensingVerifyRequest, apiConfiguration: apiConfiguration).execute().body
|
|
}
|
|
|
|
/**
|
|
Verify checks a license token online: signature, schema, expiry, app_id and the revocation list.
|
|
- POST /v1/licensing/verify
|
|
- Verify checks a license token online: signature, schema, expiry, app_id and the revocation list. It is UNAUTHENTICATED and always answers 200 — a bad token is `valid:false` with a reason rather than an error status, because \"is this token good\" is a question anyone may ask about a credential they already hold and the answer is the same either way. It is also OPTIONAL: the engine verifies OFFLINE against the published public key (GET /v1/licensing/pubkey) and needs this endpoint only to learn about revocation, so an outage here never stops a paid customer working.
|
|
- Bearer Token:
|
|
- type: http
|
|
- name: bearer
|
|
- parameter licensingVerifyRequest: (body)
|
|
- parameter apiConfiguration: The configuration for the http request.
|
|
- returns: RequestBuilder<LicensingVerifyResponse>
|
|
*/
|
|
open class func postLicensingVerifyWithRequestBuilder(licensingVerifyRequest: LicensingVerifyRequest, apiConfiguration: HanzoAPIConfiguration = HanzoAPIConfiguration.shared) -> RequestBuilder<LicensingVerifyResponse> {
|
|
let localVariablePath = "/v1/licensing/verify"
|
|
let localVariableURLString = apiConfiguration.basePath + localVariablePath
|
|
let localVariableParameters = JSONEncodingHelper.encodingParameters(forEncodableObject: licensingVerifyRequest, codableHelper: apiConfiguration.codableHelper)
|
|
|
|
let localVariableUrlComponents = URLComponents(string: localVariableURLString)
|
|
|
|
let localVariableNillableHeaders: [String: (any Sendable)?] = [
|
|
"Content-Type": "application/json",
|
|
]
|
|
|
|
let localVariableHeaderParameters = APIHelper.rejectNilHeaders(localVariableNillableHeaders)
|
|
|
|
let localVariableRequestBuilder: RequestBuilder<LicensingVerifyResponse>.Type = apiConfiguration.requestBuilderFactory.getBuilder()
|
|
|
|
return localVariableRequestBuilder.init(method: "POST", URLString: (localVariableUrlComponents?.string ?? localVariableURLString), parameters: localVariableParameters, headers: localVariableHeaderParameters, requiresAuthentication: true, apiConfiguration: apiConfiguration)
|
|
}
|
|
}
|