Class: NebulaToken::IssueResult
- Inherits:
-
Object
- Object
- NebulaToken::IssueResult
- Defined in:
- lib/nebula_token.rb
Overview
Result of Engine#issue. Every timestamp is integer unix seconds ([N-2]).
Instance Attribute Summary collapse
-
#expires_at ⇒ Object
readonly
Returns the value of attribute expires_at.
-
#family_id ⇒ Object
readonly
Returns the value of attribute family_id.
-
#generation ⇒ Object
readonly
Returns the value of attribute generation.
-
#idle_expires_at ⇒ Object
readonly
Returns the value of attribute idle_expires_at.
-
#token ⇒ Object
readonly
Returns the value of attribute token.
-
#user_id ⇒ Object
readonly
Returns the value of attribute user_id.
Instance Method Summary collapse
-
#initialize(token:, user_id:, family_id:, generation:, expires_at:, idle_expires_at:) ⇒ IssueResult
constructor
A new instance of IssueResult.
-
#inspect ⇒ Object
(also: #to_s)
[N-14]: the token embeds the raw verifier, so it must never reach a debug representation —
p issuedor"#{issued}"in a controller would otherwise write a live credential into the log.
Constructor Details
#initialize(token:, user_id:, family_id:, generation:, expires_at:, idle_expires_at:) ⇒ IssueResult
Returns a new instance of IssueResult.
497 498 499 500 501 502 503 504 505 |
# File 'lib/nebula_token.rb', line 497 def initialize(token:, user_id:, family_id:, generation:, expires_at:, idle_expires_at:) @token = token @user_id = user_id @family_id = family_id @generation = generation @expires_at = expires_at @idle_expires_at = idle_expires_at freeze end |
Instance Attribute Details
#expires_at ⇒ Object (readonly)
Returns the value of attribute expires_at.
495 496 497 |
# File 'lib/nebula_token.rb', line 495 def expires_at @expires_at end |
#family_id ⇒ Object (readonly)
Returns the value of attribute family_id.
495 496 497 |
# File 'lib/nebula_token.rb', line 495 def family_id @family_id end |
#generation ⇒ Object (readonly)
Returns the value of attribute generation.
495 496 497 |
# File 'lib/nebula_token.rb', line 495 def generation @generation end |
#idle_expires_at ⇒ Object (readonly)
Returns the value of attribute idle_expires_at.
495 496 497 |
# File 'lib/nebula_token.rb', line 495 def idle_expires_at @idle_expires_at end |
#token ⇒ Object (readonly)
Returns the value of attribute token.
495 496 497 |
# File 'lib/nebula_token.rb', line 495 def token @token end |
#user_id ⇒ Object (readonly)
Returns the value of attribute user_id.
495 496 497 |
# File 'lib/nebula_token.rb', line 495 def user_id @user_id end |
Instance Method Details
#inspect ⇒ Object Also known as: to_s
[N-14]: the token embeds the raw verifier, so it must never reach a debug
representation — p issued or "#{issued}" in a controller would
otherwise write a live credential into the log.
510 511 512 513 514 |
# File 'lib/nebula_token.rb', line 510 def inspect "#<NebulaToken::IssueResult token=[REDACTED] user_id=#{@user_id.inspect} " \ "family_id=#{@family_id.inspect} generation=#{@generation} " \ "expires_at=#{@expires_at} idle_expires_at=#{@idle_expires_at}>" end |