Documentation
¶
Index ¶
- Constants
- Variables
- func IsExpired(l License) bool
- func LicenseFromKey(licenseKey, publicKey string, dest interface{}) error
- func Sign(privateKey string, l interface{}) (string, error)
- type Doer
- type EnvelopePingResponse
- type License
- type LicenseMF2
- type PingRequestMF2
- type PingResponseMF2
- type PingerMF2
Constants ¶
View Source
const ( HTTPHeaderKeyID = "X-Graymeta-Key-Id" HTTPHeaderSignature = "X-Graymeta-Signature" )
Canonical HTTP header names for the HMAC key ID and signature headers
Variables ¶
View Source
var ErrLicenseInvalidSignature = errors.New("license contains invalid signature")
ErrLicenseInvalidSignature is the error returned when the license has an invalid signature
Functions ¶
func LicenseFromKey ¶
LicenseFromKey takes a licenseKey and a public key and rehydrates it into a the destination.
Types ¶
type EnvelopePingResponse ¶
type EnvelopePingResponse struct {
Payload string `json:"payload"`
}
EnvelopePingResponse wraps the signed ping response from the server
type License ¶
License is the minimum requirements a struct has to expose for being able to be a product license
type LicenseMF2 ¶
type LicenseMF2 struct {
// Expiration is the timestamp at which the license expires
Expiration time.Time `json:"expiration"`
// BaseURL is the platform's base URL. We include this in the signed license to
// prevent customers from spinning up multiple instances of the platform behind
// a load balancer
BaseURL string `json:"base_url"`
// EnforceBaseURLCheck dictates whether or not we should enforce the BaseURL
// check. This is necessary because we want to use a single license across all
// sites hosted by GrayMeta (in which case this would be false). For our typical
// Enterprise Terraform based customers, this will be true
EnforceBaseURLCheck bool `json:"enforce_base_url_check"`
// LicenseGeneratedAt is the timestamp when the license was generated
LicenseGeneratedAt time.Time `json:"license_generated_at"`
// LicenseGenerationHost is the hostname of the server where the license was generated
LicenseGenerationHost string `json:"license_generation_host"`
// LicenseHost is the host for the licensing server
LicenseHost string `json:"license_host,omitempty"`
// UsageHost is the url for the usage server
UsageHost string `json:"usage_host,omitempty"`
// PublicKey is the public key used to secure communications with the GrayMeta
// LicenseHost and UsageHost
PublicKey string `json:"public_key,omitempty"`
// PrivateKey is the private key used to secure communications with the GrayMeta
// LicenseHost and UsageHost
PrivateKey string `json:"private_key,omitempty"`
// RemoteUsageEnabled is the flag to turn on/off remote usage reporting
RemoteUsageEnabled bool `json:"remote_usage_enabled"`
// LicenseChecksEnabled is the flag to turn on/off remote kill/licensing checks
LicenseChecksEnabled bool `json:"license_checks_enabled"`
}
LicenseMF2 is a GrayMeta/Curio Platform License
func (LicenseMF2) ExpiresAt ¶
func (l LicenseMF2) ExpiresAt() time.Time
ExpiresAt returns the license expiration time
type PingRequestMF2 ¶
PingRequestMF2 is the request body for a license ping
type PingResponseMF2 ¶
type PingResponseMF2 struct {
Enabled bool `json:"enabled"`
}
PingResponseMF2 is the response body from the license server
Click to show internal directories.
Click to hide internal directories.