Class: ApiAuth::RequestDrivers::CurbRequest
- Inherits:
-
Object
- Object
- ApiAuth::RequestDrivers::CurbRequest
show all
- Includes:
- Helpers
- Defined in:
- lib/api_auth/request_drivers/curb.rb
Overview
Instance Method Summary
collapse
Methods included from Helpers
#b64_encode, #capitalize_keys, #sha256_base64digest
Constructor Details
#initialize(request) ⇒ CurbRequest
Returns a new instance of CurbRequest.
6
7
8
9
10
|
# File 'lib/api_auth/request_drivers/curb.rb', line 6
def initialize(request)
@request = request
true
end
|
Instance Method Details
59
60
61
|
# File 'lib/api_auth/request_drivers/curb.rb', line 59
def
%w[Authorization AUTHORIZATION HTTP_AUTHORIZATION]
end
|
#content_hash ⇒ Object
38
39
40
|
# File 'lib/api_auth/request_drivers/curb.rb', line 38
def content_hash
(%w[X-AUTHORIZATION-CONTENT-SHA256])
end
|
#content_hash_mismatch? ⇒ Boolean
22
23
24
|
# File 'lib/api_auth/request_drivers/curb.rb', line 22
def content_hash_mismatch?
false
end
|
#content_type ⇒ Object
34
35
36
|
# File 'lib/api_auth/request_drivers/curb.rb', line 34
def content_type
(%w[CONTENT-TYPE CONTENT_TYPE HTTP_CONTENT_TYPE])
end
|
26
27
28
|
# File 'lib/api_auth/request_drivers/curb.rb', line 26
def
@headers = capitalize_keys @request.
end
|
#http_method ⇒ Object
30
31
32
|
# File 'lib/api_auth/request_drivers/curb.rb', line 30
def http_method
nil end
|
#original_uri ⇒ Object
42
43
44
|
# File 'lib/api_auth/request_drivers/curb.rb', line 42
def original_uri
(%w[X-ORIGINAL-URI X_ORIGINAL_URI HTTP_X_ORIGINAL_URI])
end
|
#populate_content_hash ⇒ Object
18
19
20
|
# File 'lib/api_auth/request_drivers/curb.rb', line 18
def populate_content_hash
nil end
|
#request_uri ⇒ Object
46
47
48
|
# File 'lib/api_auth/request_drivers/curb.rb', line 46
def request_uri
@request.url
end
|
12
13
14
15
16
|
# File 'lib/api_auth/request_drivers/curb.rb', line 12
def ()
@request.['Authorization'] =
@request
end
|
#set_date ⇒ Object
50
51
52
53
|
# File 'lib/api_auth/request_drivers/curb.rb', line 50
def set_date
@request.['DATE'] = Time.now.utc.httpdate
end
|
#timestamp ⇒ Object
55
56
57
|
# File 'lib/api_auth/request_drivers/curb.rb', line 55
def timestamp
(%w[DATE HTTP_DATE])
end
|