subnet

package
v0.7.7 Latest Latest
Warning

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

Go to latest
Published: Jul 14, 2021 License: AGPL-3.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// Constants for subnet configuration
	ConsoleSubnetURL = "CONSOLE_SUBNET_URL"
)

Variables

View Source
var (
	OfflinePublicKeys = []string{
		`-----BEGIN PUBLIC KEY-----
MHYwEAYHKoZIzj0CAQYFK4EEACIDYgAEaK31xujr6/rZ7ZfXZh3SlwovjC+X8wGq
qkltaKyTLRENd4w3IRktYYCRgzpDLPn/nrf7snV/ERO5qcI7fkEES34IVEr+2Uff
JkO2PfyyAYEO/5dBlPh1Undu9WQl6J7B
-----END PUBLIC KEY-----`,
	}
)

Functions

func GetLicenseInfoFromJWT

func GetLicenseInfoFromJWT(license string, publicKeys []string) (*licverifier.LicenseInfo, error)

GetLicenseInfoFromJWT will return license metadata from a jwt string license

func GetSubnetURL

func GetSubnetURL() string

GetSubnetURL

func RefreshLicense

func RefreshLicense(client cluster.HTTPClientI, licenseKey string) (licInfo *licverifier.LicenseInfo, license string, err error)

func ValidateLicense

func ValidateLicense(client cluster.HTTPClientI, licenseKey, email, password string) (licInfo *licverifier.LicenseInfo, license string, err error)

ValidateLicense will download the current subnet public key, if the public key its not available for license verification then console will fall back to verification with hardcoded public keys

Types

type LicenseMetadata

type LicenseMetadata struct {
	Email       string `json:"email"`
	Issuer      string `json:"issuer"`
	TeamName    string `json:"teamName"`
	ServiceType string `json:"serviceType"`
	RequestedAt string `json:"requestedAt"`
	ExpiresAt   string `json:"expiresAt"`
	AccountID   int64  `json:"accountId"`
	Capacity    int64  `json:"capacity"`
}

LicenseMetadata claims in subnet license

Jump to

Keyboard shortcuts

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