Class: AuthHMAC::CanonicalString
- Inherits:
-
String
- Object
- String
- AuthHMAC::CanonicalString
- Includes:
- Headers
- Defined in:
- lib/auth-hmac.rb
Overview
Build a Canonical String for a HTTP request.
A Canonical String has the following format:
CanonicalString = HTTP-Verb + “n” +
Content-Type + "\n" +
Content-MD5 + "\n" +
Date + "\n" +
request-uri;
If the Date header doesn’t exist, one will be generated since Net/HTTP will generate one if it doesn’t exist and it will be used on the server side to do authentication.
Instance Attribute Summary collapse
-
#authenticate_referrer ⇒ Object
readonly
Returns the value of attribute authenticate_referrer.
-
#request ⇒ Object
readonly
Returns the value of attribute request.
Instance Method Summary collapse
-
#initialize(request, authenticate_referrer = false) ⇒ CanonicalString
constructor
A new instance of CanonicalString.
Methods included from Headers
Constructor Details
#initialize(request, authenticate_referrer = false) ⇒ CanonicalString
Returns a new instance of CanonicalString.
76 77 78 79 80 81 82 |
# File 'lib/auth-hmac.rb', line 76 def initialize(request, authenticate_referrer=false) @request = request @authenticate_referrer = authenticate_referrer self << request_method + "\n" self << header_values + "\n" self << request_path end |
Instance Attribute Details
#authenticate_referrer ⇒ Object (readonly)
Returns the value of attribute authenticate_referrer.
83 84 85 |
# File 'lib/auth-hmac.rb', line 83 def authenticate_referrer @authenticate_referrer end |
#request ⇒ Object (readonly)
Returns the value of attribute request.
83 84 85 |
# File 'lib/auth-hmac.rb', line 83 def request @request end |