Class: Lark::TokenStore::IsvTenantToken

Inherits:
Base
  • Object
show all
Defined in:
lib/lark/token_store/isv_tenant_token.rb

Instance Attribute Summary

Attributes inherited from Base

#client

Instance Method Summary collapse

Methods inherited from Base

#initialize, #token, #update_token, #valid?

Constructor Details

This class inherits a constructor from Lark::TokenStore::Base

Instance Method Details

#fetch_tokenObject



10
11
12
13
14
15
# File 'lib/lark/token_store/isv_tenant_token.rb', line 10

def fetch_token
  client.request.post 'auth/v3/tenant_access_token/', {
    app_access_token: client.app_access_token,
    tenant_key: client.tenant_key
  }
end

#redis_keyObject



17
18
19
# File 'lib/lark/token_store/isv_tenant_token.rb', line 17

def redis_key
  @redis_key ||= Digest::MD5.hexdigest "#{self.class.name}_#{client.app_id}_#{client.app_secret}_#{client.tenant_key}"
end

#token_keyObject



6
7
8
# File 'lib/lark/token_store/isv_tenant_token.rb', line 6

def token_key
  'tenant_access_token'
end