Class: Rack::UrlAuth
- Inherits:
-
Object
- Object
- Rack::UrlAuth
- Defined in:
- lib/rack/url_auth.rb,
lib/rack/url_auth/proxy.rb,
lib/rack/url_auth/signer.rb,
lib/rack/url_auth/version.rb
Defined Under Namespace
Constant Summary collapse
- VERSION =
"0.2.1"
Instance Attribute Summary collapse
-
#app ⇒ Object
readonly
Returns the value of attribute app.
-
#forward_auth ⇒ Object
readonly
Returns the value of attribute forward_auth.
-
#signer ⇒ Object
readonly
Returns the value of attribute signer.
Instance Method Summary collapse
- #call(env) ⇒ Object
-
#initialize(app, opts = {}) ⇒ UrlAuth
constructor
A new instance of UrlAuth.
Constructor Details
#initialize(app, opts = {}) ⇒ UrlAuth
Returns a new instance of UrlAuth.
9 10 11 12 13 14 15 16 |
# File 'lib/rack/url_auth.rb', line 9 def initialize(app, opts = {}) secret = opts[:secret] or raise(ArgumentError, 'Please provide `secret`') @app = app @signer = Signer.new(secret) @forward_auth = !!opts[:forward_auth] end |
Instance Attribute Details
#app ⇒ Object (readonly)
Returns the value of attribute app.
7 8 9 |
# File 'lib/rack/url_auth.rb', line 7 def app @app end |
#forward_auth ⇒ Object (readonly)
Returns the value of attribute forward_auth.
7 8 9 |
# File 'lib/rack/url_auth.rb', line 7 def forward_auth @forward_auth end |
#signer ⇒ Object (readonly)
Returns the value of attribute signer.
7 8 9 |
# File 'lib/rack/url_auth.rb', line 7 def signer @signer end |