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,560 @@
|
|
|
1
|
+
=begin
|
|
2
|
+
#Zyphr API
|
|
3
|
+
|
|
4
|
+
#Zyphr is a multi-channel notification platform that enables developers to send emails, push notifications, SMS, and in-app messages through a unified API. ## Authentication All API requests require authentication using an API key. Include your API key in the `X-API-Key` header: ``` X-API-Key: zy_live_xxxxxxxxxxxx ``` API keys can be created in the Zyphr Dashboard. Use `zy_test_*` keys for testing and `zy_live_*` keys for production. ## Rate Limiting The API implements rate limiting to ensure fair usage. Rate limit information is included in response headers: - `X-RateLimit-Limit`: Maximum requests per window - `X-RateLimit-Remaining`: Remaining requests in current window - `X-RateLimit-Reset`: Unix timestamp when the window resets ## Account Sending Status Every authenticated response carries the account's current sending state so you can surface it in your own tooling without a separate call: - `X-Account-Sending-Status`: `active`, `throttled`, or `frozen` - `X-Account-Sending-Status-Reason`: human-readable reason (present only when the status is `throttled` or `frozen`) This header is informational and non-blocking on non-send endpoints (reads, billing, and deliverability stay available). Send-capable endpoints additionally enforce the state: a frozen account receives `403 account_frozen` and a throttled account receives `429 account_throttled`, both with the reason in the error message. ## Errors All errors follow a consistent format: ```json { \"error\": { \"code\": \"error_code\", \"message\": \"Human readable message\", \"details\": {} }, \"meta\": { \"request_id\": \"req_xxxx\" } } ```
|
|
5
|
+
|
|
6
|
+
The version of the OpenAPI document: 1.0.0
|
|
7
|
+
Contact: support@zyphr.dev
|
|
8
|
+
Generated by: https://openapi-generator.tech
|
|
9
|
+
Generator version: 7.12.0
|
|
10
|
+
|
|
11
|
+
=end
|
|
12
|
+
|
|
13
|
+
require 'cgi'
|
|
14
|
+
|
|
15
|
+
module Zyphr
|
|
16
|
+
class AuthUserDirectoryApi
|
|
17
|
+
attr_accessor :api_client
|
|
18
|
+
|
|
19
|
+
def initialize(api_client = ApiClient.default)
|
|
20
|
+
@api_client = api_client
|
|
21
|
+
end
|
|
22
|
+
# Delete an end user (server-side admin)
|
|
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
|
+
# @param user_id [String]
|
|
25
|
+
# @param [Hash] opts the optional parameters
|
|
26
|
+
# @return [nil]
|
|
27
|
+
def delete_end_user_by_application(user_id, opts = {})
|
|
28
|
+
delete_end_user_by_application_with_http_info(user_id, opts)
|
|
29
|
+
nil
|
|
30
|
+
end
|
|
31
|
+
|
|
32
|
+
# Delete an end user (server-side admin)
|
|
33
|
+
# 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.
|
|
34
|
+
# @param user_id [String]
|
|
35
|
+
# @param [Hash] opts the optional parameters
|
|
36
|
+
# @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers
|
|
37
|
+
def delete_end_user_by_application_with_http_info(user_id, opts = {})
|
|
38
|
+
if @api_client.config.debugging
|
|
39
|
+
@api_client.config.logger.debug 'Calling API: AuthUserDirectoryApi.delete_end_user_by_application ...'
|
|
40
|
+
end
|
|
41
|
+
# verify the required parameter 'user_id' is set
|
|
42
|
+
if @api_client.config.client_side_validation && user_id.nil?
|
|
43
|
+
fail ArgumentError, "Missing the required parameter 'user_id' when calling AuthUserDirectoryApi.delete_end_user_by_application"
|
|
44
|
+
end
|
|
45
|
+
# resource path
|
|
46
|
+
local_var_path = '/auth/users/{user_id}'.sub('{' + 'user_id' + '}', CGI.escape(user_id.to_s))
|
|
47
|
+
|
|
48
|
+
# query parameters
|
|
49
|
+
query_params = opts[:query_params] || {}
|
|
50
|
+
|
|
51
|
+
# header parameters
|
|
52
|
+
header_params = opts[:header_params] || {}
|
|
53
|
+
|
|
54
|
+
# form parameters
|
|
55
|
+
form_params = opts[:form_params] || {}
|
|
56
|
+
|
|
57
|
+
# http body (model)
|
|
58
|
+
post_body = opts[:debug_body]
|
|
59
|
+
|
|
60
|
+
# return_type
|
|
61
|
+
return_type = opts[:debug_return_type]
|
|
62
|
+
|
|
63
|
+
# auth_names
|
|
64
|
+
auth_names = opts[:debug_auth_names] || ['ApplicationSecret', 'ApplicationPublicKey']
|
|
65
|
+
|
|
66
|
+
new_options = opts.merge(
|
|
67
|
+
:operation => :"AuthUserDirectoryApi.delete_end_user_by_application",
|
|
68
|
+
:header_params => header_params,
|
|
69
|
+
:query_params => query_params,
|
|
70
|
+
:form_params => form_params,
|
|
71
|
+
:body => post_body,
|
|
72
|
+
:auth_names => auth_names,
|
|
73
|
+
:return_type => return_type
|
|
74
|
+
)
|
|
75
|
+
|
|
76
|
+
data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, new_options)
|
|
77
|
+
if @api_client.config.debugging
|
|
78
|
+
@api_client.config.logger.debug "API called: AuthUserDirectoryApi#delete_end_user_by_application\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
79
|
+
end
|
|
80
|
+
return data, status_code, headers
|
|
81
|
+
end
|
|
82
|
+
|
|
83
|
+
# Look up an end user by email (server-side admin)
|
|
84
|
+
# 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.
|
|
85
|
+
# @param email [String]
|
|
86
|
+
# @param [Hash] opts the optional parameters
|
|
87
|
+
# @return [nil]
|
|
88
|
+
def get_end_user_by_email(email, opts = {})
|
|
89
|
+
get_end_user_by_email_with_http_info(email, opts)
|
|
90
|
+
nil
|
|
91
|
+
end
|
|
92
|
+
|
|
93
|
+
# Look up an end user by email (server-side admin)
|
|
94
|
+
# 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.
|
|
95
|
+
# @param email [String]
|
|
96
|
+
# @param [Hash] opts the optional parameters
|
|
97
|
+
# @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers
|
|
98
|
+
def get_end_user_by_email_with_http_info(email, opts = {})
|
|
99
|
+
if @api_client.config.debugging
|
|
100
|
+
@api_client.config.logger.debug 'Calling API: AuthUserDirectoryApi.get_end_user_by_email ...'
|
|
101
|
+
end
|
|
102
|
+
# verify the required parameter 'email' is set
|
|
103
|
+
if @api_client.config.client_side_validation && email.nil?
|
|
104
|
+
fail ArgumentError, "Missing the required parameter 'email' when calling AuthUserDirectoryApi.get_end_user_by_email"
|
|
105
|
+
end
|
|
106
|
+
# resource path
|
|
107
|
+
local_var_path = '/auth/users/by-email'
|
|
108
|
+
|
|
109
|
+
# query parameters
|
|
110
|
+
query_params = opts[:query_params] || {}
|
|
111
|
+
query_params[:'email'] = email
|
|
112
|
+
|
|
113
|
+
# header parameters
|
|
114
|
+
header_params = opts[:header_params] || {}
|
|
115
|
+
|
|
116
|
+
# form parameters
|
|
117
|
+
form_params = opts[:form_params] || {}
|
|
118
|
+
|
|
119
|
+
# http body (model)
|
|
120
|
+
post_body = opts[:debug_body]
|
|
121
|
+
|
|
122
|
+
# return_type
|
|
123
|
+
return_type = opts[:debug_return_type]
|
|
124
|
+
|
|
125
|
+
# auth_names
|
|
126
|
+
auth_names = opts[:debug_auth_names] || ['ApplicationSecret', 'ApplicationPublicKey']
|
|
127
|
+
|
|
128
|
+
new_options = opts.merge(
|
|
129
|
+
:operation => :"AuthUserDirectoryApi.get_end_user_by_email",
|
|
130
|
+
:header_params => header_params,
|
|
131
|
+
:query_params => query_params,
|
|
132
|
+
:form_params => form_params,
|
|
133
|
+
:body => post_body,
|
|
134
|
+
:auth_names => auth_names,
|
|
135
|
+
:return_type => return_type
|
|
136
|
+
)
|
|
137
|
+
|
|
138
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
|
|
139
|
+
if @api_client.config.debugging
|
|
140
|
+
@api_client.config.logger.debug "API called: AuthUserDirectoryApi#get_end_user_by_email\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
141
|
+
end
|
|
142
|
+
return data, status_code, headers
|
|
143
|
+
end
|
|
144
|
+
|
|
145
|
+
# Get an end user by id (server-side admin)
|
|
146
|
+
# 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.
|
|
147
|
+
# @param user_id [String]
|
|
148
|
+
# @param [Hash] opts the optional parameters
|
|
149
|
+
# @return [nil]
|
|
150
|
+
def get_end_user_by_id(user_id, opts = {})
|
|
151
|
+
get_end_user_by_id_with_http_info(user_id, opts)
|
|
152
|
+
nil
|
|
153
|
+
end
|
|
154
|
+
|
|
155
|
+
# Get an end user by id (server-side admin)
|
|
156
|
+
# 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.
|
|
157
|
+
# @param user_id [String]
|
|
158
|
+
# @param [Hash] opts the optional parameters
|
|
159
|
+
# @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers
|
|
160
|
+
def get_end_user_by_id_with_http_info(user_id, opts = {})
|
|
161
|
+
if @api_client.config.debugging
|
|
162
|
+
@api_client.config.logger.debug 'Calling API: AuthUserDirectoryApi.get_end_user_by_id ...'
|
|
163
|
+
end
|
|
164
|
+
# verify the required parameter 'user_id' is set
|
|
165
|
+
if @api_client.config.client_side_validation && user_id.nil?
|
|
166
|
+
fail ArgumentError, "Missing the required parameter 'user_id' when calling AuthUserDirectoryApi.get_end_user_by_id"
|
|
167
|
+
end
|
|
168
|
+
# resource path
|
|
169
|
+
local_var_path = '/auth/users/{user_id}'.sub('{' + 'user_id' + '}', CGI.escape(user_id.to_s))
|
|
170
|
+
|
|
171
|
+
# query parameters
|
|
172
|
+
query_params = opts[:query_params] || {}
|
|
173
|
+
|
|
174
|
+
# header parameters
|
|
175
|
+
header_params = opts[:header_params] || {}
|
|
176
|
+
|
|
177
|
+
# form parameters
|
|
178
|
+
form_params = opts[:form_params] || {}
|
|
179
|
+
|
|
180
|
+
# http body (model)
|
|
181
|
+
post_body = opts[:debug_body]
|
|
182
|
+
|
|
183
|
+
# return_type
|
|
184
|
+
return_type = opts[:debug_return_type]
|
|
185
|
+
|
|
186
|
+
# auth_names
|
|
187
|
+
auth_names = opts[:debug_auth_names] || ['ApplicationSecret', 'ApplicationPublicKey']
|
|
188
|
+
|
|
189
|
+
new_options = opts.merge(
|
|
190
|
+
:operation => :"AuthUserDirectoryApi.get_end_user_by_id",
|
|
191
|
+
:header_params => header_params,
|
|
192
|
+
:query_params => query_params,
|
|
193
|
+
:form_params => form_params,
|
|
194
|
+
:body => post_body,
|
|
195
|
+
:auth_names => auth_names,
|
|
196
|
+
:return_type => return_type
|
|
197
|
+
)
|
|
198
|
+
|
|
199
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
|
|
200
|
+
if @api_client.config.debugging
|
|
201
|
+
@api_client.config.logger.debug "API called: AuthUserDirectoryApi#get_end_user_by_id\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
202
|
+
end
|
|
203
|
+
return data, status_code, headers
|
|
204
|
+
end
|
|
205
|
+
|
|
206
|
+
# Get an end user's stored custom claims (server-side admin)
|
|
207
|
+
# 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.
|
|
208
|
+
# @param user_id [String]
|
|
209
|
+
# @param [Hash] opts the optional parameters
|
|
210
|
+
# @return [nil]
|
|
211
|
+
def get_end_user_claims(user_id, opts = {})
|
|
212
|
+
get_end_user_claims_with_http_info(user_id, opts)
|
|
213
|
+
nil
|
|
214
|
+
end
|
|
215
|
+
|
|
216
|
+
# Get an end user's stored custom claims (server-side admin)
|
|
217
|
+
# 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.
|
|
218
|
+
# @param user_id [String]
|
|
219
|
+
# @param [Hash] opts the optional parameters
|
|
220
|
+
# @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers
|
|
221
|
+
def get_end_user_claims_with_http_info(user_id, opts = {})
|
|
222
|
+
if @api_client.config.debugging
|
|
223
|
+
@api_client.config.logger.debug 'Calling API: AuthUserDirectoryApi.get_end_user_claims ...'
|
|
224
|
+
end
|
|
225
|
+
# verify the required parameter 'user_id' is set
|
|
226
|
+
if @api_client.config.client_side_validation && user_id.nil?
|
|
227
|
+
fail ArgumentError, "Missing the required parameter 'user_id' when calling AuthUserDirectoryApi.get_end_user_claims"
|
|
228
|
+
end
|
|
229
|
+
# resource path
|
|
230
|
+
local_var_path = '/auth/users/{user_id}/claims'.sub('{' + 'user_id' + '}', CGI.escape(user_id.to_s))
|
|
231
|
+
|
|
232
|
+
# query parameters
|
|
233
|
+
query_params = opts[:query_params] || {}
|
|
234
|
+
|
|
235
|
+
# header parameters
|
|
236
|
+
header_params = opts[:header_params] || {}
|
|
237
|
+
|
|
238
|
+
# form parameters
|
|
239
|
+
form_params = opts[:form_params] || {}
|
|
240
|
+
|
|
241
|
+
# http body (model)
|
|
242
|
+
post_body = opts[:debug_body]
|
|
243
|
+
|
|
244
|
+
# return_type
|
|
245
|
+
return_type = opts[:debug_return_type]
|
|
246
|
+
|
|
247
|
+
# auth_names
|
|
248
|
+
auth_names = opts[:debug_auth_names] || ['ApplicationSecret', 'ApplicationPublicKey']
|
|
249
|
+
|
|
250
|
+
new_options = opts.merge(
|
|
251
|
+
:operation => :"AuthUserDirectoryApi.get_end_user_claims",
|
|
252
|
+
:header_params => header_params,
|
|
253
|
+
:query_params => query_params,
|
|
254
|
+
:form_params => form_params,
|
|
255
|
+
:body => post_body,
|
|
256
|
+
:auth_names => auth_names,
|
|
257
|
+
:return_type => return_type
|
|
258
|
+
)
|
|
259
|
+
|
|
260
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
|
|
261
|
+
if @api_client.config.debugging
|
|
262
|
+
@api_client.config.logger.debug "API called: AuthUserDirectoryApi#get_end_user_claims\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
263
|
+
end
|
|
264
|
+
return data, status_code, headers
|
|
265
|
+
end
|
|
266
|
+
|
|
267
|
+
# Pre-provision (invite) an end user (server-side admin)
|
|
268
|
+
# 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).
|
|
269
|
+
# @param invite_end_user_request [InviteEndUserRequest]
|
|
270
|
+
# @param [Hash] opts the optional parameters
|
|
271
|
+
# @return [nil]
|
|
272
|
+
def invite_end_user(invite_end_user_request, opts = {})
|
|
273
|
+
invite_end_user_with_http_info(invite_end_user_request, opts)
|
|
274
|
+
nil
|
|
275
|
+
end
|
|
276
|
+
|
|
277
|
+
# Pre-provision (invite) an end user (server-side admin)
|
|
278
|
+
# 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).
|
|
279
|
+
# @param invite_end_user_request [InviteEndUserRequest]
|
|
280
|
+
# @param [Hash] opts the optional parameters
|
|
281
|
+
# @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers
|
|
282
|
+
def invite_end_user_with_http_info(invite_end_user_request, opts = {})
|
|
283
|
+
if @api_client.config.debugging
|
|
284
|
+
@api_client.config.logger.debug 'Calling API: AuthUserDirectoryApi.invite_end_user ...'
|
|
285
|
+
end
|
|
286
|
+
# verify the required parameter 'invite_end_user_request' is set
|
|
287
|
+
if @api_client.config.client_side_validation && invite_end_user_request.nil?
|
|
288
|
+
fail ArgumentError, "Missing the required parameter 'invite_end_user_request' when calling AuthUserDirectoryApi.invite_end_user"
|
|
289
|
+
end
|
|
290
|
+
# resource path
|
|
291
|
+
local_var_path = '/auth/users/invite'
|
|
292
|
+
|
|
293
|
+
# query parameters
|
|
294
|
+
query_params = opts[:query_params] || {}
|
|
295
|
+
|
|
296
|
+
# header parameters
|
|
297
|
+
header_params = opts[:header_params] || {}
|
|
298
|
+
# HTTP header 'Content-Type'
|
|
299
|
+
content_type = @api_client.select_header_content_type(['application/json'])
|
|
300
|
+
if !content_type.nil?
|
|
301
|
+
header_params['Content-Type'] = content_type
|
|
302
|
+
end
|
|
303
|
+
|
|
304
|
+
# form parameters
|
|
305
|
+
form_params = opts[:form_params] || {}
|
|
306
|
+
|
|
307
|
+
# http body (model)
|
|
308
|
+
post_body = opts[:debug_body] || @api_client.object_to_http_body(invite_end_user_request)
|
|
309
|
+
|
|
310
|
+
# return_type
|
|
311
|
+
return_type = opts[:debug_return_type]
|
|
312
|
+
|
|
313
|
+
# auth_names
|
|
314
|
+
auth_names = opts[:debug_auth_names] || ['ApplicationSecret', 'ApplicationPublicKey']
|
|
315
|
+
|
|
316
|
+
new_options = opts.merge(
|
|
317
|
+
:operation => :"AuthUserDirectoryApi.invite_end_user",
|
|
318
|
+
:header_params => header_params,
|
|
319
|
+
:query_params => query_params,
|
|
320
|
+
:form_params => form_params,
|
|
321
|
+
:body => post_body,
|
|
322
|
+
:auth_names => auth_names,
|
|
323
|
+
:return_type => return_type
|
|
324
|
+
)
|
|
325
|
+
|
|
326
|
+
data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
|
|
327
|
+
if @api_client.config.debugging
|
|
328
|
+
@api_client.config.logger.debug "API called: AuthUserDirectoryApi#invite_end_user\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
329
|
+
end
|
|
330
|
+
return data, status_code, headers
|
|
331
|
+
end
|
|
332
|
+
|
|
333
|
+
# List / search end users (server-side admin)
|
|
334
|
+
# 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.
|
|
335
|
+
# @param [Hash] opts the optional parameters
|
|
336
|
+
# @option opts [Integer] :page (default to 1)
|
|
337
|
+
# @option opts [Integer] :per_page (default to 20)
|
|
338
|
+
# @option opts [String] :search Substring match against email, name, or phone number.
|
|
339
|
+
# @option opts [String] :environment
|
|
340
|
+
# @return [nil]
|
|
341
|
+
def list_end_users(opts = {})
|
|
342
|
+
list_end_users_with_http_info(opts)
|
|
343
|
+
nil
|
|
344
|
+
end
|
|
345
|
+
|
|
346
|
+
# List / search end users (server-side admin)
|
|
347
|
+
# 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.
|
|
348
|
+
# @param [Hash] opts the optional parameters
|
|
349
|
+
# @option opts [Integer] :page (default to 1)
|
|
350
|
+
# @option opts [Integer] :per_page (default to 20)
|
|
351
|
+
# @option opts [String] :search Substring match against email, name, or phone number.
|
|
352
|
+
# @option opts [String] :environment
|
|
353
|
+
# @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers
|
|
354
|
+
def list_end_users_with_http_info(opts = {})
|
|
355
|
+
if @api_client.config.debugging
|
|
356
|
+
@api_client.config.logger.debug 'Calling API: AuthUserDirectoryApi.list_end_users ...'
|
|
357
|
+
end
|
|
358
|
+
if @api_client.config.client_side_validation && !opts[:'page'].nil? && opts[:'page'] < 1
|
|
359
|
+
fail ArgumentError, 'invalid value for "opts[:"page"]" when calling AuthUserDirectoryApi.list_end_users, must be greater than or equal to 1.'
|
|
360
|
+
end
|
|
361
|
+
|
|
362
|
+
if @api_client.config.client_side_validation && !opts[:'per_page'].nil? && opts[:'per_page'] > 100
|
|
363
|
+
fail ArgumentError, 'invalid value for "opts[:"per_page"]" when calling AuthUserDirectoryApi.list_end_users, must be smaller than or equal to 100.'
|
|
364
|
+
end
|
|
365
|
+
|
|
366
|
+
if @api_client.config.client_side_validation && !opts[:'per_page'].nil? && opts[:'per_page'] < 1
|
|
367
|
+
fail ArgumentError, 'invalid value for "opts[:"per_page"]" when calling AuthUserDirectoryApi.list_end_users, must be greater than or equal to 1.'
|
|
368
|
+
end
|
|
369
|
+
|
|
370
|
+
allowable_values = ["test", "live"]
|
|
371
|
+
if @api_client.config.client_side_validation && opts[:'environment'] && !allowable_values.include?(opts[:'environment'])
|
|
372
|
+
fail ArgumentError, "invalid value for \"environment\", must be one of #{allowable_values}"
|
|
373
|
+
end
|
|
374
|
+
# resource path
|
|
375
|
+
local_var_path = '/auth/users'
|
|
376
|
+
|
|
377
|
+
# query parameters
|
|
378
|
+
query_params = opts[:query_params] || {}
|
|
379
|
+
query_params[:'page'] = opts[:'page'] if !opts[:'page'].nil?
|
|
380
|
+
query_params[:'per_page'] = opts[:'per_page'] if !opts[:'per_page'].nil?
|
|
381
|
+
query_params[:'search'] = opts[:'search'] if !opts[:'search'].nil?
|
|
382
|
+
query_params[:'environment'] = opts[:'environment'] if !opts[:'environment'].nil?
|
|
383
|
+
|
|
384
|
+
# header parameters
|
|
385
|
+
header_params = opts[:header_params] || {}
|
|
386
|
+
|
|
387
|
+
# form parameters
|
|
388
|
+
form_params = opts[:form_params] || {}
|
|
389
|
+
|
|
390
|
+
# http body (model)
|
|
391
|
+
post_body = opts[:debug_body]
|
|
392
|
+
|
|
393
|
+
# return_type
|
|
394
|
+
return_type = opts[:debug_return_type]
|
|
395
|
+
|
|
396
|
+
# auth_names
|
|
397
|
+
auth_names = opts[:debug_auth_names] || ['ApplicationSecret', 'ApplicationPublicKey']
|
|
398
|
+
|
|
399
|
+
new_options = opts.merge(
|
|
400
|
+
:operation => :"AuthUserDirectoryApi.list_end_users",
|
|
401
|
+
:header_params => header_params,
|
|
402
|
+
:query_params => query_params,
|
|
403
|
+
:form_params => form_params,
|
|
404
|
+
:body => post_body,
|
|
405
|
+
:auth_names => auth_names,
|
|
406
|
+
:return_type => return_type
|
|
407
|
+
)
|
|
408
|
+
|
|
409
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
|
|
410
|
+
if @api_client.config.debugging
|
|
411
|
+
@api_client.config.logger.debug "API called: AuthUserDirectoryApi#list_end_users\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
412
|
+
end
|
|
413
|
+
return data, status_code, headers
|
|
414
|
+
end
|
|
415
|
+
|
|
416
|
+
# Set an end user's stored custom claims (server-side admin)
|
|
417
|
+
# 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.
|
|
418
|
+
# @param user_id [String]
|
|
419
|
+
# @param set_end_user_claims_request [SetEndUserClaimsRequest]
|
|
420
|
+
# @param [Hash] opts the optional parameters
|
|
421
|
+
# @return [nil]
|
|
422
|
+
def set_end_user_claims(user_id, set_end_user_claims_request, opts = {})
|
|
423
|
+
set_end_user_claims_with_http_info(user_id, set_end_user_claims_request, opts)
|
|
424
|
+
nil
|
|
425
|
+
end
|
|
426
|
+
|
|
427
|
+
# Set an end user's stored custom claims (server-side admin)
|
|
428
|
+
# 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.
|
|
429
|
+
# @param user_id [String]
|
|
430
|
+
# @param set_end_user_claims_request [SetEndUserClaimsRequest]
|
|
431
|
+
# @param [Hash] opts the optional parameters
|
|
432
|
+
# @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers
|
|
433
|
+
def set_end_user_claims_with_http_info(user_id, set_end_user_claims_request, opts = {})
|
|
434
|
+
if @api_client.config.debugging
|
|
435
|
+
@api_client.config.logger.debug 'Calling API: AuthUserDirectoryApi.set_end_user_claims ...'
|
|
436
|
+
end
|
|
437
|
+
# verify the required parameter 'user_id' is set
|
|
438
|
+
if @api_client.config.client_side_validation && user_id.nil?
|
|
439
|
+
fail ArgumentError, "Missing the required parameter 'user_id' when calling AuthUserDirectoryApi.set_end_user_claims"
|
|
440
|
+
end
|
|
441
|
+
# verify the required parameter 'set_end_user_claims_request' is set
|
|
442
|
+
if @api_client.config.client_side_validation && set_end_user_claims_request.nil?
|
|
443
|
+
fail ArgumentError, "Missing the required parameter 'set_end_user_claims_request' when calling AuthUserDirectoryApi.set_end_user_claims"
|
|
444
|
+
end
|
|
445
|
+
# resource path
|
|
446
|
+
local_var_path = '/auth/users/{user_id}/claims'.sub('{' + 'user_id' + '}', CGI.escape(user_id.to_s))
|
|
447
|
+
|
|
448
|
+
# query parameters
|
|
449
|
+
query_params = opts[:query_params] || {}
|
|
450
|
+
|
|
451
|
+
# header parameters
|
|
452
|
+
header_params = opts[:header_params] || {}
|
|
453
|
+
# HTTP header 'Content-Type'
|
|
454
|
+
content_type = @api_client.select_header_content_type(['application/json'])
|
|
455
|
+
if !content_type.nil?
|
|
456
|
+
header_params['Content-Type'] = content_type
|
|
457
|
+
end
|
|
458
|
+
|
|
459
|
+
# form parameters
|
|
460
|
+
form_params = opts[:form_params] || {}
|
|
461
|
+
|
|
462
|
+
# http body (model)
|
|
463
|
+
post_body = opts[:debug_body] || @api_client.object_to_http_body(set_end_user_claims_request)
|
|
464
|
+
|
|
465
|
+
# return_type
|
|
466
|
+
return_type = opts[:debug_return_type]
|
|
467
|
+
|
|
468
|
+
# auth_names
|
|
469
|
+
auth_names = opts[:debug_auth_names] || ['ApplicationSecret', 'ApplicationPublicKey']
|
|
470
|
+
|
|
471
|
+
new_options = opts.merge(
|
|
472
|
+
:operation => :"AuthUserDirectoryApi.set_end_user_claims",
|
|
473
|
+
:header_params => header_params,
|
|
474
|
+
:query_params => query_params,
|
|
475
|
+
:form_params => form_params,
|
|
476
|
+
:body => post_body,
|
|
477
|
+
:auth_names => auth_names,
|
|
478
|
+
:return_type => return_type
|
|
479
|
+
)
|
|
480
|
+
|
|
481
|
+
data, status_code, headers = @api_client.call_api(:PUT, local_var_path, new_options)
|
|
482
|
+
if @api_client.config.debugging
|
|
483
|
+
@api_client.config.logger.debug "API called: AuthUserDirectoryApi#set_end_user_claims\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
484
|
+
end
|
|
485
|
+
return data, status_code, headers
|
|
486
|
+
end
|
|
487
|
+
|
|
488
|
+
# Update an end user (server-side admin)
|
|
489
|
+
# 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.
|
|
490
|
+
# @param user_id [String]
|
|
491
|
+
# @param update_end_user_by_application_request [UpdateEndUserByApplicationRequest]
|
|
492
|
+
# @param [Hash] opts the optional parameters
|
|
493
|
+
# @return [nil]
|
|
494
|
+
def update_end_user_by_application(user_id, update_end_user_by_application_request, opts = {})
|
|
495
|
+
update_end_user_by_application_with_http_info(user_id, update_end_user_by_application_request, opts)
|
|
496
|
+
nil
|
|
497
|
+
end
|
|
498
|
+
|
|
499
|
+
# Update an end user (server-side admin)
|
|
500
|
+
# 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.
|
|
501
|
+
# @param user_id [String]
|
|
502
|
+
# @param update_end_user_by_application_request [UpdateEndUserByApplicationRequest]
|
|
503
|
+
# @param [Hash] opts the optional parameters
|
|
504
|
+
# @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers
|
|
505
|
+
def update_end_user_by_application_with_http_info(user_id, update_end_user_by_application_request, opts = {})
|
|
506
|
+
if @api_client.config.debugging
|
|
507
|
+
@api_client.config.logger.debug 'Calling API: AuthUserDirectoryApi.update_end_user_by_application ...'
|
|
508
|
+
end
|
|
509
|
+
# verify the required parameter 'user_id' is set
|
|
510
|
+
if @api_client.config.client_side_validation && user_id.nil?
|
|
511
|
+
fail ArgumentError, "Missing the required parameter 'user_id' when calling AuthUserDirectoryApi.update_end_user_by_application"
|
|
512
|
+
end
|
|
513
|
+
# verify the required parameter 'update_end_user_by_application_request' is set
|
|
514
|
+
if @api_client.config.client_side_validation && update_end_user_by_application_request.nil?
|
|
515
|
+
fail ArgumentError, "Missing the required parameter 'update_end_user_by_application_request' when calling AuthUserDirectoryApi.update_end_user_by_application"
|
|
516
|
+
end
|
|
517
|
+
# resource path
|
|
518
|
+
local_var_path = '/auth/users/{user_id}'.sub('{' + 'user_id' + '}', CGI.escape(user_id.to_s))
|
|
519
|
+
|
|
520
|
+
# query parameters
|
|
521
|
+
query_params = opts[:query_params] || {}
|
|
522
|
+
|
|
523
|
+
# header parameters
|
|
524
|
+
header_params = opts[:header_params] || {}
|
|
525
|
+
# HTTP header 'Content-Type'
|
|
526
|
+
content_type = @api_client.select_header_content_type(['application/json'])
|
|
527
|
+
if !content_type.nil?
|
|
528
|
+
header_params['Content-Type'] = content_type
|
|
529
|
+
end
|
|
530
|
+
|
|
531
|
+
# form parameters
|
|
532
|
+
form_params = opts[:form_params] || {}
|
|
533
|
+
|
|
534
|
+
# http body (model)
|
|
535
|
+
post_body = opts[:debug_body] || @api_client.object_to_http_body(update_end_user_by_application_request)
|
|
536
|
+
|
|
537
|
+
# return_type
|
|
538
|
+
return_type = opts[:debug_return_type]
|
|
539
|
+
|
|
540
|
+
# auth_names
|
|
541
|
+
auth_names = opts[:debug_auth_names] || ['ApplicationSecret', 'ApplicationPublicKey']
|
|
542
|
+
|
|
543
|
+
new_options = opts.merge(
|
|
544
|
+
:operation => :"AuthUserDirectoryApi.update_end_user_by_application",
|
|
545
|
+
:header_params => header_params,
|
|
546
|
+
:query_params => query_params,
|
|
547
|
+
:form_params => form_params,
|
|
548
|
+
:body => post_body,
|
|
549
|
+
:auth_names => auth_names,
|
|
550
|
+
:return_type => return_type
|
|
551
|
+
)
|
|
552
|
+
|
|
553
|
+
data, status_code, headers = @api_client.call_api(:PATCH, local_var_path, new_options)
|
|
554
|
+
if @api_client.config.debugging
|
|
555
|
+
@api_client.config.logger.debug "API called: AuthUserDirectoryApi#update_end_user_by_application\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
556
|
+
end
|
|
557
|
+
return data, status_code, headers
|
|
558
|
+
end
|
|
559
|
+
end
|
|
560
|
+
end
|
|
@@ -76,67 +76,6 @@ module Zyphr
|
|
|
76
76
|
return data, status_code, headers
|
|
77
77
|
end
|
|
78
78
|
|
|
79
|
-
# Delete an end user (test environment only)
|
|
80
|
-
# App-credentialed soft-delete for an end user, scoped to the test environment only. Live-mode credentials receive 403 — this is the intentional safety guard against a misconfigured CI runner nuking production users. 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. Intended for smoke / test-fixture cleanup. Production deletes should continue to use `DELETE /auth/users/me` from the end-user's own session or the dashboard.
|
|
81
|
-
# @param user_id [String]
|
|
82
|
-
# @param [Hash] opts the optional parameters
|
|
83
|
-
# @return [nil]
|
|
84
|
-
def delete_end_user_by_application(user_id, opts = {})
|
|
85
|
-
delete_end_user_by_application_with_http_info(user_id, opts)
|
|
86
|
-
nil
|
|
87
|
-
end
|
|
88
|
-
|
|
89
|
-
# Delete an end user (test environment only)
|
|
90
|
-
# App-credentialed soft-delete for an end user, scoped to the test environment only. Live-mode credentials receive 403 — this is the intentional safety guard against a misconfigured CI runner nuking production users. 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. Intended for smoke / test-fixture cleanup. Production deletes should continue to use `DELETE /auth/users/me` from the end-user's own session or the dashboard.
|
|
91
|
-
# @param user_id [String]
|
|
92
|
-
# @param [Hash] opts the optional parameters
|
|
93
|
-
# @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers
|
|
94
|
-
def delete_end_user_by_application_with_http_info(user_id, opts = {})
|
|
95
|
-
if @api_client.config.debugging
|
|
96
|
-
@api_client.config.logger.debug 'Calling API: AuthUserProfileApi.delete_end_user_by_application ...'
|
|
97
|
-
end
|
|
98
|
-
# verify the required parameter 'user_id' is set
|
|
99
|
-
if @api_client.config.client_side_validation && user_id.nil?
|
|
100
|
-
fail ArgumentError, "Missing the required parameter 'user_id' when calling AuthUserProfileApi.delete_end_user_by_application"
|
|
101
|
-
end
|
|
102
|
-
# resource path
|
|
103
|
-
local_var_path = '/auth/users/{user_id}'.sub('{' + 'user_id' + '}', CGI.escape(user_id.to_s))
|
|
104
|
-
|
|
105
|
-
# query parameters
|
|
106
|
-
query_params = opts[:query_params] || {}
|
|
107
|
-
|
|
108
|
-
# header parameters
|
|
109
|
-
header_params = opts[:header_params] || {}
|
|
110
|
-
|
|
111
|
-
# form parameters
|
|
112
|
-
form_params = opts[:form_params] || {}
|
|
113
|
-
|
|
114
|
-
# http body (model)
|
|
115
|
-
post_body = opts[:debug_body]
|
|
116
|
-
|
|
117
|
-
# return_type
|
|
118
|
-
return_type = opts[:debug_return_type]
|
|
119
|
-
|
|
120
|
-
# auth_names
|
|
121
|
-
auth_names = opts[:debug_auth_names] || ['ApplicationSecret', 'ApplicationPublicKey']
|
|
122
|
-
|
|
123
|
-
new_options = opts.merge(
|
|
124
|
-
:operation => :"AuthUserProfileApi.delete_end_user_by_application",
|
|
125
|
-
:header_params => header_params,
|
|
126
|
-
:query_params => query_params,
|
|
127
|
-
:form_params => form_params,
|
|
128
|
-
:body => post_body,
|
|
129
|
-
:auth_names => auth_names,
|
|
130
|
-
:return_type => return_type
|
|
131
|
-
)
|
|
132
|
-
|
|
133
|
-
data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, new_options)
|
|
134
|
-
if @api_client.config.debugging
|
|
135
|
-
@api_client.config.logger.debug "API called: AuthUserProfileApi#delete_end_user_by_application\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
136
|
-
end
|
|
137
|
-
return data, status_code, headers
|
|
138
|
-
end
|
|
139
|
-
|
|
140
79
|
# Get current end user profile
|
|
141
80
|
# Retrieve the profile of the currently authenticated end user.
|
|
142
81
|
# @param [Hash] opts the optional parameters
|