@@ -194,7 +194,7 @@ type IntrospectionResponder interface {
194194 // IsActive returns true if the introspected token is active and false otherwise.
195195 IsActive () bool
196196
197- // AccessRequester returns nil when IsActive() is false and the original access request object otherwise.
197+ // GetAccessRequester returns nil when IsActive() is false and the original access request object otherwise.
198198 GetAccessRequester () AccessRequester
199199
200200 // GetTokenUse optionally returns the type of the token that was introspected. This could be "access_token", "refresh_token",
@@ -235,7 +235,7 @@ type Requester interface {
235235 // AppendRequestedScope appends a scope to the request.
236236 AppendRequestedScope (scope string )
237237
238- // GetGrantScopes returns all granted scopes.
238+ // GetGrantedScopes returns all granted scopes.
239239 GetGrantedScopes () (grantedScopes Arguments )
240240
241241 // GetGrantedAudience returns all granted audiences.
@@ -263,9 +263,31 @@ type Requester interface {
263263 Sanitize (allowedParameters []string ) Requester
264264}
265265
266+ // RefreshTokenAccessRequester is an extended AccessRequester implementation that allows preserving
267+ // the original Requester.
268+ type RefreshTokenAccessRequester interface {
269+ // GetRefreshTokenRequestedScopes returns the request's scopes specifically for the refresh token.
270+ GetRefreshTokenRequestedScopes () (scopes Arguments )
271+
272+ // SetRefreshTokenRequestedScopes sets the request's scopes specifically for the refresh token.
273+ SetRefreshTokenRequestedScopes (scopes Arguments )
274+
275+ // GetRefreshTokenGrantedScopes returns all granted scopes specifically for the refresh token.
276+ GetRefreshTokenGrantedScopes () (scopes Arguments )
277+
278+ // SetRefreshTokenGrantedScopes sets all granted scopes specifically for the refresh token.
279+ SetRefreshTokenGrantedScopes (scopes Arguments )
280+
281+ // SetGrantedScopes sets all granted scopes. This is specifically used in the refresh flow to restore the originally
282+ // granted scopes to the session.
283+ SetGrantedScopes (scopes Arguments )
284+
285+ AccessRequester
286+ }
287+
266288// AccessRequester is a token endpoint's request context.
267289type AccessRequester interface {
268- // GetGrantType returns the requests grant type.
290+ // GetGrantTypes returns the requests grant type.
269291 GetGrantTypes () (grantTypes Arguments )
270292
271293 Requester
@@ -323,7 +345,7 @@ type AccessResponder interface {
323345 // SetTokenType set's the responses mandatory token type
324346 SetTokenType (tokenType string )
325347
326- // SetAccessToken returns the responses access token.
348+ // GetAccessToken returns the responses access token.
327349 GetAccessToken () (token string )
328350
329351 // GetTokenType returns the responses token type.
0 commit comments