Class: Tep::AuthOAuth2Code
- Inherits:
-
Object
- Object
- Tep::AuthOAuth2Code
- Defined in:
- lib/tep/auth_oauth2_code.rb
Instance Attribute Summary collapse
-
#caps_str ⇒ Object
readonly
comma-separated symbols (granted subset).
-
#client_id ⇒ Object
readonly
which client this code was issued for.
-
#code ⇒ Object
readonly
opaque base64url string.
-
#expires_at ⇒ Object
readonly
unix epoch seconds; >= now means alive.
-
#principal_id ⇒ Object
readonly
the human granting access.
Instance Method Summary collapse
- #expired?(now) ⇒ Boolean
-
#initialize(code, principal_id, client_id, caps_str, expires_at) ⇒ AuthOAuth2Code
constructor
A new instance of AuthOAuth2Code.
Constructor Details
#initialize(code, principal_id, client_id, caps_str, expires_at) ⇒ AuthOAuth2Code
Returns a new instance of AuthOAuth2Code.
28 29 30 31 32 33 34 |
# File 'lib/tep/auth_oauth2_code.rb', line 28 def initialize(code, principal_id, client_id, caps_str, expires_at) @code = code @principal_id = principal_id @client_id = client_id @caps_str = caps_str @expires_at = expires_at end |
Instance Attribute Details
#caps_str ⇒ Object (readonly)
comma-separated symbols (granted subset)
25 26 27 |
# File 'lib/tep/auth_oauth2_code.rb', line 25 def caps_str @caps_str end |
#client_id ⇒ Object (readonly)
which client this code was issued for
24 25 26 |
# File 'lib/tep/auth_oauth2_code.rb', line 24 def client_id @client_id end |
#code ⇒ Object (readonly)
opaque base64url string
22 23 24 |
# File 'lib/tep/auth_oauth2_code.rb', line 22 def code @code end |
#expires_at ⇒ Object (readonly)
unix epoch seconds; >= now means alive
26 27 28 |
# File 'lib/tep/auth_oauth2_code.rb', line 26 def expires_at @expires_at end |
#principal_id ⇒ Object (readonly)
the human granting access
23 24 25 |
# File 'lib/tep/auth_oauth2_code.rb', line 23 def principal_id @principal_id end |
Instance Method Details
#expired?(now) ⇒ Boolean
36 37 38 |
# File 'lib/tep/auth_oauth2_code.rb', line 36 def expired?(now) now >= @expires_at end |