Class: Rack::OAuth2::AccessToken::Authenticator

Inherits:
Object
  • Object
show all
Defined in:
lib/rack/oauth2/access_token/authenticator.rb

Instance Method Summary collapse

Constructor Details

#initialize(token) ⇒ Authenticator

Returns a new instance of Authenticator.



5
6
7
# File 'lib/rack/oauth2/access_token/authenticator.rb', line 5

def initialize(token)
  @token = token
end

Instance Method Details

#filter_request(request) ⇒ Object

Callback called in HTTPClient (before sending a request)

request

HTTP::Message



11
12
13
# File 'lib/rack/oauth2/access_token/authenticator.rb', line 11

def filter_request(request)
  @token.authenticate(request)
end

#filter_response(response, request) ⇒ Object

Callback called in HTTPClient (after received a response)

response

HTTP::Message

request

HTTP::Message



18
19
20
# File 'lib/rack/oauth2/access_token/authenticator.rb', line 18

def filter_response(response, request)
  # nothing to do
end