passageidentity 0.0.7 → 0.1.1
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/.github/workflows/on_pr.yml +3 -1
- data/README.md +6 -4
- data/lib/passageidentity/client.rb +14 -5
- data/lib/passageidentity/user_api.rb +20 -1
- data/passageidentity.gemspec +1 -1
- data/tests/user_api_test.rb +5 -0
- 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: 3b98a47138ae131d490133febfdfb84b901e3c204dab4dc77a89b58e7dddc2cb
|
|
4
|
+
data.tar.gz: a8727e11cfedcbc82b36bfc4c2983ec48d7f0932edb8235325727482a32f7190
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 23e4ca4713b66cc334b2fe31a24e0d7b010eea080afbfb783ea4aeee5e62e74c309a422fb35ec95ed6f532c93dc596d1472c77cf599f4d26d763df80090ba29d
|
|
7
|
+
data.tar.gz: bb1e666a5a6baf4ffabfdfd9165e7a679f8174ad312fd6e050b9367b1538ce9b5d4359b56df930ad181865af7198c23d15a6fb76423eade0ec0169d95ce96227
|
data/.github/workflows/on_pr.yml
CHANGED
data/README.md
CHANGED
|
@@ -74,8 +74,7 @@ The information available in the Passage App struct returned by PassageClient.ge
|
|
|
74
74
|
:login_url,
|
|
75
75
|
:rsa_public_key,
|
|
76
76
|
:allowed_identifer,
|
|
77
|
-
:
|
|
78
|
-
:require_email_verification,
|
|
77
|
+
:require_identifier_verification,
|
|
79
78
|
:session_timeout_length,
|
|
80
79
|
:user_metadata_schema,
|
|
81
80
|
:layouts,
|
|
@@ -111,6 +110,7 @@ The information available in the Passage User struct returned by PassageClient.u
|
|
|
111
110
|
:email,
|
|
112
111
|
:phone,
|
|
113
112
|
:email_verified,
|
|
113
|
+
:phone_verified,
|
|
114
114
|
:created_at,
|
|
115
115
|
:updated_at,
|
|
116
116
|
:last_login_at,
|
|
@@ -184,7 +184,9 @@ The information available in the array of Passage Device struct returned by Pass
|
|
|
184
184
|
:cred_id,
|
|
185
185
|
:friendly_name,
|
|
186
186
|
:usage_count,
|
|
187
|
-
:
|
|
187
|
+
:updated_at,
|
|
188
|
+
:created_at,
|
|
189
|
+
:last_login_at,
|
|
188
190
|
|
|
189
191
|
```
|
|
190
192
|
|
|
@@ -205,7 +207,7 @@ end
|
|
|
205
207
|
|
|
206
208
|
## Create an Embeddable Magic Link
|
|
207
209
|
|
|
208
|
-
To create a magic link, you should use the `create_magic_link` method. You can check out our guide on embeddable magic links in our [docs](https://docs.passage.id/
|
|
210
|
+
To create a magic link, you should use the `create_magic_link` method. You can check out our guide on embeddable magic links in our [docs](https://docs.passage.id/guides/embedded-links).
|
|
209
211
|
|
|
210
212
|
```ruby
|
|
211
213
|
require 'passageidentity'
|
|
@@ -13,9 +13,11 @@ module Passage
|
|
|
13
13
|
:login_url,
|
|
14
14
|
:rsa_public_key,
|
|
15
15
|
:allowed_identifer,
|
|
16
|
-
:
|
|
17
|
-
:require_email_verification,
|
|
16
|
+
:require_identifier_verification,
|
|
18
17
|
:session_timeout_length,
|
|
18
|
+
:refresh_enabled,
|
|
19
|
+
:refresh_absolute_lifetime,
|
|
20
|
+
:refresh_inactivity_lifetime,
|
|
19
21
|
:user_metadata_schema,
|
|
20
22
|
:layouts,
|
|
21
23
|
keyword_init: true
|
|
@@ -25,6 +27,7 @@ module Passage
|
|
|
25
27
|
:email,
|
|
26
28
|
:phone,
|
|
27
29
|
:email_verified,
|
|
30
|
+
:phone_verified,
|
|
28
31
|
:created_at,
|
|
29
32
|
:updated_at,
|
|
30
33
|
:last_login_at,
|
|
@@ -51,7 +54,9 @@ module Passage
|
|
|
51
54
|
:cred_id,
|
|
52
55
|
:friendly_name,
|
|
53
56
|
:usage_count,
|
|
54
|
-
:
|
|
57
|
+
:updated_at,
|
|
58
|
+
:created_at,
|
|
59
|
+
:last_login_at,
|
|
55
60
|
keyword_init: true
|
|
56
61
|
|
|
57
62
|
COOKIE_STRATEGY = 0
|
|
@@ -124,9 +129,13 @@ module Passage
|
|
|
124
129
|
login_url: app_info["login_url"],
|
|
125
130
|
rsa_public_key: app_info["rsa_public_key"],
|
|
126
131
|
allowed_identifer: app_info["allowed_identifer"],
|
|
127
|
-
|
|
128
|
-
|
|
132
|
+
require_identifier_verification:
|
|
133
|
+
app_info["require_identifier_verification"],
|
|
129
134
|
session_timeout_length: app_info["session_timeout_length"],
|
|
135
|
+
refresh_enabled: app_info["refresh_enabled"],
|
|
136
|
+
refresh_absolute_lifetime: app_info["refresh_absolute_lifetime"],
|
|
137
|
+
refresh_inactivity_lifetime:
|
|
138
|
+
app_info["refresh_inactivity_lifetime"],
|
|
130
139
|
user_metadata_schema: app_info["user_metadata_schema"],
|
|
131
140
|
layouts: app_info["layouts"]
|
|
132
141
|
)
|
|
@@ -22,6 +22,7 @@ module Passage
|
|
|
22
22
|
email: user["email"],
|
|
23
23
|
phone: user["phone"],
|
|
24
24
|
email_verified: user["email_verified"],
|
|
25
|
+
phone_verified: user["phone_verified"],
|
|
25
26
|
created_at: user["created_at"],
|
|
26
27
|
updated_at: user["updated_at"],
|
|
27
28
|
last_login_at: user["last_login_at"],
|
|
@@ -56,6 +57,7 @@ module Passage
|
|
|
56
57
|
email: user["email"],
|
|
57
58
|
phone: user["phone"],
|
|
58
59
|
email_verified: user["email_verified"],
|
|
60
|
+
phone_verified: user["phone_verified"],
|
|
59
61
|
created_at: user["created_at"],
|
|
60
62
|
updated_at: user["updated_at"],
|
|
61
63
|
last_login_at: user["last_login_at"],
|
|
@@ -90,6 +92,7 @@ module Passage
|
|
|
90
92
|
email: user["email"],
|
|
91
93
|
phone: user["phone"],
|
|
92
94
|
email_verified: user["email_verified"],
|
|
95
|
+
phone_verified: user["phone_verified"],
|
|
93
96
|
created_at: user["created_at"],
|
|
94
97
|
updated_at: user["updated_at"],
|
|
95
98
|
last_login_at: user["last_login_at"],
|
|
@@ -128,6 +131,7 @@ module Passage
|
|
|
128
131
|
email: user["email"],
|
|
129
132
|
phone: user["phone"],
|
|
130
133
|
email_verified: user["email_verified"],
|
|
134
|
+
phone_verified: user["phone_verified"],
|
|
131
135
|
created_at: user["created_at"],
|
|
132
136
|
updated_at: user["updated_at"],
|
|
133
137
|
last_login_at: user["last_login_at"],
|
|
@@ -164,6 +168,7 @@ module Passage
|
|
|
164
168
|
email: user["email"],
|
|
165
169
|
phone: user["phone"],
|
|
166
170
|
email_verified: user["email_verified"],
|
|
171
|
+
phone_verified: user["phone_verified"],
|
|
167
172
|
created_at: user["created_at"],
|
|
168
173
|
updated_at: user["updated_at"],
|
|
169
174
|
last_login_at: user["last_login_at"],
|
|
@@ -227,7 +232,9 @@ module Passage
|
|
|
227
232
|
cred_id: device["cred_id"],
|
|
228
233
|
friendly_name: device["friendly_name"],
|
|
229
234
|
usage_count: device["usage_count"],
|
|
230
|
-
|
|
235
|
+
updated_at: device["updated_at"],
|
|
236
|
+
created_at: device["created_at"],
|
|
237
|
+
last_login_at: device["last_login_at"]
|
|
231
238
|
)
|
|
232
239
|
)
|
|
233
240
|
end
|
|
@@ -237,5 +244,17 @@ module Passage
|
|
|
237
244
|
"failed to delete Passage User Device. Http Status: #{e.response[:status]}. Response: #{e.response[:body]["error"]}"
|
|
238
245
|
end
|
|
239
246
|
end
|
|
247
|
+
|
|
248
|
+
def signout(user_id:)
|
|
249
|
+
raise PassageError, "must supply a valid user_id" if user_id.to_s.empty?
|
|
250
|
+
begin
|
|
251
|
+
response =
|
|
252
|
+
@connection.delete("/v1/apps/#{@app_id}/users/#{user_id}/tokens/")
|
|
253
|
+
return true
|
|
254
|
+
rescue Faraday::Error => e
|
|
255
|
+
raise PassageError,
|
|
256
|
+
"failed to revoke user's refresh tokens. Http Status: #{e.response[:status]}. Response: #{e.response[:body]["error"]}"
|
|
257
|
+
end
|
|
258
|
+
end
|
|
240
259
|
end
|
|
241
260
|
end
|
data/passageidentity.gemspec
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Gem::Specification.new do |s|
|
|
2
2
|
s.name = 'passageidentity'
|
|
3
|
-
s.version = '0.
|
|
3
|
+
s.version = '0.1.1'
|
|
4
4
|
s.summary = 'Passage SDK for biometric authentication'
|
|
5
5
|
s.description =
|
|
6
6
|
'Enables verification of server-side authentication and user management for applications using Passage'
|
data/tests/user_api_test.rb
CHANGED
|
@@ -69,6 +69,11 @@ class TestUserAPI < Test::Unit::TestCase
|
|
|
69
69
|
assert_equal [], devices
|
|
70
70
|
end
|
|
71
71
|
|
|
72
|
+
def test_signout()
|
|
73
|
+
success = PassageClient.user.signout(user_id: $global_test_user.id)
|
|
74
|
+
assert_equal true, success
|
|
75
|
+
end
|
|
76
|
+
|
|
72
77
|
def teardown()
|
|
73
78
|
deleted = PassageClient.user.delete(user_id: $global_test_user.id)
|
|
74
79
|
end
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: passageidentity
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.
|
|
4
|
+
version: 0.1.1
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Passage Identity
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2022-
|
|
11
|
+
date: 2022-09-02 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: faraday
|