From f8ce5f400fea9ebbf6329150c52a17612d33c61b Mon Sep 17 00:00:00 2001 From: Livio Spring Date: Mon, 6 Feb 2023 09:11:45 +0100 Subject: [PATCH] document JWTProfileTokenStorage --- pkg/op/storage.go | 6 ++++++ pkg/op/token_jwt_profile.go | 4 ---- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/pkg/op/storage.go b/pkg/op/storage.go index f34ff15..c62cebf 100644 --- a/pkg/op/storage.go +++ b/pkg/op/storage.go @@ -44,6 +44,12 @@ type OPStorage interface { ValidateJWTProfileScopes(ctx context.Context, userID string, scopes []string) ([]string, error) } +// JWTProfileTokenStorage is an additional, optional storage to implement +// implementing it, allows specifying the [AccessTokenType] of the access_token returned form the JWT Profile TokenRequest +type JWTProfileTokenStorage interface { + JWTProfileTokenType(ctx context.Context, request TokenRequest) (AccessTokenType, error) +} + type Storage interface { AuthStorage OPStorage diff --git a/pkg/op/token_jwt_profile.go b/pkg/op/token_jwt_profile.go index da09411..9620f30 100644 --- a/pkg/op/token_jwt_profile.go +++ b/pkg/op/token_jwt_profile.go @@ -53,10 +53,6 @@ func ParseJWTProfileGrantRequest(r *http.Request, decoder httphelper.Decoder) (* return tokenReq, nil } -type JWTProfileTokenStorage interface { - JWTProfileTokenType(ctx context.Context, request TokenRequest) (AccessTokenType, error) -} - // CreateJWTTokenResponse creates an access_token response for a JWT Profile Grant request // by default the access_token is an opaque string, but can be specified by implementing the JWTProfileTokenStorage interface func CreateJWTTokenResponse(ctx context.Context, tokenRequest TokenRequest, creator TokenCreator) (*oidc.AccessTokenResponse, error) {