killbill-aviate 1.1.0.pre.2 → 1.1.0.pre.4
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/app/controllers/aviate/configuration_controller.rb +9 -1
- data/lib/aviate/client.rb +19 -34
- data/lib/aviate/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 2637a800931a97b96e7627862ec03523466f2783aa47dc3802baaa3adf41d0c6
|
|
4
|
+
data.tar.gz: 74c7af1583e51fa00d1ac2c6f3dd2f47aafa1f69ee215d61a57ee54e84ef1b24
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: f0d80352daf4ea71f30584f8ce56a7386bd49bf3150c7214e8b61ecfbbbb5f5d4fc9d47e5482d63e18271c1fbb74b16737ef2f3601668845dfd365b10c68cb29
|
|
7
|
+
data.tar.gz: 7426986c49bce980ebbbf53974a19c2d650577b675b873e4fac0dc612b22c15f865c6695302dccdc307a7367b1019f33f3533e8f5f5483b1b743863b8444b298
|
|
@@ -12,7 +12,15 @@ module Aviate
|
|
|
12
12
|
email = params[:aviate_email]
|
|
13
13
|
password = params[:aviate_password]
|
|
14
14
|
response = Killbill::Aviate::AviateClient.authenticate(email, password, cached_options_for_klient)
|
|
15
|
-
|
|
15
|
+
if response['token']
|
|
16
|
+
cookies.encrypted[:jwt_token] = {
|
|
17
|
+
value: response['token'],
|
|
18
|
+
httponly: true,
|
|
19
|
+
secure: Rails.env.production?,
|
|
20
|
+
same_site: :strict,
|
|
21
|
+
expires: 1.hour.from_now
|
|
22
|
+
}
|
|
23
|
+
end
|
|
16
24
|
redirect_to aviate_root_path
|
|
17
25
|
end
|
|
18
26
|
end
|
data/lib/aviate/client.rb
CHANGED
|
@@ -9,16 +9,7 @@ module Killbill
|
|
|
9
9
|
def aviate_plugin_available?(options = nil)
|
|
10
10
|
path = "#{KILLBILL_AVIATE_PREFIX}/health/data"
|
|
11
11
|
|
|
12
|
-
|
|
13
|
-
request_options = {
|
|
14
|
-
api_key: options[:api_key],
|
|
15
|
-
api_secret: options[:api_secret]
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
# Add Authorization header if JWT token is present
|
|
19
|
-
if options[:jwt_token].present?
|
|
20
|
-
request_options[:head] = { 'Authorization' => "Bearer #{options[:jwt_token]}" }
|
|
21
|
-
end
|
|
12
|
+
request_options = build_request_options(options)
|
|
22
13
|
|
|
23
14
|
KillBillClient::API.get path, {}, request_options
|
|
24
15
|
|
|
@@ -41,14 +32,7 @@ module Killbill
|
|
|
41
32
|
def retrieve_wallets(account_id, options = nil)
|
|
42
33
|
path = "#{KILLBILL_AVIATE_PREFIX}/wallet/#{account_id}"
|
|
43
34
|
|
|
44
|
-
request_options =
|
|
45
|
-
api_key: options[:api_key],
|
|
46
|
-
api_secret: options[:api_secret]
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
if options[:jwt_token].present?
|
|
50
|
-
request_options[:head] = { 'Authorization' => "Bearer #{options[:jwt_token]}" }
|
|
51
|
-
end
|
|
35
|
+
request_options = build_request_options(options)
|
|
52
36
|
|
|
53
37
|
response = KillBillClient::API.get path, {}, request_options
|
|
54
38
|
JSON.parse(response.body)
|
|
@@ -64,14 +48,7 @@ module Killbill
|
|
|
64
48
|
expDurationLength: wallet_params[:exp_duration_length]
|
|
65
49
|
}
|
|
66
50
|
|
|
67
|
-
request_options =
|
|
68
|
-
api_key: options[:api_key],
|
|
69
|
-
api_secret: options[:api_secret]
|
|
70
|
-
}
|
|
71
|
-
|
|
72
|
-
if options[:jwt_token].present?
|
|
73
|
-
request_options[:head] = { 'Authorization' => "Bearer #{options[:jwt_token]}" }
|
|
74
|
-
end
|
|
51
|
+
request_options = build_request_options(options)
|
|
75
52
|
|
|
76
53
|
response = KillBillClient::API.put path, body.to_json, {}, request_options
|
|
77
54
|
response.code
|
|
@@ -96,14 +73,7 @@ module Killbill
|
|
|
96
73
|
}
|
|
97
74
|
}
|
|
98
75
|
|
|
99
|
-
request_options =
|
|
100
|
-
api_key: options[:api_key],
|
|
101
|
-
api_secret: options[:api_secret]
|
|
102
|
-
}
|
|
103
|
-
|
|
104
|
-
if options[:jwt_token].present?
|
|
105
|
-
request_options[:head] = { 'Authorization' => "Bearer #{options[:jwt_token]}" }
|
|
106
|
-
end
|
|
76
|
+
request_options = build_request_options(options)
|
|
107
77
|
|
|
108
78
|
response = KillBillClient::API.post path, body.to_json, {}, request_options
|
|
109
79
|
JSON.parse(response.body)
|
|
@@ -131,6 +101,21 @@ module Killbill
|
|
|
131
101
|
rescue StandardError => e
|
|
132
102
|
e.message.to_s
|
|
133
103
|
end
|
|
104
|
+
|
|
105
|
+
private
|
|
106
|
+
|
|
107
|
+
def build_request_options(options)
|
|
108
|
+
request_options = {
|
|
109
|
+
api_key: options[:api_key],
|
|
110
|
+
api_secret: options[:api_secret]
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
if options[:jwt_token].present?
|
|
114
|
+
request_options[:head] = { 'Authorization' => "Bearer #{options[:jwt_token]}" }
|
|
115
|
+
end
|
|
116
|
+
|
|
117
|
+
request_options
|
|
118
|
+
end
|
|
134
119
|
end
|
|
135
120
|
end
|
|
136
121
|
end
|
data/lib/aviate/version.rb
CHANGED
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: killbill-aviate
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 1.1.0.pre.
|
|
4
|
+
version: 1.1.0.pre.4
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Kill Bill core team
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2025-10-
|
|
11
|
+
date: 2025-10-15 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: killbill-assets-ui
|