Class: Acme::Authorizer::Configuration

Inherits:
Object
  • Object
show all
Defined in:
lib/acme/authorizer/configuration.rb

Instance Method Summary collapse

Constructor Details

#initializeConfiguration

Returns a new instance of Configuration.



4
5
6
7
# File 'lib/acme/authorizer/configuration.rb', line 4

def initialize
  @tokens = {}
  add_tokens_from_env
end

Instance Method Details

#add_token(token, key_authorization) ⇒ Object



9
10
11
# File 'lib/acme/authorizer/configuration.rb', line 9

def add_token(token, key_authorization)
  @tokens[token] = key_authorization
end

#key_authorization_for_token(token) ⇒ Object



17
18
19
# File 'lib/acme/authorizer/configuration.rb', line 17

def key_authorization_for_token(token)
  @tokens[token]
end

#valid_token?(token) ⇒ Boolean

Returns:

  • (Boolean)


13
14
15
# File 'lib/acme/authorizer/configuration.rb', line 13

def valid_token?(token)
  @tokens.key?(token)
end