Files
sdk/docs/LicensingAPI.md

17 KiB

\LicensingAPI

All URIs are relative to https://api.hanzo.ai

Method HTTP request Description
GetLicensingDownloadByRelease Get /v1/licensing/download/{release} Download resolves a release to its artifact, gated on a valid license.
GetLicensingHealthz Get /v1/licensing/healthz Health reports which signer this deployment mints with, and in which env.
GetLicensingJwks Get /v1/licensing/jwks Pubkey publishes the Ed25519 PUBLIC verification key, at both /pubkey and /jwks.
GetLicensingPubkey Get /v1/licensing/pubkey Pubkey publishes the Ed25519 PUBLIC verification key, at both /pubkey and /jwks.
GetLicensingReleases Get /v1/licensing/releases Lists the signed binary releases this deployment can serve.
GetLicensingReleasesByRelease Get /v1/licensing/releases/{release} Reads one release's metadata: its product, version, platform and the cosign material a client verifies the binary against.
PostLicensingFingerprint Post /v1/licensing/fingerprint Fingerprint turns raw device signals into the opaque value that binds a license to one machine.
PostLicensingIssue Post /v1/licensing/issue Issue mints a signed license token for a product the caller's org already pays for.
PostLicensingVerify Post /v1/licensing/verify Verify checks a license token online: signature, schema, expiry, app_id and the revocation list.

GetLicensingDownloadByRelease

LicensingReleaseAsset GetLicensingDownloadByRelease(ctx, release).XLicenseToken(xLicenseToken).Token(token).Execute()

Download resolves a release to its artifact, gated on a valid license.

Example

package main

import (
	"context"
	"fmt"
	"os"
	openapiclient "github.com/hanzoai/go-sdk/v8"
)

func main() {
	release := "release_example" // string | 
	xLicenseToken := "xLicenseToken_example" // string |  (optional)
	token := "token_example" // string |  (optional)

	configuration := openapiclient.NewConfiguration()
	apiClient := openapiclient.NewAPIClient(configuration)
	resp, r, err := apiClient.LicensingAPI.GetLicensingDownloadByRelease(context.Background(), release).XLicenseToken(xLicenseToken).Token(token).Execute()
	if err != nil {
		fmt.Fprintf(os.Stderr, "Error when calling `LicensingAPI.GetLicensingDownloadByRelease``: %v\n", err)
		fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
	}
	// response from `GetLicensingDownloadByRelease`: LicensingReleaseAsset
	fmt.Fprintf(os.Stdout, "Response from `LicensingAPI.GetLicensingDownloadByRelease`: %v\n", resp)
}

Path Parameters

Name Type Description Notes
ctx context.Context context for authentication, logging, cancellation, deadlines, tracing, etc.
release string

Other Parameters

Other parameters are passed through a pointer to a apiGetLicensingDownloadByReleaseRequest struct via the builder pattern

Name Type Description Notes

xLicenseToken | string | | token | string | |

Return type

LicensingReleaseAsset

Authorization

bearer

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json, application/problem+json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

GetLicensingHealthz

LicensingHealthView GetLicensingHealthz(ctx).Execute()

Health reports which signer this deployment mints with, and in which env.

Example

package main

import (
	"context"
	"fmt"
	"os"
	openapiclient "github.com/hanzoai/go-sdk/v8"
)

func main() {

	configuration := openapiclient.NewConfiguration()
	apiClient := openapiclient.NewAPIClient(configuration)
	resp, r, err := apiClient.LicensingAPI.GetLicensingHealthz(context.Background()).Execute()
	if err != nil {
		fmt.Fprintf(os.Stderr, "Error when calling `LicensingAPI.GetLicensingHealthz``: %v\n", err)
		fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
	}
	// response from `GetLicensingHealthz`: LicensingHealthView
	fmt.Fprintf(os.Stdout, "Response from `LicensingAPI.GetLicensingHealthz`: %v\n", resp)
}

Path Parameters

This endpoint does not need any parameter.

Other Parameters

Other parameters are passed through a pointer to a apiGetLicensingHealthzRequest struct via the builder pattern

Return type

LicensingHealthView

Authorization

bearer

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json, application/problem+json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

GetLicensingJwks

LicensingPubkeyView GetLicensingJwks(ctx).Execute()

Pubkey publishes the Ed25519 PUBLIC verification key, at both /pubkey and /jwks.

Example

package main

import (
	"context"
	"fmt"
	"os"
	openapiclient "github.com/hanzoai/go-sdk/v8"
)

