volcano-sdk 0.7.1 → 0.7.2
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/README.md +2 -0
- data/lib/volcano/auth_anonymous.rb +6 -8
- data/lib/volcano/auth_email_change.rb +4 -5
- data/lib/volcano/auth_get_user.rb +10 -5
- data/lib/volcano/auth_update_user.rb +5 -8
- data/lib/volcano/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: b992adf24aad6b7edea16323e1f9b21c8db08cefe1380cffaf12c99ed436baf4
|
|
4
|
+
data.tar.gz: 3770340779a1a5cf0b985b6290a185223632f85863e56ab33c4f8f443ce02f0e
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 8bd2583130b36e6ede81cdb096cfe97cff10aa9aebe8fb086cff5dd1d13c8883f6bc196b9d528c4e437fb7533df568aab7fce759d0a79f134983b825b730f9d7
|
|
7
|
+
data.tar.gz: d5118276bfe5a10d157e637643827a07586cba53d632b5f966501f3ffa9bf5562c1d1a682d8286026f0109f77b19cf701cd3a536d0fc419badf7e34e8d9f3a89
|
data/README.md
CHANGED
|
@@ -13,14 +13,12 @@ module Volcano
|
|
|
13
13
|
end
|
|
14
14
|
|
|
15
15
|
def convert_anonymous(email:, password:, metadata: {})
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
anonymous_conversion_response(
|
|
21
|
-
|
|
22
|
-
)
|
|
23
|
-
cache_current_user(payload, generation)
|
|
16
|
+
profile_request do
|
|
17
|
+
request_email = email.dup.freeze
|
|
18
|
+
request_password = password.dup.freeze
|
|
19
|
+
request_metadata = JSON.parse(JSON.generate(Hash(metadata)), freeze: true)
|
|
20
|
+
->(token) { anonymous_conversion_response(token, request_email, request_password, request_metadata) }
|
|
21
|
+
end
|
|
24
22
|
end
|
|
25
23
|
|
|
26
24
|
private
|
|
@@ -26,11 +26,10 @@ module Volcano
|
|
|
26
26
|
end
|
|
27
27
|
|
|
28
28
|
def confirm_email_change(token:)
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
cache_current_user(payload, generation)
|
|
29
|
+
profile_request do
|
|
30
|
+
request_token = token.dup.freeze
|
|
31
|
+
->(access_token) { confirm_email_change_response(access_token, request_token) }
|
|
32
|
+
end
|
|
34
33
|
end
|
|
35
34
|
|
|
36
35
|
private
|
|
@@ -15,17 +15,22 @@ module Volcano
|
|
|
15
15
|
:USER_OPTIONAL_VALUES, :USER_STATUSES, :USER_TIMESTAMPS
|
|
16
16
|
|
|
17
17
|
def user
|
|
18
|
-
|
|
19
|
-
raise Error::AuthenticationError, 'No active session' unless current
|
|
20
|
-
|
|
21
|
-
payload = Transport.body(get_user_response(current.access_token), 200)
|
|
22
|
-
cache_current_user(payload, generation)
|
|
18
|
+
profile_request { method(:get_user_response) }
|
|
23
19
|
end
|
|
24
20
|
|
|
25
21
|
alias get_user user
|
|
26
22
|
|
|
27
23
|
private
|
|
28
24
|
|
|
25
|
+
def profile_request
|
|
26
|
+
binding = @client.capture_session_binding
|
|
27
|
+
raise Error::AuthenticationError, 'No active session' unless binding.last
|
|
28
|
+
|
|
29
|
+
request = yield
|
|
30
|
+
payload = Transport.body(session_request(binding: binding, &request), 200)
|
|
31
|
+
cache_current_user(payload, owned_session_binding(binding).first)
|
|
32
|
+
end
|
|
33
|
+
|
|
29
34
|
def cache_current_user(payload, generation)
|
|
30
35
|
profile = user_payload(payload)
|
|
31
36
|
user = build_user(profile)
|
|
@@ -4,14 +4,11 @@ module Volcano
|
|
|
4
4
|
# Current-user update behavior for the authentication facade.
|
|
5
5
|
class Auth
|
|
6
6
|
def update_user(password: nil, metadata: nil)
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
200
|
|
13
|
-
)
|
|
14
|
-
cache_current_user(payload, generation)
|
|
7
|
+
profile_request do
|
|
8
|
+
request_password = password&.dup&.freeze
|
|
9
|
+
request_metadata = metadata.nil? ? nil : JSON.parse(JSON.generate(Hash(metadata)), freeze: true)
|
|
10
|
+
->(token) { update_user_response(token, password: request_password, metadata: request_metadata) }
|
|
11
|
+
end
|
|
15
12
|
end
|
|
16
13
|
|
|
17
14
|
private
|
data/lib/volcano/version.rb
CHANGED