Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor: PSG-5091 Remove JWK re-fetch logic #95

Merged
merged 10 commits into from
Nov 5, 2024
10 changes: 1 addition & 9 deletions authentication.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,16 +42,8 @@ func (a *App) getPublicKey(token *jwt.Token) (interface{}, error) {
}

key, ok := a.JWKS.LookupKeyID(keyID)
// if key doesn't exist, re-fetch one more time to see if this jwk was just added
if !ok {
if err := a.refreshJWKSCache(); err != nil {
return nil, err
}

key, ok = a.JWKS.LookupKeyID(keyID)
if !ok {
return nil, Error{Message: fmt.Sprintf("unable to find key %q", keyID)}
}
return nil, Error{Message: fmt.Sprintf("unable to find key %q", keyID)}
}

var pubKey interface{}
Expand Down
Loading