Class: Rack::Authenticate::Middleware::Configuration

Inherits:
Object
  • Object
show all
Defined in:
lib/rack/authenticate/middleware.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(*args) ⇒ Configuration

Returns a new instance of Configuration.



9
10
11
12
13
# File 'lib/rack/authenticate/middleware.rb', line 9

def initialize(*args)
  self.timestamp_minute_tolerance ||= 30
  self.hmac_secret_key { |access_id| }
  self.basic_auth_validation { |u, p| false }
end

Instance Attribute Details

#basic_auth_validation_blockObject (readonly)

Returns the value of attribute basic_auth_validation_block.



16
17
18
# File 'lib/rack/authenticate/middleware.rb', line 16

def basic_auth_validation_block
  @basic_auth_validation_block
end

#timestamp_minute_toleranceObject

Returns the value of attribute timestamp_minute_tolerance.



15
16
17
# File 'lib/rack/authenticate/middleware.rb', line 15

def timestamp_minute_tolerance
  @timestamp_minute_tolerance
end

Instance Method Details

#basic_auth_validation(&block) ⇒ Object



26
27
28
# File 'lib/rack/authenticate/middleware.rb', line 26

def basic_auth_validation(&block)
  @basic_auth_validation_block = block
end

#hmac_secret_key(&block) ⇒ Object



18
19
20
# File 'lib/rack/authenticate/middleware.rb', line 18

def hmac_secret_key(&block)
  @hmac_secret_key_block = block
end

#hmac_secret_key_for(access_id) ⇒ Object



22
23
24
# File 'lib/rack/authenticate/middleware.rb', line 22

def hmac_secret_key_for(access_id)
  @hmac_secret_key_block[access_id]
end