zyphr 0.1.37 → 0.1.39
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 +16 -1
- data/docs/AuthOAuthApi.md +12 -12
- data/docs/AuthRegistrationApi.md +145 -1
- data/docs/AuthUserDirectoryApi.md +627 -0
- data/docs/AuthUserProfileApi.md +0 -76
- data/docs/InviteEndUserRequest.md +26 -0
- data/docs/OAuthProviderName.md +15 -0
- data/docs/SetEndUserClaimsRequest.md +18 -0
- data/docs/SignInAnonymouslyRequest.md +5 -1
- data/docs/SignInWithGameCenterRequest.md +28 -0
- data/docs/SignInWithGooglePlayGamesRequest.md +18 -0
- data/docs/UpdateEndUserByApplicationRequest.md +26 -0
- data/lib/zyphr/api/auth_o_auth_api.rb +12 -12
- data/lib/zyphr/api/auth_registration_api.rb +138 -2
- data/lib/zyphr/api/auth_user_directory_api.rb +560 -0
- data/lib/zyphr/api/auth_user_profile_api.rb +0 -61
- data/lib/zyphr/models/invite_end_user_request.rb +309 -0
- data/lib/zyphr/models/o_auth_provider_name.rb +43 -0
- data/lib/zyphr/models/set_end_user_claims_request.rb +220 -0
- data/lib/zyphr/models/sign_in_anonymously_request.rb +43 -4
- data/lib/zyphr/models/sign_in_with_game_center_request.rb +373 -0
- data/lib/zyphr/models/sign_in_with_google_play_games_request.rb +238 -0
- data/lib/zyphr/models/update_end_user_by_application_request.rb +256 -0
- data/lib/zyphr.rb +7 -0
- data/spec/api/auth_registration_api_spec.rb +25 -1
- data/spec/api/auth_user_directory_api_spec.rb +136 -0
- data/spec/api/auth_user_profile_api_spec.rb +0 -12
- data/spec/models/invite_end_user_request_spec.rb +64 -0
- data/spec/models/o_auth_provider_name_spec.rb +30 -0
- data/spec/models/set_end_user_claims_request_spec.rb +36 -0
- data/spec/models/sign_in_anonymously_request_spec.rb +12 -0
- data/spec/models/sign_in_with_game_center_request_spec.rb +66 -0
- data/spec/models/sign_in_with_google_play_games_request_spec.rb +36 -0
- data/spec/models/update_end_user_by_application_request_spec.rb +60 -0
- data/zyphr.gemspec +1 -1
- metadata +450 -422
|
@@ -0,0 +1,627 @@
|
|
|
1
|
+
# Zyphr::AuthUserDirectoryApi
|
|
2
|
+
|
|
3
|
+
All URIs are relative to *https://api.zyphr.dev/v1*
|
|
4
|
+
|
|
5
|
+
| Method | HTTP request | Description |
|
|
6
|
+
| ------ | ------------ | ----------- |
|
|
7
|
+
| [**delete_end_user_by_application**](AuthUserDirectoryApi.md#delete_end_user_by_application) | **DELETE** /auth/users/{user_id} | Delete an end user (server-side admin) |
|
|
8
|
+
| [**get_end_user_by_email**](AuthUserDirectoryApi.md#get_end_user_by_email) | **GET** /auth/users/by-email | Look up an end user by email (server-side admin) |
|
|
9
|
+
| [**get_end_user_by_id**](AuthUserDirectoryApi.md#get_end_user_by_id) | **GET** /auth/users/{user_id} | Get an end user by id (server-side admin) |
|
|
10
|
+
| [**get_end_user_claims**](AuthUserDirectoryApi.md#get_end_user_claims) | **GET** /auth/users/{user_id}/claims | Get an end user's stored custom claims (server-side admin) |
|
|
11
|
+
| [**invite_end_user**](AuthUserDirectoryApi.md#invite_end_user) | **POST** /auth/users/invite | Pre-provision (invite) an end user (server-side admin) |
|
|
12
|
+
| [**list_end_users**](AuthUserDirectoryApi.md#list_end_users) | **GET** /auth/users | List / search end users (server-side admin) |
|
|
13
|
+
| [**set_end_user_claims**](AuthUserDirectoryApi.md#set_end_user_claims) | **PUT** /auth/users/{user_id}/claims | Set an end user's stored custom claims (server-side admin) |
|
|
14
|
+
| [**update_end_user_by_application**](AuthUserDirectoryApi.md#update_end_user_by_application) | **PATCH** /auth/users/{user_id} | Update an end user (server-side admin) |
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
## delete_end_user_by_application
|
|
18
|
+
|
|
19
|
+
> delete_end_user_by_application(user_id)
|
|
20
|
+
|
|
21
|
+
Delete an end user (server-side admin)
|
|
22
|
+
|
|
23
|
+
Secret-key-scoped admin soft-delete for an arbitrary end user in the authenticating application. Works in both test and live environments. Scoped to the application via the application_id filter — a caller can never delete a user belonging to another application. Mirrors the self-service `DELETE /auth/users/me` flow: revokes all sessions, soft-deletes the row (status='deleted'), and emits a `user.deleted` webhook with `method='application_admin'`. The audit log row survives (no FK to end_users), so org-history queries still resolve.
|
|
24
|
+
|
|
25
|
+
### Examples
|
|
26
|
+
|
|
27
|
+
```ruby
|
|
28
|
+
require 'time'
|
|
29
|
+
require 'zyphr'
|
|
30
|
+
# setup authorization
|
|
31
|
+
Zyphr.configure do |config|
|
|
32
|
+
# Configure API key authorization: ApplicationSecret
|
|
33
|
+
config.api_key['X-Application-Secret'] = 'YOUR API KEY'
|
|
34
|
+
# Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
|
|
35
|
+
# config.api_key_prefix['X-Application-Secret'] = 'Bearer'
|
|
36
|
+
|
|
37
|
+
# Configure API key authorization: ApplicationPublicKey
|
|
38
|
+
config.api_key['X-Application-Key'] = 'YOUR API KEY'
|
|
39
|
+
# Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
|
|
40
|
+
# config.api_key_prefix['X-Application-Key'] = 'Bearer'
|
|
41
|
+
end
|
|
42
|
+
|
|
43
|
+
api_instance = Zyphr::AuthUserDirectoryApi.new
|
|
44
|
+
user_id = '38400000-8cf0-11bd-b23e-10b96e4ef00d' # String |
|
|
45
|
+
|
|
46
|
+
begin
|
|
47
|
+
# Delete an end user (server-side admin)
|
|
48
|
+
api_instance.delete_end_user_by_application(user_id)
|
|
49
|
+
rescue Zyphr::ApiError => e
|
|
50
|
+
puts "Error when calling AuthUserDirectoryApi->delete_end_user_by_application: #{e}"
|
|
51
|
+
end
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
#### Using the delete_end_user_by_application_with_http_info variant
|
|
55
|
+
|
|
56
|
+
This returns an Array which contains the response data (`nil` in this case), status code and headers.
|
|
57
|
+
|
|
58
|
+
> <Array(nil, Integer, Hash)> delete_end_user_by_application_with_http_info(user_id)
|
|
59
|
+
|
|
60
|
+
```ruby
|
|
61
|
+
begin
|
|
62
|
+
# Delete an end user (server-side admin)
|
|
63
|
+
data, status_code, headers = api_instance.delete_end_user_by_application_with_http_info(user_id)
|
|
64
|
+
p status_code # => 2xx
|
|
65
|
+
p headers # => { ... }
|
|
66
|
+
p data # => nil
|
|
67
|
+
rescue Zyphr::ApiError => e
|
|
68
|
+
puts "Error when calling AuthUserDirectoryApi->delete_end_user_by_application_with_http_info: #{e}"
|
|
69
|
+
end
|
|
70
|
+
```
|
|
71
|
+
|
|
72
|
+
### Parameters
|
|
73
|
+
|
|
74
|
+
| Name | Type | Description | Notes |
|
|
75
|
+
| ---- | ---- | ----------- | ----- |
|
|
76
|
+
| **user_id** | **String** | | |
|
|
77
|
+
|
|
78
|
+
### Return type
|
|
79
|
+
|
|
80
|
+
nil (empty response body)
|
|
81
|
+
|
|
82
|
+
### Authorization
|
|
83
|
+
|
|
84
|
+
[ApplicationSecret](../README.md#ApplicationSecret), [ApplicationPublicKey](../README.md#ApplicationPublicKey)
|
|
85
|
+
|
|
86
|
+
### HTTP request headers
|
|
87
|
+
|
|
88
|
+
- **Content-Type**: Not defined
|
|
89
|
+
- **Accept**: Not defined
|
|
90
|
+
|
|
91
|
+
|
|
92
|
+
## get_end_user_by_email
|
|
93
|
+
|
|
94
|
+
> get_end_user_by_email(email)
|
|
95
|
+
|
|
96
|
+
Look up an end user by email (server-side admin)
|
|
97
|
+
|
|
98
|
+
Secret-key-scoped lookup of a single end user by email address within the authenticating application. Scoped to the application — never resolves a user from another application. Does not return the password hash.
|
|
99
|
+
|
|
100
|
+
### Examples
|
|
101
|
+
|
|
102
|
+
```ruby
|
|
103
|
+
require 'time'
|
|
104
|
+
require 'zyphr'
|
|
105
|
+
# setup authorization
|
|
106
|
+
Zyphr.configure do |config|
|
|
107
|
+
# Configure API key authorization: ApplicationSecret
|
|
108
|
+
config.api_key['X-Application-Secret'] = 'YOUR API KEY'
|
|
109
|
+
# Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
|
|
110
|
+
# config.api_key_prefix['X-Application-Secret'] = 'Bearer'
|
|
111
|
+
|
|
112
|
+
# Configure API key authorization: ApplicationPublicKey
|
|
113
|
+
config.api_key['X-Application-Key'] = 'YOUR API KEY'
|
|
114
|
+
# Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
|
|
115
|
+
# config.api_key_prefix['X-Application-Key'] = 'Bearer'
|
|
116
|
+
end
|
|
117
|
+
|
|
118
|
+
api_instance = Zyphr::AuthUserDirectoryApi.new
|
|
119
|
+
email = 'email_example' # String |
|
|
120
|
+
|
|
121
|
+
begin
|
|
122
|
+
# Look up an end user by email (server-side admin)
|
|
123
|
+
api_instance.get_end_user_by_email(email)
|
|
124
|
+
rescue Zyphr::ApiError => e
|
|
125
|
+
puts "Error when calling AuthUserDirectoryApi->get_end_user_by_email: #{e}"
|
|
126
|
+
end
|
|
127
|
+
```
|
|
128
|
+
|
|
129
|
+
#### Using the get_end_user_by_email_with_http_info variant
|
|
130
|
+
|
|
131
|
+
This returns an Array which contains the response data (`nil` in this case), status code and headers.
|
|
132
|
+
|
|
133
|
+
> <Array(nil, Integer, Hash)> get_end_user_by_email_with_http_info(email)
|
|
134
|
+
|
|
135
|
+
```ruby
|
|
136
|
+
begin
|
|
137
|
+
# Look up an end user by email (server-side admin)
|
|
138
|
+
data, status_code, headers = api_instance.get_end_user_by_email_with_http_info(email)
|
|
139
|
+
p status_code # => 2xx
|
|
140
|
+
p headers # => { ... }
|
|
141
|
+
p data # => nil
|
|
142
|
+
rescue Zyphr::ApiError => e
|
|
143
|
+
puts "Error when calling AuthUserDirectoryApi->get_end_user_by_email_with_http_info: #{e}"
|
|
144
|
+
end
|
|
145
|
+
```
|
|
146
|
+
|
|
147
|
+
### Parameters
|
|
148
|
+
|
|
149
|
+
| Name | Type | Description | Notes |
|
|
150
|
+
| ---- | ---- | ----------- | ----- |
|
|
151
|
+
| **email** | **String** | | |
|
|
152
|
+
|
|
153
|
+
### Return type
|
|
154
|
+
|
|
155
|
+
nil (empty response body)
|
|
156
|
+
|
|
157
|
+
### Authorization
|
|
158
|
+
|
|
159
|
+
[ApplicationSecret](../README.md#ApplicationSecret), [ApplicationPublicKey](../README.md#ApplicationPublicKey)
|
|
160
|
+
|
|
161
|
+
### HTTP request headers
|
|
162
|
+
|
|
163
|
+
- **Content-Type**: Not defined
|
|
164
|
+
- **Accept**: Not defined
|
|
165
|
+
|
|
166
|
+
|
|
167
|
+
## get_end_user_by_id
|
|
168
|
+
|
|
169
|
+
> get_end_user_by_id(user_id)
|
|
170
|
+
|
|
171
|
+
Get an end user by id (server-side admin)
|
|
172
|
+
|
|
173
|
+
Secret-key-scoped fetch of a single end user by id within the authenticating application. Scoped to the application — a caller can never read a user belonging to another application.
|
|
174
|
+
|
|
175
|
+
### Examples
|
|
176
|
+
|
|
177
|
+
```ruby
|
|
178
|
+
require 'time'
|
|
179
|
+
require 'zyphr'
|
|
180
|
+
# setup authorization
|
|
181
|
+
Zyphr.configure do |config|
|
|
182
|
+
# Configure API key authorization: ApplicationSecret
|
|
183
|
+
config.api_key['X-Application-Secret'] = 'YOUR API KEY'
|
|
184
|
+
# Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
|
|
185
|
+
# config.api_key_prefix['X-Application-Secret'] = 'Bearer'
|
|
186
|
+
|
|
187
|
+
# Configure API key authorization: ApplicationPublicKey
|
|
188
|
+
config.api_key['X-Application-Key'] = 'YOUR API KEY'
|
|
189
|
+
# Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
|
|
190
|
+
# config.api_key_prefix['X-Application-Key'] = 'Bearer'
|
|
191
|
+
end
|
|
192
|
+
|
|
193
|
+
api_instance = Zyphr::AuthUserDirectoryApi.new
|
|
194
|
+
user_id = '38400000-8cf0-11bd-b23e-10b96e4ef00d' # String |
|
|
195
|
+
|
|
196
|
+
begin
|
|
197
|
+
# Get an end user by id (server-side admin)
|
|
198
|
+
api_instance.get_end_user_by_id(user_id)
|
|
199
|
+
rescue Zyphr::ApiError => e
|
|
200
|
+
puts "Error when calling AuthUserDirectoryApi->get_end_user_by_id: #{e}"
|
|
201
|
+
end
|
|
202
|
+
```
|
|
203
|
+
|
|
204
|
+
#### Using the get_end_user_by_id_with_http_info variant
|
|
205
|
+
|
|
206
|
+
This returns an Array which contains the response data (`nil` in this case), status code and headers.
|
|
207
|
+
|
|
208
|
+
> <Array(nil, Integer, Hash)> get_end_user_by_id_with_http_info(user_id)
|
|
209
|
+
|
|
210
|
+
```ruby
|
|
211
|
+
begin
|
|
212
|
+
# Get an end user by id (server-side admin)
|
|
213
|
+
data, status_code, headers = api_instance.get_end_user_by_id_with_http_info(user_id)
|
|
214
|
+
p status_code # => 2xx
|
|
215
|
+
p headers # => { ... }
|
|
216
|
+
p data # => nil
|
|
217
|
+
rescue Zyphr::ApiError => e
|
|
218
|
+
puts "Error when calling AuthUserDirectoryApi->get_end_user_by_id_with_http_info: #{e}"
|
|
219
|
+
end
|
|
220
|
+
```
|
|
221
|
+
|
|
222
|
+
### Parameters
|
|
223
|
+
|
|
224
|
+
| Name | Type | Description | Notes |
|
|
225
|
+
| ---- | ---- | ----------- | ----- |
|
|
226
|
+
| **user_id** | **String** | | |
|
|
227
|
+
|
|
228
|
+
### Return type
|
|
229
|
+
|
|
230
|
+
nil (empty response body)
|
|
231
|
+
|
|
232
|
+
### Authorization
|
|
233
|
+
|
|
234
|
+
[ApplicationSecret](../README.md#ApplicationSecret), [ApplicationPublicKey](../README.md#ApplicationPublicKey)
|
|
235
|
+
|
|
236
|
+
### HTTP request headers
|
|
237
|
+
|
|
238
|
+
- **Content-Type**: Not defined
|
|
239
|
+
- **Accept**: Not defined
|
|
240
|
+
|
|
241
|
+
|
|
242
|
+
## get_end_user_claims
|
|
243
|
+
|
|
244
|
+
> get_end_user_claims(user_id)
|
|
245
|
+
|
|
246
|
+
Get an end user's stored custom claims (server-side admin)
|
|
247
|
+
|
|
248
|
+
Secret-key-scoped read of the authoritative custom_claims stored for an end user. These are the TRUSTED claims embedded into the user's JWTs on login/refresh — use them (not the client-writable `metadata` field) for authorization decisions. Returns an empty object when none are set.
|
|
249
|
+
|
|
250
|
+
### Examples
|
|
251
|
+
|
|
252
|
+
```ruby
|
|
253
|
+
require 'time'
|
|
254
|
+
require 'zyphr'
|
|
255
|
+
# setup authorization
|
|
256
|
+
Zyphr.configure do |config|
|
|
257
|
+
# Configure API key authorization: ApplicationSecret
|
|
258
|
+
config.api_key['X-Application-Secret'] = 'YOUR API KEY'
|
|
259
|
+
# Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
|
|
260
|
+
# config.api_key_prefix['X-Application-Secret'] = 'Bearer'
|
|
261
|
+
|
|
262
|
+
# Configure API key authorization: ApplicationPublicKey
|
|
263
|
+
config.api_key['X-Application-Key'] = 'YOUR API KEY'
|
|
264
|
+
# Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
|
|
265
|
+
# config.api_key_prefix['X-Application-Key'] = 'Bearer'
|
|
266
|
+
end
|
|
267
|
+
|
|
268
|
+
api_instance = Zyphr::AuthUserDirectoryApi.new
|
|
269
|
+
user_id = '38400000-8cf0-11bd-b23e-10b96e4ef00d' # String |
|
|
270
|
+
|
|
271
|
+
begin
|
|
272
|
+
# Get an end user's stored custom claims (server-side admin)
|
|
273
|
+
api_instance.get_end_user_claims(user_id)
|
|
274
|
+
rescue Zyphr::ApiError => e
|
|
275
|
+
puts "Error when calling AuthUserDirectoryApi->get_end_user_claims: #{e}"
|
|
276
|
+
end
|
|
277
|
+
```
|
|
278
|
+
|
|
279
|
+
#### Using the get_end_user_claims_with_http_info variant
|
|
280
|
+
|
|
281
|
+
This returns an Array which contains the response data (`nil` in this case), status code and headers.
|
|
282
|
+
|
|
283
|
+
> <Array(nil, Integer, Hash)> get_end_user_claims_with_http_info(user_id)
|
|
284
|
+
|
|
285
|
+
```ruby
|
|
286
|
+
begin
|
|
287
|
+
# Get an end user's stored custom claims (server-side admin)
|
|
288
|
+
data, status_code, headers = api_instance.get_end_user_claims_with_http_info(user_id)
|
|
289
|
+
p status_code # => 2xx
|
|
290
|
+
p headers # => { ... }
|
|
291
|
+
p data # => nil
|
|
292
|
+
rescue Zyphr::ApiError => e
|
|
293
|
+
puts "Error when calling AuthUserDirectoryApi->get_end_user_claims_with_http_info: #{e}"
|
|
294
|
+
end
|
|
295
|
+
```
|
|
296
|
+
|
|
297
|
+
### Parameters
|
|
298
|
+
|
|
299
|
+
| Name | Type | Description | Notes |
|
|
300
|
+
| ---- | ---- | ----------- | ----- |
|
|
301
|
+
| **user_id** | **String** | | |
|
|
302
|
+
|
|
303
|
+
### Return type
|
|
304
|
+
|
|
305
|
+
nil (empty response body)
|
|
306
|
+
|
|
307
|
+
### Authorization
|
|
308
|
+
|
|
309
|
+
[ApplicationSecret](../README.md#ApplicationSecret), [ApplicationPublicKey](../README.md#ApplicationPublicKey)
|
|
310
|
+
|
|
311
|
+
### HTTP request headers
|
|
312
|
+
|
|
313
|
+
- **Content-Type**: Not defined
|
|
314
|
+
- **Accept**: Not defined
|
|
315
|
+
|
|
316
|
+
|
|
317
|
+
## invite_end_user
|
|
318
|
+
|
|
319
|
+
> invite_end_user(invite_end_user_request)
|
|
320
|
+
|
|
321
|
+
Pre-provision (invite) an end user (server-side admin)
|
|
322
|
+
|
|
323
|
+
Secret-key-scoped pre-provisioning for an end user. Creates a passwordless user in the authenticating application (idempotent on email — an existing, non-deleted user is reused, not duplicated) and, when `send_link` is set, sends a first-login link so the user can set up their account without self-registration. - `send_link: \"magic\"` sends a magic-link sign-in email. - `send_link: \"password_reset\"` sends a set-password email. - `send_link: \"none\"` (default) creates the user with no email. A `redirect_url` is required when `send_link` is \"magic\" or \"password_reset\"; it must match the application's redirect_uris allowlist (custom schemes such as yourapp://path are permitted).
|
|
324
|
+
|
|
325
|
+
### Examples
|
|
326
|
+
|
|
327
|
+
```ruby
|
|
328
|
+
require 'time'
|
|
329
|
+
require 'zyphr'
|
|
330
|
+
# setup authorization
|
|
331
|
+
Zyphr.configure do |config|
|
|
332
|
+
# Configure API key authorization: ApplicationSecret
|
|
333
|
+
config.api_key['X-Application-Secret'] = 'YOUR API KEY'
|
|
334
|
+
# Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
|
|
335
|
+
# config.api_key_prefix['X-Application-Secret'] = 'Bearer'
|
|
336
|
+
|
|
337
|
+
# Configure API key authorization: ApplicationPublicKey
|
|
338
|
+
config.api_key['X-Application-Key'] = 'YOUR API KEY'
|
|
339
|
+
# Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
|
|
340
|
+
# config.api_key_prefix['X-Application-Key'] = 'Bearer'
|
|
341
|
+
end
|
|
342
|
+
|
|
343
|
+
api_instance = Zyphr::AuthUserDirectoryApi.new
|
|
344
|
+
invite_end_user_request = Zyphr::InviteEndUserRequest.new({email: 'email_example'}) # InviteEndUserRequest |
|
|
345
|
+
|
|
346
|
+
begin
|
|
347
|
+
# Pre-provision (invite) an end user (server-side admin)
|
|
348
|
+
api_instance.invite_end_user(invite_end_user_request)
|
|
349
|
+
rescue Zyphr::ApiError => e
|
|
350
|
+
puts "Error when calling AuthUserDirectoryApi->invite_end_user: #{e}"
|
|
351
|
+
end
|
|
352
|
+
```
|
|
353
|
+
|
|
354
|
+
#### Using the invite_end_user_with_http_info variant
|
|
355
|
+
|
|
356
|
+
This returns an Array which contains the response data (`nil` in this case), status code and headers.
|
|
357
|
+
|
|
358
|
+
> <Array(nil, Integer, Hash)> invite_end_user_with_http_info(invite_end_user_request)
|
|
359
|
+
|
|
360
|
+
```ruby
|
|
361
|
+
begin
|
|
362
|
+
# Pre-provision (invite) an end user (server-side admin)
|
|
363
|
+
data, status_code, headers = api_instance.invite_end_user_with_http_info(invite_end_user_request)
|
|
364
|
+
p status_code # => 2xx
|
|
365
|
+
p headers # => { ... }
|
|
366
|
+
p data # => nil
|
|
367
|
+
rescue Zyphr::ApiError => e
|
|
368
|
+
puts "Error when calling AuthUserDirectoryApi->invite_end_user_with_http_info: #{e}"
|
|
369
|
+
end
|
|
370
|
+
```
|
|
371
|
+
|
|
372
|
+
### Parameters
|
|
373
|
+
|
|
374
|
+
| Name | Type | Description | Notes |
|
|
375
|
+
| ---- | ---- | ----------- | ----- |
|
|
376
|
+
| **invite_end_user_request** | [**InviteEndUserRequest**](InviteEndUserRequest.md) | | |
|
|
377
|
+
|
|
378
|
+
### Return type
|
|
379
|
+
|
|
380
|
+
nil (empty response body)
|
|
381
|
+
|
|
382
|
+
### Authorization
|
|
383
|
+
|
|
384
|
+
[ApplicationSecret](../README.md#ApplicationSecret), [ApplicationPublicKey](../README.md#ApplicationPublicKey)
|
|
385
|
+
|
|
386
|
+
### HTTP request headers
|
|
387
|
+
|
|
388
|
+
- **Content-Type**: application/json
|
|
389
|
+
- **Accept**: Not defined
|
|
390
|
+
|
|
391
|
+
|
|
392
|
+
## list_end_users
|
|
393
|
+
|
|
394
|
+
> list_end_users(opts)
|
|
395
|
+
|
|
396
|
+
List / search end users (server-side admin)
|
|
397
|
+
|
|
398
|
+
Secret-key-scoped directory listing of end users in the authenticating application. Supports substring search over email, name, and phone, an optional environment filter (test/live), and pagination. Scoped to the application — never returns users from another application.
|
|
399
|
+
|
|
400
|
+
### Examples
|
|
401
|
+
|
|
402
|
+
```ruby
|
|
403
|
+
require 'time'
|
|
404
|
+
require 'zyphr'
|
|
405
|
+
# setup authorization
|
|
406
|
+
Zyphr.configure do |config|
|
|
407
|
+
# Configure API key authorization: ApplicationSecret
|
|
408
|
+
config.api_key['X-Application-Secret'] = 'YOUR API KEY'
|
|
409
|
+
# Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
|
|
410
|
+
# config.api_key_prefix['X-Application-Secret'] = 'Bearer'
|
|
411
|
+
|
|
412
|
+
# Configure API key authorization: ApplicationPublicKey
|
|
413
|
+
config.api_key['X-Application-Key'] = 'YOUR API KEY'
|
|
414
|
+
# Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
|
|
415
|
+
# config.api_key_prefix['X-Application-Key'] = 'Bearer'
|
|
416
|
+
end
|
|
417
|
+
|
|
418
|
+
api_instance = Zyphr::AuthUserDirectoryApi.new
|
|
419
|
+
opts = {
|
|
420
|
+
page: 56, # Integer |
|
|
421
|
+
per_page: 56, # Integer |
|
|
422
|
+
search: 'search_example', # String | Substring match against email, name, or phone number.
|
|
423
|
+
environment: 'test' # String |
|
|
424
|
+
}
|
|
425
|
+
|
|
426
|
+
begin
|
|
427
|
+
# List / search end users (server-side admin)
|
|
428
|
+
api_instance.list_end_users(opts)
|
|
429
|
+
rescue Zyphr::ApiError => e
|
|
430
|
+
puts "Error when calling AuthUserDirectoryApi->list_end_users: #{e}"
|
|
431
|
+
end
|
|
432
|
+
```
|
|
433
|
+
|
|
434
|
+
#### Using the list_end_users_with_http_info variant
|
|
435
|
+
|
|
436
|
+
This returns an Array which contains the response data (`nil` in this case), status code and headers.
|
|
437
|
+
|
|
438
|
+
> <Array(nil, Integer, Hash)> list_end_users_with_http_info(opts)
|
|
439
|
+
|
|
440
|
+
```ruby
|
|
441
|
+
begin
|
|
442
|
+
# List / search end users (server-side admin)
|
|
443
|
+
data, status_code, headers = api_instance.list_end_users_with_http_info(opts)
|
|
444
|
+
p status_code # => 2xx
|
|
445
|
+
p headers # => { ... }
|
|
446
|
+
p data # => nil
|
|
447
|
+
rescue Zyphr::ApiError => e
|
|
448
|
+
puts "Error when calling AuthUserDirectoryApi->list_end_users_with_http_info: #{e}"
|
|
449
|
+
end
|
|
450
|
+
```
|
|
451
|
+
|
|
452
|
+
### Parameters
|
|
453
|
+
|
|
454
|
+
| Name | Type | Description | Notes |
|
|
455
|
+
| ---- | ---- | ----------- | ----- |
|
|
456
|
+
| **page** | **Integer** | | [optional][default to 1] |
|
|
457
|
+
| **per_page** | **Integer** | | [optional][default to 20] |
|
|
458
|
+
| **search** | **String** | Substring match against email, name, or phone number. | [optional] |
|
|
459
|
+
| **environment** | **String** | | [optional] |
|
|
460
|
+
|
|
461
|
+
### Return type
|
|
462
|
+
|
|
463
|
+
nil (empty response body)
|
|
464
|
+
|
|
465
|
+
### Authorization
|
|
466
|
+
|
|
467
|
+
[ApplicationSecret](../README.md#ApplicationSecret), [ApplicationPublicKey](../README.md#ApplicationPublicKey)
|
|
468
|
+
|
|
469
|
+
### HTTP request headers
|
|
470
|
+
|
|
471
|
+
- **Content-Type**: Not defined
|
|
472
|
+
- **Accept**: Not defined
|
|
473
|
+
|
|
474
|
+
|
|
475
|
+
## set_end_user_claims
|
|
476
|
+
|
|
477
|
+
> set_end_user_claims(user_id, set_end_user_claims_request)
|
|
478
|
+
|
|
479
|
+
Set an end user's stored custom claims (server-side admin)
|
|
480
|
+
|
|
481
|
+
Secret-key-scoped upsert of the authoritative custom_claims for an end user. Set server-side only — clients cannot write these, which is what makes them safe for authorization (e.g. an account-type/admin flag). Claims are embedded into the user's JWTs on the next login/refresh. Max 4KB; reserved JWT/Zyphr claim names are rejected. To make a change take effect immediately on already-issued tokens (e.g. revoking admin), call POST /auth/sessions/revoke-all for the user after updating claims — that bumps the revocation epoch so outstanding access tokens stop verifying.
|
|
482
|
+
|
|
483
|
+
### Examples
|
|
484
|
+
|
|
485
|
+
```ruby
|
|
486
|
+
require 'time'
|
|
487
|
+
require 'zyphr'
|
|
488
|
+
# setup authorization
|
|
489
|
+
Zyphr.configure do |config|
|
|
490
|
+
# Configure API key authorization: ApplicationSecret
|
|
491
|
+
config.api_key['X-Application-Secret'] = 'YOUR API KEY'
|
|
492
|
+
# Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
|
|
493
|
+
# config.api_key_prefix['X-Application-Secret'] = 'Bearer'
|
|
494
|
+
|
|
495
|
+
# Configure API key authorization: ApplicationPublicKey
|
|
496
|
+
config.api_key['X-Application-Key'] = 'YOUR API KEY'
|
|
497
|
+
# Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
|
|
498
|
+
# config.api_key_prefix['X-Application-Key'] = 'Bearer'
|
|
499
|
+
end
|
|
500
|
+
|
|
501
|
+
api_instance = Zyphr::AuthUserDirectoryApi.new
|
|
502
|
+
user_id = '38400000-8cf0-11bd-b23e-10b96e4ef00d' # String |
|
|
503
|
+
set_end_user_claims_request = Zyphr::SetEndUserClaimsRequest.new # SetEndUserClaimsRequest |
|
|
504
|
+
|
|
505
|
+
begin
|
|
506
|
+
# Set an end user's stored custom claims (server-side admin)
|
|
507
|
+
api_instance.set_end_user_claims(user_id, set_end_user_claims_request)
|
|
508
|
+
rescue Zyphr::ApiError => e
|
|
509
|
+
puts "Error when calling AuthUserDirectoryApi->set_end_user_claims: #{e}"
|
|
510
|
+
end
|
|
511
|
+
```
|
|
512
|
+
|
|
513
|
+
#### Using the set_end_user_claims_with_http_info variant
|
|
514
|
+
|
|
515
|
+
This returns an Array which contains the response data (`nil` in this case), status code and headers.
|
|
516
|
+
|
|
517
|
+
> <Array(nil, Integer, Hash)> set_end_user_claims_with_http_info(user_id, set_end_user_claims_request)
|
|
518
|
+
|
|
519
|
+
```ruby
|
|
520
|
+
begin
|
|
521
|
+
# Set an end user's stored custom claims (server-side admin)
|
|
522
|
+
data, status_code, headers = api_instance.set_end_user_claims_with_http_info(user_id, set_end_user_claims_request)
|
|
523
|
+
p status_code # => 2xx
|
|
524
|
+
p headers # => { ... }
|
|
525
|
+
p data # => nil
|
|
526
|
+
rescue Zyphr::ApiError => e
|
|
527
|
+
puts "Error when calling AuthUserDirectoryApi->set_end_user_claims_with_http_info: #{e}"
|
|
528
|
+
end
|
|
529
|
+
```
|
|
530
|
+
|
|
531
|
+
### Parameters
|
|
532
|
+
|
|
533
|
+
| Name | Type | Description | Notes |
|
|
534
|
+
| ---- | ---- | ----------- | ----- |
|
|
535
|
+
| **user_id** | **String** | | |
|
|
536
|
+
| **set_end_user_claims_request** | [**SetEndUserClaimsRequest**](SetEndUserClaimsRequest.md) | | |
|
|
537
|
+
|
|
538
|
+
### Return type
|
|
539
|
+
|
|
540
|
+
nil (empty response body)
|
|
541
|
+
|
|
542
|
+
### Authorization
|
|
543
|
+
|
|
544
|
+
[ApplicationSecret](../README.md#ApplicationSecret), [ApplicationPublicKey](../README.md#ApplicationPublicKey)
|
|
545
|
+
|
|
546
|
+
### HTTP request headers
|
|
547
|
+
|
|
548
|
+
- **Content-Type**: application/json
|
|
549
|
+
- **Accept**: Not defined
|
|
550
|
+
|
|
551
|
+
|
|
552
|
+
## update_end_user_by_application
|
|
553
|
+
|
|
554
|
+
> update_end_user_by_application(user_id, update_end_user_by_application_request)
|
|
555
|
+
|
|
556
|
+
Update an end user (server-side admin)
|
|
557
|
+
|
|
558
|
+
Secret-key-scoped update of an arbitrary end user in the authenticating application. Updatable fields: email, name, avatar_url, metadata, status. Scoped to the application — a caller can never modify a user belonging to another application.
|
|
559
|
+
|
|
560
|
+
### Examples
|
|
561
|
+
|
|
562
|
+
```ruby
|
|
563
|
+
require 'time'
|
|
564
|
+
require 'zyphr'
|
|
565
|
+
# setup authorization
|
|
566
|
+
Zyphr.configure do |config|
|
|
567
|
+
# Configure API key authorization: ApplicationSecret
|
|
568
|
+
config.api_key['X-Application-Secret'] = 'YOUR API KEY'
|
|
569
|
+
# Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
|
|
570
|
+
# config.api_key_prefix['X-Application-Secret'] = 'Bearer'
|
|
571
|
+
|
|
572
|
+
# Configure API key authorization: ApplicationPublicKey
|
|
573
|
+
config.api_key['X-Application-Key'] = 'YOUR API KEY'
|
|
574
|
+
# Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
|
|
575
|
+
# config.api_key_prefix['X-Application-Key'] = 'Bearer'
|
|
576
|
+
end
|
|
577
|
+
|
|
578
|
+
api_instance = Zyphr::AuthUserDirectoryApi.new
|
|
579
|
+
user_id = '38400000-8cf0-11bd-b23e-10b96e4ef00d' # String |
|
|
580
|
+
update_end_user_by_application_request = Zyphr::UpdateEndUserByApplicationRequest.new # UpdateEndUserByApplicationRequest |
|
|
581
|
+
|
|
582
|
+
begin
|
|
583
|
+
# Update an end user (server-side admin)
|
|
584
|
+
api_instance.update_end_user_by_application(user_id, update_end_user_by_application_request)
|
|
585
|
+
rescue Zyphr::ApiError => e
|
|
586
|
+
puts "Error when calling AuthUserDirectoryApi->update_end_user_by_application: #{e}"
|
|
587
|
+
end
|
|
588
|
+
```
|
|
589
|
+
|
|
590
|
+
#### Using the update_end_user_by_application_with_http_info variant
|
|
591
|
+
|
|
592
|
+
This returns an Array which contains the response data (`nil` in this case), status code and headers.
|
|
593
|
+
|
|
594
|
+
> <Array(nil, Integer, Hash)> update_end_user_by_application_with_http_info(user_id, update_end_user_by_application_request)
|
|
595
|
+
|
|
596
|
+
```ruby
|
|
597
|
+
begin
|
|
598
|
+
# Update an end user (server-side admin)
|
|
599
|
+
data, status_code, headers = api_instance.update_end_user_by_application_with_http_info(user_id, update_end_user_by_application_request)
|
|
600
|
+
p status_code # => 2xx
|
|
601
|
+
p headers # => { ... }
|
|
602
|
+
p data # => nil
|
|
603
|
+
rescue Zyphr::ApiError => e
|
|
604
|
+
puts "Error when calling AuthUserDirectoryApi->update_end_user_by_application_with_http_info: #{e}"
|
|
605
|
+
end
|
|
606
|
+
```
|
|
607
|
+
|
|
608
|
+
### Parameters
|
|
609
|
+
|
|
610
|
+
| Name | Type | Description | Notes |
|
|
611
|
+
| ---- | ---- | ----------- | ----- |
|
|
612
|
+
| **user_id** | **String** | | |
|
|
613
|
+
| **update_end_user_by_application_request** | [**UpdateEndUserByApplicationRequest**](UpdateEndUserByApplicationRequest.md) | | |
|
|
614
|
+
|
|
615
|
+
### Return type
|
|
616
|
+
|
|
617
|
+
nil (empty response body)
|
|
618
|
+
|
|
619
|
+
### Authorization
|
|
620
|
+
|
|
621
|
+
[ApplicationSecret](../README.md#ApplicationSecret), [ApplicationPublicKey](../README.md#ApplicationPublicKey)
|
|
622
|
+
|
|
623
|
+
### HTTP request headers
|
|
624
|
+
|
|
625
|
+
- **Content-Type**: application/json
|
|
626
|
+
- **Accept**: Not defined
|
|
627
|
+
|