Class: ApiSignature::AuthHeader
- Inherits:
-
Object
- Object
- ApiSignature::AuthHeader
- Defined in:
- lib/api_signature/auth_header.rb
Constant Summary collapse
- TOKEN_REGEX =
/^(API-HMAC-SHA256)\s+/.freeze
- AUTHN_PAIR_DELIMITERS =
/(?:,|\t+)/.freeze
Instance Attribute Summary collapse
-
#authorization ⇒ Object
readonly
Returns the value of attribute authorization.
Instance Method Summary collapse
- #credential ⇒ Object
-
#initialize(authorization) ⇒ AuthHeader
constructor
A new instance of AuthHeader.
- #options ⇒ Object
- #signature ⇒ Object
- #signed_headers ⇒ Object
Constructor Details
#initialize(authorization) ⇒ AuthHeader
Returns a new instance of AuthHeader.
10 11 12 |
# File 'lib/api_signature/auth_header.rb', line 10 def initialize() @authorization = .to_s end |
Instance Attribute Details
#authorization ⇒ Object (readonly)
Returns the value of attribute authorization.
5 6 7 |
# File 'lib/api_signature/auth_header.rb', line 5 def @authorization end |
Instance Method Details
#credential ⇒ Object
14 15 16 |
# File 'lib/api_signature/auth_header.rb', line 14 def credential data[0] end |
#options ⇒ Object
28 29 30 |
# File 'lib/api_signature/auth_header.rb', line 28 def @options ||= (data[1] || {}) end |
#signature ⇒ Object
18 19 20 |
# File 'lib/api_signature/auth_header.rb', line 18 def signature ['Signature'] end |
#signed_headers ⇒ Object
22 23 24 25 26 |
# File 'lib/api_signature/auth_header.rb', line 22 def signed_headers return [] unless ['SignedHeaders'] @signed_headers ||= ['SignedHeaders'].split(/;\s?/).map(&:strip) end |