Class: Conjur::WebServer::Authorize
- Inherits:
-
Object
- Object
- Conjur::WebServer::Authorize
- Defined in:
- lib/conjur/webserver/authorize.rb
Overview
Verifies that the request contains the authorization token, and then strips it.
Instance Attribute Summary collapse
-
#app ⇒ Object
readonly
Returns the value of attribute app.
-
#sessionid ⇒ Object
readonly
Returns the value of attribute sessionid.
Instance Method Summary collapse
- #call(env) ⇒ Object
-
#initialize(app, sessionid) ⇒ Authorize
constructor
A new instance of Authorize.
Constructor Details
#initialize(app, sessionid) ⇒ Authorize
Returns a new instance of Authorize.
7 8 9 10 |
# File 'lib/conjur/webserver/authorize.rb', line 7 def initialize(app, sessionid) @app = app @sessionid = sessionid end |
Instance Attribute Details
#app ⇒ Object (readonly)
Returns the value of attribute app.
5 6 7 |
# File 'lib/conjur/webserver/authorize.rb', line 5 def app @app end |
#sessionid ⇒ Object (readonly)
Returns the value of attribute sessionid.
5 6 7 |
# File 'lib/conjur/webserver/authorize.rb', line 5 def sessionid @sessionid end |
Instance Method Details
#call(env) ⇒ Object
12 13 14 15 16 17 18 |
# File 'lib/conjur/webserver/authorize.rb', line 12 def call(env) if token_valid?(env) @app.call env else [403, {}, ["Authorization is missing or invalid"]] end end |