license

package
v1.6.1-0...-f207c0f Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 28, 2025 License: Apache-2.0 Imports: 24 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var KICLicenseAPIPathPattern = "%s/kic/api/control-planes/%s/v1/licenses"

KICLicenseAPIPathPattern is the path pattern for KIC license operations.

Functions

This section is empty.

Types

type Client

type Client struct {
	// contains filtered or unexported fields
}

Client interacts with the Konnect license API.

func NewClient

func NewClient(cfg managercfg.KonnectConfig, logger logr.Logger) (*Client, error)

NewClient creates a License API Konnect client.

func (*Client) Get

func (*Client) WithLicenseStore

func (c *Client) WithLicenseStore(licenseStore Storer) *Client

type Item

type Item struct {
	License   string `json:"payload,omitempty"`
	UpdatedAt uint64 `json:"updated_at,omitempty"`
	ID        string `json:"id,omitempty"`
}

Item is a single license from the upstream license API.

type ListLicenseResponse

type ListLicenseResponse struct {
	Items []*Item `json:"items"`
}

type SecretLicenseStore

type SecretLicenseStore struct {
	// contains filtered or unexported fields
}

SecretLicenseStore is the storage used to store the Konnect license. This store uses the CP ID, a predefined prefix and the provided namespace to designate the target Secret which will be used for storage.

func NewSecretLicenseStore

func NewSecretLicenseStore(cl client.Client, namespace, controlPlaneID string) *SecretLicenseStore

NewSecretLicenseStore creates a storage to store Konnect license to a secret.

func (*SecretLicenseStore) Load

Load loads the license from the secret from secret `konnect-license-<cpid>`.

func (*SecretLicenseStore) Store

Store stores license to the secret `konnect-license-<cpid>`.

type Storer

type Storer interface {
	Store(context.Context, license.KonnectLicense) error
	Load(context.Context) (license.KonnectLicense, error)
}

Storer is used to store license fetched from Konnect or to load it from said storage.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL