Class: Wurk::API::Auth::Principal
- Inherits:
-
Struct
- Object
- Struct
- Wurk::API::Auth::Principal
- Defined in:
- lib/wurk/api/auth.rb
Overview
What the request proved about itself: the scopes it was granted, and a
stable label for the credential that granted them. id is a truncated
domain-separated digest, never the token — enough to namespace
per-credential state (an Idempotency-Key record belongs to the producer
that chose it, not to whoever guesses the same string), and nothing a
holder could work backwards from.
Instance Attribute Summary collapse
-
#id ⇒ Object
Returns the value of attribute id.
-
#scopes ⇒ Object
Returns the value of attribute scopes.
Instance Method Summary collapse
Instance Attribute Details
#id ⇒ Object
Returns the value of attribute id
63 64 65 |
# File 'lib/wurk/api/auth.rb', line 63 def id @id end |
#scopes ⇒ Object
Returns the value of attribute scopes
63 64 65 |
# File 'lib/wurk/api/auth.rb', line 63 def scopes @scopes end |
Instance Method Details
#permits?(scope) ⇒ Boolean
64 65 66 |
# File 'lib/wurk/api/auth.rb', line 64 def permits?(scope) scope == ANY || scopes.include?(scope) || scopes.include?(:admin) end |