Skip to content

Commit

Permalink
Add KeyfuncCtx method to interface (#120)
Browse files Browse the repository at this point in the history
  • Loading branch information
MicahParks authored Mar 25, 2024
1 parent b9d1823 commit 8e0299c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions keyfunc.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ var (
// github.com/MicahParks/jwkset as a JWK Set storage.
type Keyfunc interface {
Keyfunc(token *jwt.Token) (any, error)
KeyfuncCtx(ctx context.Context) func(token *jwt.Token) (any, error)
KeyfuncCtx(ctx context.Context) jwt.Keyfunc
Storage() jwkset.Storage
}

Expand Down Expand Up @@ -113,7 +113,7 @@ func NewJWKSetJSON(raw json.RawMessage) (Keyfunc, error) {
return New(options)
}

func (k keyfunc) KeyfuncCtx(ctx context.Context) func(token *jwt.Token) (any, error) {
func (k keyfunc) KeyfuncCtx(ctx context.Context) jwt.Keyfunc {
return func(token *jwt.Token) (any, error) {
kidInter, ok := token.Header[jwkset.HeaderKID]
if !ok {
Expand Down

0 comments on commit 8e0299c

Please sign in to comment.