Class: Rack::OAuth2::Server::Resource::MAC::Request

Inherits:
Request
  • Object
show all
Defined in:
lib/rack/oauth2/server/resource/mac.rb

Instance Attribute Summary collapse

Attributes inherited from Request

#access_token

Instance Method Summary collapse

Methods inherited from Request

#initialize

Constructor Details

This class inherits a constructor from Rack::OAuth2::Server::Resource::Request

Instance Attribute Details

#extObject (readonly)

Returns the value of attribute ext.



14
15
16
# File 'lib/rack/oauth2/server/resource/mac.rb', line 14

def ext
  @ext
end

#nonceObject (readonly)

Returns the value of attribute nonce.



14
15
16
# File 'lib/rack/oauth2/server/resource/mac.rb', line 14

def nonce
  @nonce
end

#signatureObject (readonly)

Returns the value of attribute signature.



14
15
16
# File 'lib/rack/oauth2/server/resource/mac.rb', line 14

def signature
  @signature
end

#tsObject (readonly)

Returns the value of attribute ts.



14
15
16
# File 'lib/rack/oauth2/server/resource/mac.rb', line 14

def ts
  @ts
end

Instance Method Details

#oauth2?Boolean

Returns:

  • (Boolean)


26
27
28
# File 'lib/rack/oauth2/server/resource/mac.rb', line 26

def oauth2?
  @auth_header.provided? && @auth_header.scheme.to_s == 'mac'
end

#setup!Object



16
17
18
19
20
21
22
23
24
# File 'lib/rack/oauth2/server/resource/mac.rb', line 16

def setup!
  auth_params = Rack::Auth::Digest::Params.parse(@auth_header.params).with_indifferent_access
  @access_token = auth_params[:id]
  @nonce = auth_params[:nonce]
  @ts = auth_params[:ts]
  @ext = auth_params[:ext]
  @signature = auth_params[:mac]
  self
end