Class: Ksef::Auth::Tokens
- Inherits:
-
Data
- Object
- Data
- Ksef::Auth::Tokens
- Defined in:
- lib/ksef/auth/tokens.rb
Overview
The pair returned by POST /auth/token/redeem — the contract's
AuthenticationTokensResponse.
Redemption is single-use: a second call with the same authentication token returns 400 (docs/REFERENCE.md §4.2). Losing this object means repeating the whole flow, signature included, so it is worth persisting deliberately rather than incidentally.
Instance Attribute Summary collapse
-
#access_token ⇒ Object
readonly
Returns the value of attribute access_token.
-
#refresh_token ⇒ Object
readonly
Returns the value of attribute refresh_token.
Class Method Summary collapse
Instance Method Summary collapse
-
#expired?(now = Time.now) ⇒ Boolean
Revocation is not immediate: an access token stays valid to its
expeven after permissions change (§4.2).
Instance Attribute Details
#access_token ⇒ Object (readonly)
Returns the value of attribute access_token
11 12 13 |
# File 'lib/ksef/auth/tokens.rb', line 11 def access_token @access_token end |
#refresh_token ⇒ Object (readonly)
Returns the value of attribute refresh_token
11 12 13 |
# File 'lib/ksef/auth/tokens.rb', line 11 def refresh_token @refresh_token end |
Class Method Details
Instance Method Details
#expired?(now = Time.now) ⇒ Boolean
Revocation is not immediate: an access token stays valid to its exp even after
permissions change (§4.2). Possession is not proof of current authorisation.
21 |
# File 'lib/ksef/auth/tokens.rb', line 21 def expired?(now = Time.now) = access_token.nil? || access_token.expired?(now) |