Class: OpenFga::TokenManager::Oauth2TokenManager::Config

Inherits:
Object
  • Object
show all
Defined in:
lib/openfga/token_manager/token_manager.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(client_id:, client_secret:, token_issuer:, audience: nil, logger: nil) ⇒ Config

Returns a new instance of Config.

Raises:



39
40
41
42
43
44
45
46
47
48
49
# File 'lib/openfga/token_manager/token_manager.rb', line 39

def initialize(client_id:, client_secret:, token_issuer:, audience: nil, logger: nil)
  raise ConfigurationError, 'missing client_id' if client_id.blank?
  raise ConfigurationError, 'missing client_secret' if client_secret.blank?
  raise ConfigurationError, 'missing token_issuer' if token_issuer.blank?

  @client_id = client_id
  @client_secret = client_secret
  @token_issuer = token_issuer
  @audience = audience
  @logger = logger
end

Instance Attribute Details

#audienceObject (readonly)

Returns the value of attribute audience.



37
38
39
# File 'lib/openfga/token_manager/token_manager.rb', line 37

def audience
  @audience
end

#client_idObject (readonly)

Returns the value of attribute client_id.



37
38
39
# File 'lib/openfga/token_manager/token_manager.rb', line 37

def client_id
  @client_id
end

#client_secretObject (readonly)

Returns the value of attribute client_secret.



37
38
39
# File 'lib/openfga/token_manager/token_manager.rb', line 37

def client_secret
  @client_secret
end

#loggerObject (readonly)

Returns the value of attribute logger.



37
38
39
# File 'lib/openfga/token_manager/token_manager.rb', line 37

def logger
  @logger
end

#token_issuerObject (readonly)

Returns the value of attribute token_issuer.



37
38
39
# File 'lib/openfga/token_manager/token_manager.rb', line 37

def token_issuer
  @token_issuer
end