Class: ThreeScale::Middleware
- Inherits:
-
Rack::Auth::Basic
- Object
- Rack::Auth::Basic
- ThreeScale::Middleware
- Defined in:
- lib/3scale/middleware.rb
Defined Under Namespace
Classes: AppIdAuthenticator, NilAuthenticator, UserKeyAuthenticator
Constant Summary collapse
- DEFAULT_OPTIONS =
{ secure: true, persistent: true }
Instance Attribute Summary collapse
-
#authenticator ⇒ Object
readonly
Returns the value of attribute authenticator.
-
#client ⇒ Object
readonly
Returns the value of attribute client.
Instance Method Summary collapse
-
#initialize(app, provider_key, mode, options = {}) ⇒ Middleware
constructor
A new instance of Middleware.
Constructor Details
#initialize(app, provider_key, mode, options = {}) ⇒ Middleware
Returns a new instance of Middleware.
12 13 14 15 16 17 |
# File 'lib/3scale/middleware.rb', line 12 def initialize(app, provider_key, mode, = {}) = DEFAULT_OPTIONS.merge().merge(provider_key: provider_key) @client = ThreeScale::Client.new() super(app, '3scale Authentication', &authenticator_for(mode)) end |
Instance Attribute Details
#authenticator ⇒ Object (readonly)
Returns the value of attribute authenticator.
8 9 10 |
# File 'lib/3scale/middleware.rb', line 8 def authenticator @authenticator end |
#client ⇒ Object (readonly)
Returns the value of attribute client.
8 9 10 |
# File 'lib/3scale/middleware.rb', line 8 def client @client end |