Documentation ¶
Index ¶
Constants ¶
const ( // VendorKey is the key in the entitlement secret // that holds the vendor name. VendorKey = "vendor" // TokenKey is the key in the entitlement secret // that holds the token. TokenKey = "token" // DefaultVendor is the default vendor name. DefaultVendor = "controlplane" // MarketplaceTypeEnvKey is the environment variable key // that holds the marketplace type. MarketplaceTypeEnvKey = "MARKETPLACE_TYPE" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AmazonClient ¶
type AmazonClient struct { Vendor string // contains filtered or unexported fields }
AmazonClient is an entitlement client for the ControlPlane Enterprise for Flux CD AWS Marketplace product. https://aws.amazon.com/marketplace/pp/prodview-ndm54wno7tayg
func NewAmazonClient ¶
func NewAmazonClient(vendor string) (*AmazonClient, error)
NewAmazonClient creates a new AmazonClient using the default AWS configuration and the current region.
func (*AmazonClient) GetVendor ¶
func (c *AmazonClient) GetVendor() string
GetVendor returns the vendor name.
func (*AmazonClient) RegisterUsage ¶
RegisterUsage registers the usage with AWS Marketplace metering service and returns a JWT token.
type Client ¶
type Client interface { // RegisterUsage registers the usage with the entitlement service // and returns a signed JWT token. RegisterUsage(ctx context.Context, id string) (string, error) // Verify verifies that the token is signed by the // entitlement service and matches the usage id. Verify(token, id string) (bool, error) // GetVendor returns the vendor name. GetVendor() string }
Client is the interface for entitlement clients that can register usage and verify tokens.
type DefaultClient ¶
type DefaultClient struct {
Vendor string
}
DefaultClient is an offline entitlement client. This client uses a SHA256 digest to generate and verify tokens.
func (*DefaultClient) GetVendor ¶
func (c *DefaultClient) GetVendor() string
GetVendor returns the vendor name.
func (*DefaultClient) RegisterUsage ¶
RegisterUsage registers the usage with the default entitlement client.