Class: DWH::TokenStore

Inherits:
Object
  • Object
show all
Defined in:
lib/dwh/token_store.rb

Overview

Optional contract for host applications that want token persistence.

The store instance should be identity-bound before it is passed into adapter config so the adapter remains unaware of user/datasource identity.

This class is intentionally minimal and can be subclassed or duck-typed.

Instance Method Summary collapse

Instance Method Details

#deleteObject

Remove/revoke persisted token state.

Raises:

  • (NotImplementedError)


20
21
22
# File 'lib/dwh/token_store.rb', line 20

def delete
  raise NotImplementedError, "#{self.class} must implement ##{__method__}"
end

#loadHash?

Returns token payload.

Returns:

  • (Hash, nil)

    token payload

Raises:

  • (NotImplementedError)


10
11
12
# File 'lib/dwh/token_store.rb', line 10

def load
  raise NotImplementedError, "#{self.class} must implement ##{__method__}"
end

#store(_token) ⇒ Object

Parameters:

  • token (Hash)

    normalized payload with at least access_token and expires_at

Raises:

  • (NotImplementedError)


15
16
17
# File 'lib/dwh/token_store.rb', line 15

def store(_token)
  raise NotImplementedError, "#{self.class} must implement ##{__method__}"
end