Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
DefaultLicenseLeeway is the default leeway when comparing timestamps in licenses.
Functions ¶
This section is empty.
Types ¶
type JWKSFetcher ¶
type JWKSFetcher struct { URIs []*url.URL UserAgent string Client *http.Client Logger logrus.FieldLogger MaxRetries int // contains filtered or unexported fields }
A JWKSFetcher defines the parameters how to fetch a JWK set from URI.
func (*JWKSFetcher) ETag ¶
func (jwksf *JWKSFetcher) ETag() string
func (*JWKSFetcher) JWKS ¶
func (jwksf *JWKSFetcher) JWKS() *jose.JSONWebKeySet
func (*JWKSFetcher) Offline ¶
func (jwksf *JWKSFetcher) Offline() bool
func (*JWKSFetcher) Update ¶
func (jwksf *JWKSFetcher) Update(ctx context.Context) (*jose.JSONWebKeySet, error)
Update fetches the JWKS from its URI with retry.
type LicensesLoader ¶
type LicensesLoader struct { // If CertPool is set, licenses are validated with it when offline. CertPool *x509.CertPool // JWKS is the key set for license validation when not offline. JWKS *jose.JSONWebKeySet // Offline allows license valdation with keys from CertPool if not found in JWKS. Offline bool // Logger is the logger used. If nil, a standard logger is used. Logger logrus.FieldLogger // History is a map to avoid loading the same license twice if not nil. LoadHistory map[string]*license.Claims ActivateHistory map[string]*license.Claims // Hooks. OnActivate func(*license.Claims) OnRemove func(*license.Claims) OnNew func(*license.Claims) OnSkip func(*license.Claims) }
A LicensesLoader defines the parameters how to load licenses from a folder path.
func (*LicensesLoader) ScanFolder ¶
func (ll *LicensesLoader) ScanFolder(licensesPath string, expected jwt.Expected) ([]*license.Claims, error)
ScanFolder scans the provided folder for license files, loads, parses and validates them all and returns the claim set for each currently valid license.
func (*LicensesLoader) UnsafeScanFolderWithoutVerification ¶
func (ll *LicensesLoader) UnsafeScanFolderWithoutVerification(licensesPath string, expected jwt.Expected) ([]*license.Claims, error)
UnsafeScanFolderWithoutVerification scans the provided folder for license files, loads parses and skips validation if no matching key is found, making this function unsafe to use when its required to only return valid license claim sets.