Class: Rack::OAuth2::Server::Abstract::Handler
- Inherits:
-
Object
- Object
- Rack::OAuth2::Server::Abstract::Handler
- Defined in:
- lib/rack/oauth2/server/abstract/handler.rb
Direct Known Subclasses
Rack::OAuth2::Server::Authorize, Rack::OAuth2::Server::Authorize::Code, Rack::OAuth2::Server::Authorize::Extension::CodeAndToken, Rack::OAuth2::Server::Authorize::Token, Resource, Token, Token::AuthorizationCode, Token::ClientCredentials, Token::Extension::Example, Token::JWTBearer, Token::Password, Token::RefreshToken, Token::SAML2Bearer
Instance Attribute Summary collapse
-
#authenticator ⇒ Object
Returns the value of attribute authenticator.
-
#request ⇒ Object
Returns the value of attribute request.
-
#response ⇒ Object
Returns the value of attribute response.
Instance Method Summary collapse
- #_call(env) ⇒ Object
- #call(env) ⇒ Object
-
#initialize(&authenticator) ⇒ Handler
constructor
A new instance of Handler.
Constructor Details
#initialize(&authenticator) ⇒ Handler
Returns a new instance of Handler.
8 9 10 |
# File 'lib/rack/oauth2/server/abstract/handler.rb', line 8 def initialize(&authenticator) @authenticator = authenticator end |
Instance Attribute Details
#authenticator ⇒ Object
Returns the value of attribute authenticator.
6 7 8 |
# File 'lib/rack/oauth2/server/abstract/handler.rb', line 6 def authenticator @authenticator end |
#request ⇒ Object
Returns the value of attribute request.
6 7 8 |
# File 'lib/rack/oauth2/server/abstract/handler.rb', line 6 def request @request end |
#response ⇒ Object
Returns the value of attribute response.
6 7 8 |
# File 'lib/rack/oauth2/server/abstract/handler.rb', line 6 def response @response end |
Instance Method Details
#_call(env) ⇒ Object
20 21 22 23 |
# File 'lib/rack/oauth2/server/abstract/handler.rb', line 20 def _call(env) @authenticator.call(@request, @response) if @authenticator @response end |
#call(env) ⇒ Object
12 13 14 15 16 17 18 |
# File 'lib/rack/oauth2/server/abstract/handler.rb', line 12 def call(env) # NOTE: # Rack middleware is initialized only on the first request of the process. # So any instance variables are acts like class variables, and modifying them in call() isn't thread-safe. # ref.) http://stackoverflow.com/questions/23028226/rack-middleware-and-thread-safety dup._call(env) end |