passageidentity 0.4.0 → 0.6.0
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/CHANGELOG.md +20 -0
- data/README.md +21 -0
- data/docs/generated/{GithubSocialConnection.md → AppleUserSocialConnection.md} +2 -2
- data/docs/generated/{GoogleSocialConnection.md → GithubUserSocialConnection.md} +2 -2
- data/docs/generated/GoogleUserSocialConnection.md +24 -0
- data/docs/generated/Link.md +18 -0
- data/docs/generated/ListPaginatedUsersItem.md +38 -0
- data/docs/generated/ListPaginatedUsersResponse.md +28 -0
- data/docs/generated/Model403Error.md +20 -0
- data/docs/generated/Nonce.md +18 -0
- data/docs/generated/PaginatedLinks.md +26 -0
- data/docs/generated/README.md +12 -6
- data/docs/generated/UserEventStatus.md +15 -0
- data/docs/generated/UserInfo.md +1 -1
- data/docs/generated/{UserEventInfo.md → UserRecentEvent.md} +6 -2
- data/docs/generated/UserSocialConnections.md +6 -4
- data/docs/generated/UsersApi.md +94 -0
- data/lib/openapi_client/api/users_api.rb +96 -0
- data/lib/openapi_client/models/{github_social_connection.rb → apple_user_social_connection.rb} +3 -3
- data/lib/openapi_client/models/{google_social_connection.rb → github_user_social_connection.rb} +3 -3
- data/lib/openapi_client/models/google_user_social_connection.rb +271 -0
- data/lib/openapi_client/models/link.rb +221 -0
- data/lib/openapi_client/models/list_paginated_users_item.rb +399 -0
- data/lib/openapi_client/models/list_paginated_users_response.rb +305 -0
- data/lib/openapi_client/models/magic_link_auth_method.rb +0 -7
- data/lib/openapi_client/models/model401_error.rb +2 -2
- data/lib/openapi_client/models/model403_error.rb +271 -0
- data/lib/openapi_client/models/nonce.rb +222 -0
- data/lib/openapi_client/models/otp_auth_method.rb +3 -10
- data/lib/openapi_client/models/paginated_links.rb +285 -0
- data/lib/openapi_client/models/passkeys_auth_method.rb +0 -7
- data/lib/openapi_client/models/ttl_display_unit.rb +1 -1
- data/lib/openapi_client/models/user_event_status.rb +40 -0
- data/lib/openapi_client/models/user_info.rb +1 -1
- data/lib/openapi_client/models/{user_event_info.rb → user_recent_event.rb} +54 -4
- data/lib/openapi_client/models/user_social_connections.rb +19 -10
- data/lib/openapi_client.rb +14 -6
- data/lib/passageidentity/user_api.rb +40 -0
- data/lib/passageidentity/version.rb +1 -1
- data/tests/user_api_test.rb +41 -0
- metadata +27 -14
- data/docs/generated/UpdateMagicLinkAuthMethod.md +0 -22
- data/docs/generated/UpdateOtpAuthMethod.md +0 -22
- data/docs/generated/UpdatePasskeysAuthMethod.md +0 -18
- /data/lib/{openapi_client/models → models}/update_magic_link_auth_method.rb +0 -0
- /data/lib/{openapi_client/models → models}/update_otp_auth_method.rb +0 -0
- /data/lib/{openapi_client/models → models}/update_passkeys_auth_method.rb +0 -0
data/tests/user_api_test.rb
CHANGED
@@ -37,6 +37,47 @@ class TestUserAPI < Test::Unit::TestCase
|
|
37
37
|
assert_equal $global_test_user.id, user.id
|
38
38
|
end
|
39
39
|
|
40
|
+
def test_get_user_by_identifier()
|
41
|
+
user = PassageClient.user.get(user_id: $global_test_user.id)
|
42
|
+
assert_equal $global_test_user.id, user.id
|
43
|
+
|
44
|
+
user_by_identifier = PassageClient.user.get_by_identifier(user_identifier: $global_test_user.email)
|
45
|
+
assert_equal $global_test_user.id, user_by_identifier.id
|
46
|
+
|
47
|
+
assert_equal user, user_by_identifier
|
48
|
+
end
|
49
|
+
|
50
|
+
def test_get_user_by_identifier_upper_case()
|
51
|
+
user = PassageClient.user.get(user_id: $global_test_user.id)
|
52
|
+
assert_equal $global_test_user.id, user.id
|
53
|
+
|
54
|
+
user_by_identifier = PassageClient.user.get_by_identifier(user_identifier: $global_test_user.email.upcase)
|
55
|
+
assert_equal $global_test_user.id, user_by_identifier.id
|
56
|
+
|
57
|
+
assert_equal user, user_by_identifier
|
58
|
+
end
|
59
|
+
|
60
|
+
def test_get_user_by_identifier_phone()
|
61
|
+
$phone = "+15005550007"
|
62
|
+
create_user = PassageClient.user.create(
|
63
|
+
phone: $phone,
|
64
|
+
)
|
65
|
+
user = PassageClient.user.get(user_id: create_user.id)
|
66
|
+
assert_equal create_user.id, user.id
|
67
|
+
|
68
|
+
user_by_identifier = PassageClient.user.get_by_identifier(user_identifier: $phone)
|
69
|
+
assert_equal create_user.id, user_by_identifier.id
|
70
|
+
|
71
|
+
assert_equal user, user_by_identifier
|
72
|
+
end
|
73
|
+
|
74
|
+
def test_invalid_get_user_by_identifier()
|
75
|
+
user = PassageClient.user.get(user_id: $global_test_user.id)
|
76
|
+
assert_equal $global_test_user.id, user.id
|
77
|
+
|
78
|
+
assert_raise (Passage::PassageError) {PassageClient.user.get_by_identifier(user_identifier: "error@passage.id")}
|
79
|
+
end
|
80
|
+
|
40
81
|
def test_deactivate_user()
|
41
82
|
user = PassageClient.user.deactivate(user_id: $global_test_user.id)
|
42
83
|
assert_equal $global_test_user.id, user.id
|
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.6.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Passage Identity
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2024-
|
11
|
+
date: 2024-03-26 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: faraday
|
@@ -90,17 +90,21 @@ files:
|
|
90
90
|
- docs/custom/UserApi.md
|
91
91
|
- docs/generated/AppInfo.md
|
92
92
|
- docs/generated/AppResponse.md
|
93
|
+
- docs/generated/AppleUserSocialConnection.md
|
93
94
|
- docs/generated/AppsApi.md
|
94
95
|
- docs/generated/AuthMethods.md
|
95
96
|
- docs/generated/CreateMagicLinkRequest.md
|
96
97
|
- docs/generated/CreateUserRequest.md
|
97
98
|
- docs/generated/ElementCustomization.md
|
98
99
|
- docs/generated/FontFamily.md
|
99
|
-
- docs/generated/
|
100
|
-
- docs/generated/
|
100
|
+
- docs/generated/GithubUserSocialConnection.md
|
101
|
+
- docs/generated/GoogleUserSocialConnection.md
|
101
102
|
- docs/generated/LayoutConfig.md
|
102
103
|
- docs/generated/Layouts.md
|
104
|
+
- docs/generated/Link.md
|
103
105
|
- docs/generated/ListDevicesResponse.md
|
106
|
+
- docs/generated/ListPaginatedUsersItem.md
|
107
|
+
- docs/generated/ListPaginatedUsersResponse.md
|
104
108
|
- docs/generated/MagicLink.md
|
105
109
|
- docs/generated/MagicLinkAuthMethod.md
|
106
110
|
- docs/generated/MagicLinkChannel.md
|
@@ -109,23 +113,24 @@ files:
|
|
109
113
|
- docs/generated/MagicLinksApi.md
|
110
114
|
- docs/generated/Model400Error.md
|
111
115
|
- docs/generated/Model401Error.md
|
116
|
+
- docs/generated/Model403Error.md
|
112
117
|
- docs/generated/Model404Error.md
|
113
118
|
- docs/generated/Model500Error.md
|
119
|
+
- docs/generated/Nonce.md
|
114
120
|
- docs/generated/OtpAuthMethod.md
|
121
|
+
- docs/generated/PaginatedLinks.md
|
115
122
|
- docs/generated/PasskeysAuthMethod.md
|
116
123
|
- docs/generated/README.md
|
117
124
|
- docs/generated/Technologies.md
|
118
125
|
- docs/generated/TokensApi.md
|
119
126
|
- docs/generated/TtlDisplayUnit.md
|
120
|
-
- docs/generated/UpdateMagicLinkAuthMethod.md
|
121
|
-
- docs/generated/UpdateOtpAuthMethod.md
|
122
|
-
- docs/generated/UpdatePasskeysAuthMethod.md
|
123
127
|
- docs/generated/UpdateUserRequest.md
|
124
128
|
- docs/generated/UserDevicesApi.md
|
125
|
-
- docs/generated/
|
129
|
+
- docs/generated/UserEventStatus.md
|
126
130
|
- docs/generated/UserInfo.md
|
127
131
|
- docs/generated/UserMetadataField.md
|
128
132
|
- docs/generated/UserMetadataFieldType.md
|
133
|
+
- docs/generated/UserRecentEvent.md
|
129
134
|
- docs/generated/UserResponse.md
|
130
135
|
- docs/generated/UserSocialConnections.md
|
131
136
|
- docs/generated/UserStatus.md
|
@@ -134,6 +139,9 @@ files:
|
|
134
139
|
- docs/generated/WebAuthnIcons.md
|
135
140
|
- docs/generated/WebAuthnType.md
|
136
141
|
- generate.sh
|
142
|
+
- lib/models/update_magic_link_auth_method.rb
|
143
|
+
- lib/models/update_otp_auth_method.rb
|
144
|
+
- lib/models/update_passkeys_auth_method.rb
|
137
145
|
- lib/openapi_client.rb
|
138
146
|
- lib/openapi_client/api/apps_api.rb
|
139
147
|
- lib/openapi_client/api/magic_links_api.rb
|
@@ -145,16 +153,20 @@ files:
|
|
145
153
|
- lib/openapi_client/configuration.rb
|
146
154
|
- lib/openapi_client/models/app_info.rb
|
147
155
|
- lib/openapi_client/models/app_response.rb
|
156
|
+
- lib/openapi_client/models/apple_user_social_connection.rb
|
148
157
|
- lib/openapi_client/models/auth_methods.rb
|
149
158
|
- lib/openapi_client/models/create_magic_link_request.rb
|
150
159
|
- lib/openapi_client/models/create_user_request.rb
|
151
160
|
- lib/openapi_client/models/element_customization.rb
|
152
161
|
- lib/openapi_client/models/font_family.rb
|
153
|
-
- lib/openapi_client/models/
|
154
|
-
- lib/openapi_client/models/
|
162
|
+
- lib/openapi_client/models/github_user_social_connection.rb
|
163
|
+
- lib/openapi_client/models/google_user_social_connection.rb
|
155
164
|
- lib/openapi_client/models/layout_config.rb
|
156
165
|
- lib/openapi_client/models/layouts.rb
|
166
|
+
- lib/openapi_client/models/link.rb
|
157
167
|
- lib/openapi_client/models/list_devices_response.rb
|
168
|
+
- lib/openapi_client/models/list_paginated_users_item.rb
|
169
|
+
- lib/openapi_client/models/list_paginated_users_response.rb
|
158
170
|
- lib/openapi_client/models/magic_link.rb
|
159
171
|
- lib/openapi_client/models/magic_link_auth_method.rb
|
160
172
|
- lib/openapi_client/models/magic_link_channel.rb
|
@@ -162,20 +174,21 @@ files:
|
|
162
174
|
- lib/openapi_client/models/magic_link_type.rb
|
163
175
|
- lib/openapi_client/models/model400_error.rb
|
164
176
|
- lib/openapi_client/models/model401_error.rb
|
177
|
+
- lib/openapi_client/models/model403_error.rb
|
165
178
|
- lib/openapi_client/models/model404_error.rb
|
166
179
|
- lib/openapi_client/models/model500_error.rb
|
180
|
+
- lib/openapi_client/models/nonce.rb
|
167
181
|
- lib/openapi_client/models/otp_auth_method.rb
|
182
|
+
- lib/openapi_client/models/paginated_links.rb
|
168
183
|
- lib/openapi_client/models/passkeys_auth_method.rb
|
169
184
|
- lib/openapi_client/models/technologies.rb
|
170
185
|
- lib/openapi_client/models/ttl_display_unit.rb
|
171
|
-
- lib/openapi_client/models/update_magic_link_auth_method.rb
|
172
|
-
- lib/openapi_client/models/update_otp_auth_method.rb
|
173
|
-
- lib/openapi_client/models/update_passkeys_auth_method.rb
|
174
186
|
- lib/openapi_client/models/update_user_request.rb
|
175
|
-
- lib/openapi_client/models/
|
187
|
+
- lib/openapi_client/models/user_event_status.rb
|
176
188
|
- lib/openapi_client/models/user_info.rb
|
177
189
|
- lib/openapi_client/models/user_metadata_field.rb
|
178
190
|
- lib/openapi_client/models/user_metadata_field_type.rb
|
191
|
+
- lib/openapi_client/models/user_recent_event.rb
|
179
192
|
- lib/openapi_client/models/user_response.rb
|
180
193
|
- lib/openapi_client/models/user_social_connections.rb
|
181
194
|
- lib/openapi_client/models/user_status.rb
|
@@ -1,22 +0,0 @@
|
|
1
|
-
# OpenapiClient::UpdateMagicLinkAuthMethod
|
2
|
-
|
3
|
-
## Properties
|
4
|
-
|
5
|
-
| Name | Type | Description | Notes |
|
6
|
-
| ---- | ---- | ----------- | ----- |
|
7
|
-
| **enabled** | **Boolean** | | [optional] |
|
8
|
-
| **ttl** | **Integer** | Maximum time (IN SECONDS) for the auth to expire. | [optional][default to 300] |
|
9
|
-
| **ttl_display_unit** | [**TtlDisplayUnit**](TtlDisplayUnit.md) | | [optional] |
|
10
|
-
|
11
|
-
## Example
|
12
|
-
|
13
|
-
```ruby
|
14
|
-
require 'openapi_client'
|
15
|
-
|
16
|
-
instance = OpenapiClient::UpdateMagicLinkAuthMethod.new(
|
17
|
-
enabled: null,
|
18
|
-
ttl: null,
|
19
|
-
ttl_display_unit: null
|
20
|
-
)
|
21
|
-
```
|
22
|
-
|
@@ -1,22 +0,0 @@
|
|
1
|
-
# OpenapiClient::UpdateOtpAuthMethod
|
2
|
-
|
3
|
-
## Properties
|
4
|
-
|
5
|
-
| Name | Type | Description | Notes |
|
6
|
-
| ---- | ---- | ----------- | ----- |
|
7
|
-
| **enabled** | **Boolean** | | [optional] |
|
8
|
-
| **ttl** | **Integer** | Maximum time (IN SECONDS) for the auth to expire. | [optional][default to 300] |
|
9
|
-
| **ttl_display_unit** | [**TtlDisplayUnit**](TtlDisplayUnit.md) | | [optional] |
|
10
|
-
|
11
|
-
## Example
|
12
|
-
|
13
|
-
```ruby
|
14
|
-
require 'openapi_client'
|
15
|
-
|
16
|
-
instance = OpenapiClient::UpdateOtpAuthMethod.new(
|
17
|
-
enabled: null,
|
18
|
-
ttl: null,
|
19
|
-
ttl_display_unit: null
|
20
|
-
)
|
21
|
-
```
|
22
|
-
|
@@ -1,18 +0,0 @@
|
|
1
|
-
# OpenapiClient::UpdatePasskeysAuthMethod
|
2
|
-
|
3
|
-
## Properties
|
4
|
-
|
5
|
-
| Name | Type | Description | Notes |
|
6
|
-
| ---- | ---- | ----------- | ----- |
|
7
|
-
| **enabled** | **Boolean** | | [optional][default to true] |
|
8
|
-
|
9
|
-
## Example
|
10
|
-
|
11
|
-
```ruby
|
12
|
-
require 'openapi_client'
|
13
|
-
|
14
|
-
instance = OpenapiClient::UpdatePasskeysAuthMethod.new(
|
15
|
-
enabled: null
|
16
|
-
)
|
17
|
-
```
|
18
|
-
|
File without changes
|
File without changes
|
File without changes
|