Class: MekariSso::Revoke

Inherits:
HttpRequest show all
Defined in:
lib/requests/revoke.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from HttpRequest

#after_error, #after_success, #handle_error, #handle_response, #headers, #original_response, #params

Constructor Details

#initialize(config, token) ⇒ Revoke



11
12
13
14
# File 'lib/requests/revoke.rb', line 11

def initialize(config, token)
  @config = config
  @token = token
end

Instance Attribute Details

#configObject (readonly)

Returns the value of attribute config.



9
10
11
# File 'lib/requests/revoke.rb', line 9

def config
  @config
end

#tokenObject (readonly)

Returns the value of attribute token.



9
10
11
# File 'lib/requests/revoke.rb', line 9

def token
  @token
end

Instance Method Details

#headers_requestObject



16
17
18
19
20
# File 'lib/requests/revoke.rb', line 16

def headers_request
  headers.merge({
    authorization: "Bearer #{@token}"
  })
end

#sendObject



22
23
24
# File 'lib/requests/revoke.rb', line 22

def send
  RestClient.delete "#{@config.base_url}/auth/oauth2/token", headers_request
end