Class: Rack::UrlAuth::Proxy
- Inherits:
-
Object
- Object
- Rack::UrlAuth::Proxy
- Defined in:
- lib/rack/url_auth/proxy.rb
Instance Attribute Summary collapse
-
#request ⇒ Object
readonly
Returns the value of attribute request.
-
#signer ⇒ Object
readonly
Returns the value of attribute signer.
Instance Method Summary collapse
- #authorized? ⇒ Boolean
-
#initialize(env, signer) ⇒ Proxy
constructor
A new instance of Proxy.
Constructor Details
Instance Attribute Details
#request ⇒ Object (readonly)
Returns the value of attribute request.
4 5 6 |
# File 'lib/rack/url_auth/proxy.rb', line 4 def request @request end |
#signer ⇒ Object (readonly)
Returns the value of attribute signer.
4 5 6 |
# File 'lib/rack/url_auth/proxy.rb', line 4 def signer @signer end |
Instance Method Details
#authorized? ⇒ Boolean
11 12 13 14 15 16 17 18 19 20 21 |
# File 'lib/rack/url_auth/proxy.rb', line 11 def method = request.request_method.downcase signature_header = request.env["HTTP_X_SIGNATURE"] if !signature_header && request.get? || request.head? signer.verify_url(request.url, method) else body = request.body.read; request.body.rewind signer.verify(method + request.url + body, signature_header) end end |