Class: DuoApi::HeaderSignature
- Inherits:
-
Object
- Object
- DuoApi::HeaderSignature
- Defined in:
- lib/duo-api/header_signature.rb
Constant Summary
Constants included from Digesting
Constants included from Util
Instance Attribute Summary collapse
-
#client ⇒ Object
readonly
Returns the value of attribute client.
-
#method ⇒ Object
readonly
Returns the value of attribute method.
-
#path ⇒ Object
readonly
Returns the value of attribute path.
-
#query_body_string ⇒ Object
readonly
Returns the value of attribute query_body_string.
Instance Method Summary collapse
- #basic_auth ⇒ Object
- #date_header ⇒ Object
-
#initialize(client, method, path, query_body_string) ⇒ HeaderSignature
constructor
A new instance of HeaderSignature.
Methods included from Digesting
Methods included from Util
#error_with_message, #stringify_hash
Constructor Details
#initialize(client, method, path, query_body_string) ⇒ HeaderSignature
Returns a new instance of HeaderSignature.
12 13 14 15 16 17 |
# File 'lib/duo-api/header_signature.rb', line 12 def initialize(client, method, path, query_body_string) @client = client @method = method @path = path @query_body_string = query_body_string end |
Instance Attribute Details
#client ⇒ Object (readonly)
Returns the value of attribute client.
7 8 9 |
# File 'lib/duo-api/header_signature.rb', line 7 def client @client end |
#method ⇒ Object (readonly)
Returns the value of attribute method.
8 9 10 |
# File 'lib/duo-api/header_signature.rb', line 8 def method @method end |
#path ⇒ Object (readonly)
Returns the value of attribute path.
9 10 11 |
# File 'lib/duo-api/header_signature.rb', line 9 def path @path end |
#query_body_string ⇒ Object (readonly)
Returns the value of attribute query_body_string.
10 11 12 |
# File 'lib/duo-api/header_signature.rb', line 10 def query_body_string @query_body_string end |
Instance Method Details
#basic_auth ⇒ Object
19 20 21 22 23 24 |
# File 'lib/duo-api/header_signature.rb', line 19 def basic_auth username = client.integration_key password = digest(client.secret_key, body) [username, password] end |
#date_header ⇒ Object
26 27 28 |
# File 'lib/duo-api/header_signature.rb', line 26 def date_header @date_header ||= Time.now.utc.rfc2822 end |