Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Signed-off-by: eubaranov <evgeniy.baranov@deliveryhero.com>
  • Loading branch information
eubaranov committed May 30, 2024
1 parent 4e5c36d commit d6300b5
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions plugins/rest/auth.go
Original file line number Diff line number Diff line change
Expand Up @@ -294,16 +294,13 @@ type oauth2Token struct {
ExpiresAt time.Time
}

func (ap *oauth2ClientCredentialsAuthPlugin) createAuthJWT(ctx context.Context, claims map[string]interface{}, signingKey interface{}) (*string, error) {
func (ap *oauth2ClientCredentialsAuthPlugin) createAuthJWT(ctx context.Context, extClaims map[string]interface{}, signingKey interface{}) (*string, error) {
now := time.Now()
baseClaims := map[string]interface{}{
claims := map[string]interface{}{
"iat": now.Unix(),
"exp": now.Add(10 * time.Minute).Unix(),
}
if claims == nil {
claims = make(map[string]interface{})
}
for k, v := range baseClaims {
for k, v := range extClaims {
claims[k] = v
}

Expand Down

0 comments on commit d6300b5

Please sign in to comment.