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, #md5_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
58
59
60
|
# File 'lib/api_auth/request_drivers/curb.rb', line 58
def
%w(Authorization AUTHORIZATION HTTP_AUTHORIZATION)
end
|
#content_md5 ⇒ Object
39
40
41
42
|
# File 'lib/api_auth/request_drivers/curb.rb', line 39
def content_md5
value = (%w(CONTENT-MD5 CONTENT_MD5))
value.nil? ? '' : value
end
|
#content_type ⇒ Object
34
35
36
37
|
# File 'lib/api_auth/request_drivers/curb.rb', line 34
def content_type
value = (%w(CONTENT-TYPE CONTENT_TYPE HTTP_CONTENT_TYPE))
value.nil? ? '' : value
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
|
#md5_mismatch? ⇒ Boolean
22
23
24
|
# File 'lib/api_auth/request_drivers/curb.rb', line 22
def md5_mismatch?
false
end
|
#populate_content_md5 ⇒ Object
18
19
20
|
# File 'lib/api_auth/request_drivers/curb.rb', line 18
def populate_content_md5
nil end
|
#request_uri ⇒ Object
44
45
46
|
# File 'lib/api_auth/request_drivers/curb.rb', line 44
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
48
49
50
51
|
# File 'lib/api_auth/request_drivers/curb.rb', line 48
def set_date
@request.['DATE'] = Time.now.utc.httpdate
end
|
#timestamp ⇒ Object
53
54
55
56
|
# File 'lib/api_auth/request_drivers/curb.rb', line 53
def timestamp
value = (%w(DATE HTTP_DATE))
value.nil? ? '' : value
end
|