Module: OAuth::Signature
- Defined in:
- lib/oauth/signature.rb,
lib/oauth/signature/md5.rb,
lib/oauth/signature/base.rb,
lib/oauth/signature/sha1.rb,
lib/oauth/signature/plaintext.rb
Defined Under Namespace
Modules: HMAC, RSA Classes: Base, MD5, PLAINTEXT, SHA1, UnknownSignatureMethod
Class Method Summary collapse
-
.available_methods ⇒ Object
Returns a list of available signature methods.
-
.build(request, options = {}, &block) ⇒ Object
Build a signature from a
request
. -
.sign(request, options = {}, &block) ⇒ Object
Sign a
request
. -
.signature_base_string(request, options = {}, &block) ⇒ Object
Create the signature base string for
request
. -
.verify(request, options = {}, &block) ⇒ Object
Verify the signature of
request
.
Class Method Details
.available_methods ⇒ Object
Returns a list of available signature methods
4 5 6 |
# File 'lib/oauth/signature.rb', line 4 def self.available_methods @available_methods ||= {} end |
.build(request, options = {}, &block) ⇒ Object
Build a signature from a request
.
Raises UnknownSignatureMethod exception if the signature method is unknown.
11 12 13 14 15 16 |
# File 'lib/oauth/signature.rb', line 11 def self.build(request, = {}, &block) request = OAuth::RequestProxy.proxy(request, ) klass = available_methods[(request.signature_method || "").downcase] raise UnknownSignatureMethod, request.signature_method unless klass klass.new(request, , &block) end |
.sign(request, options = {}, &block) ⇒ Object
Sign a request
19 20 21 |
# File 'lib/oauth/signature.rb', line 19 def self.sign(request, = {}, &block) self.build(request, , &block).signature end |
.signature_base_string(request, options = {}, &block) ⇒ Object
Create the signature base string for request
. This string is the normalized parameter information.
31 32 33 |
# File 'lib/oauth/signature.rb', line 31 def self.signature_base_string(request, = {}, &block) self.build(request, , &block).signature_base_string end |
.verify(request, options = {}, &block) ⇒ Object
Verify the signature of request
24 25 26 |
# File 'lib/oauth/signature.rb', line 24 def self.verify(request, = {}, &block) self.build(request, , &block).verify end |