Class: Conductor::AuthenticationSettings

Inherits:
Object
  • Object
show all
Defined in:
lib/conductor/configuration/authentication_settings.rb

Overview

Authentication settings for Conductor server

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(key_id: nil, key_secret: nil) ⇒ AuthenticationSettings

Returns a new instance of AuthenticationSettings.



8
9
10
11
# File 'lib/conductor/configuration/authentication_settings.rb', line 8

def initialize(key_id: nil, key_secret: nil)
  @key_id = key_id || ENV.fetch('CONDUCTOR_AUTH_KEY', nil)
  @key_secret = key_secret || ENV.fetch('CONDUCTOR_AUTH_SECRET', nil)
end

Instance Attribute Details

#key_idObject

Returns the value of attribute key_id.



6
7
8
# File 'lib/conductor/configuration/authentication_settings.rb', line 6

def key_id
  @key_id
end

#key_secretObject

Returns the value of attribute key_secret.



6
7
8
# File 'lib/conductor/configuration/authentication_settings.rb', line 6

def key_secret
  @key_secret
end

Instance Method Details

#configured?Boolean

Returns:

  • (Boolean)


13
14
15
# File 'lib/conductor/configuration/authentication_settings.rb', line 13

def configured?
  !key_id.nil? && !key_secret.nil? && !key_id.empty? && !key_secret.empty?
end