Class: AtprotoAuth::Configuration

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

Overview

Configuration class for global AtprotoAuth settings

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeConfiguration

Returns a new instance of Configuration.



17
18
19
20
21
22
23
24
# File 'lib/atproto_auth/configuration.rb', line 17

def initialize
  @default_token_lifetime = 300 # 5 minutes in seconds
  @dpop_nonce_lifetime = 300 # 5 minutes in seconds
  @encryption = nil
  @http_client = nil
  @logger = Logger.new($stdout)
  @storage = AtprotoAuth::Storage::Memory.new
end

Instance Attribute Details

#default_token_lifetimeObject

Returns the value of attribute default_token_lifetime.



10
11
12
# File 'lib/atproto_auth/configuration.rb', line 10

def default_token_lifetime
  @default_token_lifetime
end

#dpop_nonce_lifetimeObject

Returns the value of attribute dpop_nonce_lifetime.



10
11
12
# File 'lib/atproto_auth/configuration.rb', line 10

def dpop_nonce_lifetime
  @dpop_nonce_lifetime
end

#encryptionObject

Returns the value of attribute encryption.



10
11
12
# File 'lib/atproto_auth/configuration.rb', line 10

def encryption
  @encryption
end

#http_clientObject

Returns the value of attribute http_client.



10
11
12
# File 'lib/atproto_auth/configuration.rb', line 10

def http_client
  @http_client
end

#loggerObject

Returns the value of attribute logger.



10
11
12
# File 'lib/atproto_auth/configuration.rb', line 10

def logger
  @logger
end

#storageObject

Returns the value of attribute storage.



10
11
12
# File 'lib/atproto_auth/configuration.rb', line 10

def storage
  @storage
end

Instance Method Details

#validate!Object

Validates the current configuration

Raises:



28
29
30
31
32
# File 'lib/atproto_auth/configuration.rb', line 28

def validate!
  validate_storage!
  validate_http_client!
  true
end