Class: StatelyDB::Common::Auth::AuthTokenProvider::TokenState

Inherits:
Object
  • Object
show all
Defined in:
lib/common/auth/auth_token_provider.rb

Overview

Persistent state for the token provider

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(token:, expires_at_unix_secs:) ⇒ TokenState

Create a new TokenState



204
205
206
207
# File 'lib/common/auth/auth_token_provider.rb', line 204

def initialize(token:, expires_at_unix_secs:)
  @token = token
  @expires_at_unix_secs = expires_at_unix_secs
end

Instance Attribute Details

#expires_at_unix_secsInteger (readonly)



198
199
200
201
202
203
204
205
206
207
208
# File 'lib/common/auth/auth_token_provider.rb', line 198

class TokenState
  attr_reader :token, :expires_at_unix_secs

  # Create a new TokenState
  # @param [String] token The access token
  # @param [Integer] expires_at_unix_secs The unix timestamp when the token expires
  def initialize(token:, expires_at_unix_secs:)
    @token = token
    @expires_at_unix_secs = expires_at_unix_secs
  end
end

#tokenString (readonly)



198
199
200
201
202
203
204
205
206
207
208
# File 'lib/common/auth/auth_token_provider.rb', line 198

class TokenState
  attr_reader :token, :expires_at_unix_secs

  # Create a new TokenState
  # @param [String] token The access token
  # @param [Integer] expires_at_unix_secs The unix timestamp when the token expires
  def initialize(token:, expires_at_unix_secs:)
    @token = token
    @expires_at_unix_secs = expires_at_unix_secs
  end
end