cxf 0.0.6 → 0.0.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/client.rb +2 -20
- data/lib/cxf/helpers/proxy_controllers_methods.rb +2 -3
- data/lib/pub/content/content_prints.rb +5 -5
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 87b5b469db91be135d0c9d51f542cd8ac55018185fdb483494d7e890c9eb7b02
|
4
|
+
data.tar.gz: 33c7250ad7a53edf5f3c5edbbf190b10ccfdeb557c7bbfd55c977b6955bd9964
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5d1ad4b14251ffdd1d79cad7039811f0c9c21b20a6b9f15717665367dfc6faee96839134866e29f473d4dbddcfb00c74978d57efce0254f11360a1db1d669dbd
|
7
|
+
data.tar.gz: d8d9e887757172158c488625366459fb54f62960f6069883a08bf8010f7f07ac75d6652f51e471b2662c6bfb2b2da3dedd33b2f1304c5ade9f9cadb9d1cef5ab
|
data/lib/client.rb
CHANGED
@@ -444,26 +444,8 @@ module Cxf
|
|
444
444
|
def replace_tokens(response)
|
445
445
|
return unless response&.headers
|
446
446
|
|
447
|
-
|
448
|
-
|
449
|
-
parsed_cookie = parse_set_cookie(response.headers['Set-Cookie'])
|
450
|
-
return unless parsed_cookie['Access-Token'] || parsed_cookie['Refresh-Token']
|
451
|
-
|
452
|
-
@session_token = parsed_cookie['Access-Token'] if parsed_cookie['Access-Token']
|
453
|
-
@refresh_token = parsed_cookie['Refresh-Token'] if parsed_cookie['Refresh-Token']
|
454
|
-
end
|
455
|
-
|
456
|
-
def parse_set_cookie(set_cookie)
|
457
|
-
set_cookie = set_cookie.split(', ')
|
458
|
-
cookies_hash = {}
|
459
|
-
|
460
|
-
set_cookie.each do |cookie|
|
461
|
-
key, value = cookie.split('=')
|
462
|
-
value = value.split(';')[0]
|
463
|
-
cookies_hash[key] = value
|
464
|
-
end
|
465
|
-
|
466
|
-
cookies_hash
|
447
|
+
@session_token = response.headers['Access-Token'] if response.headers.key?('Access-Token')
|
448
|
+
@refresh_token = response.headers['Refresh-Token'] if response.headers.key?('Refresh-Token')
|
467
449
|
end
|
468
450
|
end
|
469
451
|
end
|
@@ -124,9 +124,8 @@ module ProxyControllersMethods
|
|
124
124
|
# set Cookies from response headers
|
125
125
|
if %w[contact user].include? controller_type
|
126
126
|
config.on_response do |_status_code, response|
|
127
|
-
|
128
|
-
cookies["cxf_#{controller_type}
|
129
|
-
cookies["cxf_#{controller_type}_refresh_token"] = { value: parsed_cookie['Refresh-Token'], secure: true, httponly: true } if parsed_cookie['Refresh-Token']
|
127
|
+
cookies["cxf_#{controller_type}_session_token"] = { value: response.header['Access-Token'], secure: true, httponly: true } if response.header['Access-Token']
|
128
|
+
cookies["cxf_#{controller_type}_refresh_token"] = { value: response.header['Refresh-Token'], secure: true, httponly: true } if response.header['Refresh-Token']
|
130
129
|
end
|
131
130
|
end
|
132
131
|
|
@@ -22,7 +22,7 @@ module ContentPrints
|
|
22
22
|
# }
|
23
23
|
# @data = @cxf_user.get_content_prints(options, true)
|
24
24
|
def get_content_prints(options = nil, use_post = true)
|
25
|
-
get_query_results('/content/
|
25
|
+
get_query_results('/content/prints', options, use_post)
|
26
26
|
end
|
27
27
|
|
28
28
|
# === Get content print.
|
@@ -41,7 +41,7 @@ module ContentPrints
|
|
41
41
|
# }
|
42
42
|
# @data = @cxf_user.get_content_print(1, options)
|
43
43
|
def get_content_print(id, options = nil)
|
44
|
-
@client.raw('get', "/content/
|
44
|
+
@client.raw('get', "/content/prints/#{id}", options, nil)
|
45
45
|
end
|
46
46
|
|
47
47
|
# === Create content print.
|
@@ -61,7 +61,7 @@ module ContentPrints
|
|
61
61
|
#
|
62
62
|
# @data = @cxf_user.create_content_print(data, options)
|
63
63
|
def create_content_print(data, options = nil)
|
64
|
-
@client.raw('post', '/content/
|
64
|
+
@client.raw('post', '/content/prints', options, data_transform(data))
|
65
65
|
end
|
66
66
|
|
67
67
|
# === Update content print.
|
@@ -78,7 +78,7 @@ module ContentPrints
|
|
78
78
|
# }
|
79
79
|
# @data = @cxf_user.update_content_print(5, data)
|
80
80
|
def update_content_print(id, data, options = nil)
|
81
|
-
@client.raw('put', "/content/
|
81
|
+
@client.raw('put', "/content/prints/#{id}", options, data_transform(data))
|
82
82
|
end
|
83
83
|
|
84
84
|
# === Delete content print.
|
@@ -90,6 +90,6 @@ module ContentPrints
|
|
90
90
|
# ==== Example
|
91
91
|
# @data = @cxf_user.delete_content_print(6)
|
92
92
|
def delete_content_print(id)
|
93
|
-
@client.raw('delete', "/content/
|
93
|
+
@client.raw('delete', "/content/prints/#{id}", nil, nil)
|
94
94
|
end
|
95
95
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: cxf
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.8
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
|
-
- Ruben Gomez Garcia, Omar Mora, Luis
|
7
|
+
- Ruben Gomez Garcia, Omar Mora, Luis Hesiquio
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2025-02-13 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: addressable
|