Loading
Extract Authn::Tokens::Concerns::DoorkeeperCompatible from IamOauthToken
Summary
Split out of the Duo Workflow stateless-JWT work (work item #617039 (closed)). That work adds a second stateless (no DB row) token class that needs to duck-type Doorkeeper::AccessToken, the same way IamOauthToken already does, and a code-review pass flagged that hand-copying that surface a second time -- with a comment asking future editors to keep the two copies in sync by hand -- was heading for drift (the two implementations had already diverged once on revoked?).
- Extracts
active?,accessible?,acceptable?,includes_scope?,scopes,resource_owner_id, andapplicationintoAuthn::Tokens::Concerns::DoorkeeperCompatible. IamOauthTokennow includes the concern instead of defining these methods itself.revoked?andreloadstay onIamOauthTokensince they genuinely differ per token type (IAM tokens can't be individually revoked today).
No behavior change to IamOauthToken.
Test plan
-
spec/lib/authn/tokens/iam_oauth_token_spec.rb -
spec/lib/authn/tokens/concerns/doorkeeper_compatible_spec.rb(new)