Class: Masks::Rails::OpenID::AccessToken
Instance Method Summary
collapse
Methods included from Scoped
#role?, #role_records, #scope?
Instance Method Details
#roles(*args, **opts) ⇒ Object
34
35
36
|
# File 'app/models/masks/rails/openid/access_token.rb', line 34
def roles(*args, **opts)
(actor || openid_client).roles(*args, **opts)
end
|
#scopes ⇒ Object
26
27
28
29
30
31
32
|
# File 'app/models/masks/rails/openid/access_token.rb', line 26
def scopes
value = self[:scopes]
return [] unless value
value & ((actor&.scopes || []) + openid_client.scopes)
end
|
#to_bearer_token ⇒ Object
38
39
40
41
42
43
|
# File 'app/models/masks/rails/openid/access_token.rb', line 38
def to_bearer_token
Rack::OAuth2::AccessToken::Bearer.new(
access_token: token,
expires_in: (expires_at - Time.now.utc).to_i
)
end
|