Class: Authentik::Client::Configuration

Inherits:
Api::Configuration
  • Object
show all
Defined in:
lib/authentik/client/configuration.rb

Overview

Global configuration for Authentik::Client. Subclasses Api::Configuration so all underlying API settings (e.g., verify_ssl, timeout, debugging) are available directly. Adds a token accessor as a friendlier alias for access_token.

Use configure to set configuration at startup.

Examples:

Configure at startup (e.g., in a Rails initializer)

Authentik::Client.configure do |config|
  config.host  = "authentik.example.com"
  config.token = "your-api-token"
end

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeConfiguration

Returns a new instance of Configuration.



20
21
22
23
24
25
26
# File 'lib/authentik/client/configuration.rb', line 20

def initialize
  super
  # Override parent defaults: host is intentionally nil until the user
  # sets it, so Client can detect when it has not been configured.
  @host = nil
  @scheme = "https"
end

Instance Attribute Details

#logger=(value) ⇒ Object (writeonly)

Sets the attribute logger

Parameters:

  • value

    the value to set the attribute logger to.



18
19
20
# File 'lib/authentik/client/configuration.rb', line 18

def logger=(value)
  @logger = value
end

Instance Method Details

#tokenString?

Returns The API bearer token for authentication. Alias for access_token.

Returns:

  • (String, nil)

    The API bearer token for authentication. Alias for access_token.



29
30
31
# File 'lib/authentik/client/configuration.rb', line 29

def token
  access_token
end

#token=(value) ⇒ Object

Parameters:

  • value (String, nil)


34
35
36
# File 'lib/authentik/client/configuration.rb', line 34

def token=(value)
  self.access_token = value
end