(keys map[string]ed25519.PublicKey)
| 751 | } |
| 752 | |
| 753 | func 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. |
no test coverage detected