func main() {

	configuration := openapiclient.NewConfiguration()
	apiClient := openapiclient.NewAPIClient(configuration)
	resp, r, err := apiClient.LicensingAPI.GetLicensingJwks(context.Background()).Execute()
	if err != nil {
		fmt.Fprintf(os.Stderr, "Error when calling `LicensingAPI.GetLicensingJwks``: %v\n", err)
		fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
	}
	// response from `GetLicensingJwks`: LicensingPubkeyView
	fmt.Fprintf(os.Stdout, "Response from `LicensingAPI.GetLicensingJwks`: %v\n", resp)
}

Path Parameters

This endpoint does not need any parameter.

Other Parameters

Other parameters are passed through a pointer to a apiGetLicensingJwksRequest struct via the builder pattern

Return type

LicensingPubkeyView

Authorization

bearer

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json, application/problem+json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

GetLicensingPubkey

LicensingPubkeyView GetLicensingPubkey(ctx).Execute()

Pubkey publishes the Ed25519 PUBLIC verification key, at both /pubkey and /jwks.

Example

package main

import (
	"context"
	"fmt"
	"os"
	openapiclient "github.com/hanzoai/go-sdk/v8"
)

func main() {

	configuration := openapiclient.NewConfiguration()
	apiClient := openapiclient.NewAPIClient(configuration)
	resp, r, err := apiClient.LicensingAPI.GetLicensingPubkey(context.Background()).Execute()
	if err != nil {
		fmt.Fprintf(os.Stderr, "Error when calling `LicensingAPI.GetLicensingPubkey``: %v\n", err)
		fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
	}
	// response from `GetLicensingPubkey`: LicensingPubkeyView
	fmt.Fprintf(os.Stdout, "Response from `LicensingAPI.GetLicensingPubkey`: %v\n", resp)
}

Path Parameters

This endpoint does not need any parameter.

Other Parameters

Other parameters are passed through a pointer to a apiGetLicensingPubkeyRequest struct via the builder pattern

Return type

LicensingPubkeyView

Authorization

bearer

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json, application/problem+json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

GetLicensingReleases

LicensingReleaseList GetLicensingReleases(ctx).Execute()

Lists the signed binary releases this deployment can serve.

Example

package main

import (
	"context"
	"fmt"
	"os"
	openapiclient "github.com/hanzoai/go-sdk/v8"
)

func main() {

	configuration := openapiclient.NewConfiguration()
	apiClient := openapiclient.NewAPIClient(configuration)
	resp, r, err := apiClient.LicensingAPI.GetLicensingReleases(context.Background()).Execute()
	if err != nil {
		fmt.Fprintf(os.Stderr, "Error when calling `LicensingAPI.GetLicensingReleases``: %v\n", err)
		fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
	}
	// response from `GetLicensingReleases`: LicensingReleaseList
	fmt.Fprintf(os.Stdout, "Response from `LicensingAPI.GetLicensingReleases`: %v\n", resp)
}

Path Parameters

This endpoint does not need any parameter.

Other Parameters

Other parameters are passed through a pointer to a apiGetLicensingReleasesRequest struct via the builder pattern

Return type

LicensingReleaseList

Authorization

bearer

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json, application/problem+json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

GetLicensingReleasesByRelease

LicensingRelease GetLicensingReleasesByRelease(ctx, release).Execute()

Reads one release's metadata: its product, version, platform and the cosign material a client verifies the binary against.

Example

package main

import (
	"context"
	"fmt"
	"os"
	openapiclient "github.com/hanzoai/go-sdk/v8"
)

func main() {
	release := "release_example" // string | 

	configuration := openapiclient.NewConfiguration()
	apiClient := openapiclient.NewAPIClient(configuration)
	resp, r, err := apiClient.LicensingAPI.GetLicensingReleasesByRelease(context.Background(), release).Execute()
	if err != nil {
		fmt.Fprintf(os.Stderr, "Error when calling `LicensingAPI.GetLicensingReleasesByRelease``: %v\n", err)
		fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
	}
	// response from `GetLicensingReleasesByRelease`: LicensingRelease
	fmt.Fprintf(os.Stdout, "Response from `LicensingAPI.GetLicensingReleasesByRelease`: %v\n", resp)
}

Path Parameters

Name Type Description Notes
ctx context.Context context for authentication, logging, cancellation, deadlines, tracing, etc.
release string

Other Parameters

Other parameters are passed through a pointer to a apiGetLicensingReleasesByReleaseRequest struct via the builder pattern

Name Type Description Notes

Return type

LicensingRelease

Authorization

