Class: HaveAPI::Authentication::OAuth2::RevokeEndpoint::Request
- Inherits:
-
Rack::OAuth2::Server::Abstract::Request
- Object
- Rack::OAuth2::Server::Abstract::Request
- HaveAPI::Authentication::OAuth2::RevokeEndpoint::Request
- Defined in:
- lib/haveapi/authentication/oauth2/revoke_endpoint.rb
Instance Method Summary collapse
-
#initialize(env) ⇒ Request
constructor
A new instance of Request.
- #invalid_client!(description = nil, options = {}) ⇒ Object
- #invalid_request!(description = nil, options = {}) ⇒ Object
- #unsupported_token_type!(description = nil, options = {}) ⇒ Object
Constructor Details
#initialize(env) ⇒ Request
Returns a new instance of Request.
20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 |
# File 'lib/haveapi/authentication/oauth2/revoke_endpoint.rb', line 20 def initialize(env) auth = Rack::Auth::Basic::Request.new(env) if auth.provided? && auth.basic? @client_id, @client_secret = auth.credentials.map do |credential| Rack::OAuth2::Util.www_form_url_decode(credential) end end super @client_secret ||= params['client_secret'] @token = params['token'] @token_type_hint = params['token_type_hint'] invalid_request! unless scalar_request_params? rescue ArgumentError, EncodingError invalid_request! end |
Instance Method Details
#invalid_client!(description = nil, options = {}) ⇒ Object
39 40 41 42 43 44 45 |
# File 'lib/haveapi/authentication/oauth2/revoke_endpoint.rb', line 39 def invalid_client!(description = nil, = {}) raise Rack::OAuth2::Server::Token::Unauthorized.new( :invalid_client, description, ) end |
#invalid_request!(description = nil, options = {}) ⇒ Object
47 48 49 50 51 52 53 |
# File 'lib/haveapi/authentication/oauth2/revoke_endpoint.rb', line 47 def invalid_request!(description = nil, = {}) raise Rack::OAuth2::Server::Abstract::BadRequest.new( :invalid_request, description, ) end |
#unsupported_token_type!(description = nil, options = {}) ⇒ Object
55 56 57 58 59 60 61 |
# File 'lib/haveapi/authentication/oauth2/revoke_endpoint.rb', line 55 def unsupported_token_type!(description = nil, = {}) raise Rack::OAuth2::Server::Abstract::BadRequest.new( :unsupported_token_type, description, ) end |