MCPcopy Create free account
hub / github.com/coder/coder / keyFunc

Function keyFunc

enterprise/coderd/license/license.go:753–765  ·  view source on GitHub ↗
(keys map[string]ed25519.PublicKey)

Source from the content-addressed store, hash-verified

751}
752
753func keyFunc(keys map[string]ed25519.PublicKey) func(*jwt.Token) (interface{}, error) {
754 return func(j *jwt.Token) (interface{}, error) {
755 keyID, ok := j.Header[HeaderKeyID].(string)
756 if !ok {
757 return nil, ErrMissingKeyID
758 }
759 k, ok := keys[keyID]
760 if !ok {
761 return nil, xerrors.Errorf("no key with ID %s", keyID)
762 }
763 return k, nil
764 }
765}
766
767// licenseValidityPeriod keeps track of all license validity periods, and
768// generates warnings over contiguous periods across multiple licenses.

Callers 3

ParseRawFunction · 0.85
ParseClaimsFunction · 0.85
ParseClaimsIgnoreNbfFunction · 0.85

Calls 1

ErrorfMethod · 0.45

Tested by

no test coverage detected