bearer

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json, application/problem+json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

PostLicensingFingerprint

LicensingFingerprintResponse PostLicensingFingerprint(ctx).LicensingFingerprintRequest(licensingFingerprintRequest).Execute()

Fingerprint turns raw device signals into the opaque value that binds a license to one machine.

Example

package main

import (
	"context"
	"fmt"
	"os"
	openapiclient "github.com/hanzoai/go-sdk/v8"
)

func main() {
	licensingFingerprintRequest := *openapiclient.NewLicensingFingerprintRequest() // LicensingFingerprintRequest | 

	configuration := openapiclient.NewConfiguration()
	apiClient := openapiclient.NewAPIClient(configuration)
	resp, r, err := apiClient.LicensingAPI.PostLicensingFingerprint(context.Background()).LicensingFingerprintRequest(licensingFingerprintRequest).Execute()
	if err != nil {
		fmt.Fprintf(os.Stderr, "Error when calling `LicensingAPI.PostLicensingFingerprint``: %v\n", err)
		fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
	}
	// response from `PostLicensingFingerprint`: LicensingFingerprintResponse
	fmt.Fprintf(os.Stdout, "Response from `LicensingAPI.PostLicensingFingerprint`: %v\n", resp)
}

Path Parameters

Other Parameters

Other parameters are passed through a pointer to a apiPostLicensingFingerprintRequest struct via the builder pattern

Name Type Description Notes
licensingFingerprintRequest LicensingFingerprintRequest

Return type

LicensingFingerprintResponse

Authorization

bearer

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json, application/problem+json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

PostLicensingIssue

LicensingIssueResponse PostLicensingIssue(ctx).LicensingIssueRequest(licensingIssueRequest).Execute()

Issue mints a signed license token for a product the caller's org already pays for.

Example

package main

import (
	"context"
	"fmt"
	"os"
	openapiclient "github.com/hanzoai/go-sdk/v8"
)

func main() {
	licensingIssueRequest := *openapiclient.NewLicensingIssueRequest("Product_example") // LicensingIssueRequest | 

	configuration := openapiclient.NewConfiguration()
	apiClient := openapiclient.NewAPIClient(configuration)
	resp, r, err := apiClient.LicensingAPI.PostLicensingIssue(context.Background()).LicensingIssueRequest(licensingIssueRequest).Execute()
	if err != nil {
		fmt.Fprintf(os.Stderr, "Error when calling `LicensingAPI.PostLicensingIssue``: %v\n", err)
		fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
	}
	// response from `PostLicensingIssue`: LicensingIssueResponse
	fmt.Fprintf(os.Stdout, "Response from `LicensingAPI.PostLicensingIssue`: %v\n", resp)
}

Path Parameters

Other Parameters

Other parameters are passed through a pointer to a apiPostLicensingIssueRequest struct via the builder pattern

Name Type Description Notes
licensingIssueRequest LicensingIssueRequest

Return type

LicensingIssueResponse

Authorization

bearer

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json, application/problem+json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

PostLicensingVerify

LicensingVerifyResponse PostLicensingVerify(ctx).LicensingVerifyRequest(licensingVerifyRequest).Execute()

Verify checks a license token online: signature, schema, expiry, app_id and the revocation list.

Example

package main

import (
	"context"
	"fmt"
	"os"
	openapiclient "github.com/hanzoai/go-sdk/v8"
)

func main() {
	licensingVerifyRequest := *openapiclient.NewLicensingVerifyRequest("Token_example") // LicensingVerifyRequest | 

	configuration := openapiclient.NewConfiguration()
	apiClient := openapiclient.NewAPIClient(configuration)
	resp, r, err := apiClient.LicensingAPI.PostLicensingVerify(context.Background()).LicensingVerifyRequest(licensingVerifyRequest).Execute()
	if err != nil {
		fmt.Fprintf(os.Stderr, "Error when calling `LicensingAPI.PostLicensingVerify``: %v\n", err)
		fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
	}
	// response from `PostLicensingVerify`: LicensingVerifyResponse
	fmt.Fprintf(os.Stdout, "Response from `LicensingAPI.PostLicensingVerify`: %v\n", resp)
}

Path Parameters

Other Parameters

Other parameters are passed through a pointer to a apiPostLicensingVerifyRequest struct via the builder pattern

Name Type Description Notes
licensingVerifyRequest LicensingVerifyRequest

Return type

LicensingVerifyResponse

Authorization

bearer

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json, application/problem+json

[Back to top] [Back to API list] [Back to Model list] [Back to README]