zyphr 0.1.37 → 0.1.38

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.
Files changed (34) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +14 -1
  3. data/docs/AuthOAuthApi.md +12 -12
  4. data/docs/AuthRegistrationApi.md +73 -1
  5. data/docs/AuthUserDirectoryApi.md +627 -0
  6. data/docs/AuthUserProfileApi.md +0 -76
  7. data/docs/InviteEndUserRequest.md +26 -0
  8. data/docs/OAuthProviderName.md +15 -0
  9. data/docs/SetEndUserClaimsRequest.md +18 -0
  10. data/docs/SignInAnonymouslyRequest.md +5 -1
  11. data/docs/SignInWithGameCenterRequest.md +28 -0
  12. data/docs/UpdateEndUserByApplicationRequest.md +26 -0
  13. data/lib/zyphr/api/auth_o_auth_api.rb +12 -12
  14. data/lib/zyphr/api/auth_registration_api.rb +70 -2
  15. data/lib/zyphr/api/auth_user_directory_api.rb +560 -0
  16. data/lib/zyphr/api/auth_user_profile_api.rb +0 -61
  17. data/lib/zyphr/models/invite_end_user_request.rb +309 -0
  18. data/lib/zyphr/models/o_auth_provider_name.rb +43 -0
  19. data/lib/zyphr/models/set_end_user_claims_request.rb +220 -0
  20. data/lib/zyphr/models/sign_in_anonymously_request.rb +43 -4
  21. data/lib/zyphr/models/sign_in_with_game_center_request.rb +373 -0
  22. data/lib/zyphr/models/update_end_user_by_application_request.rb +256 -0
  23. data/lib/zyphr.rb +6 -0
  24. data/spec/api/auth_registration_api_spec.rb +13 -1
  25. data/spec/api/auth_user_directory_api_spec.rb +136 -0
  26. data/spec/api/auth_user_profile_api_spec.rb +0 -12
  27. data/spec/models/invite_end_user_request_spec.rb +64 -0
  28. data/spec/models/o_auth_provider_name_spec.rb +30 -0
  29. data/spec/models/set_end_user_claims_request_spec.rb +36 -0
  30. data/spec/models/sign_in_anonymously_request_spec.rb +12 -0
  31. data/spec/models/sign_in_with_game_center_request_spec.rb +66 -0
  32. data/spec/models/update_end_user_by_application_request_spec.rb +60 -0
  33. data/zyphr.gemspec +1 -1
  34. metadata +446 -422
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 7a8af3ccb76b2fc2b8a060f4bcbe89c657ffe808337851954f18d69b5fbed59f
4
- data.tar.gz: b937cbad16d57dacab5c7bf7181f6caf54ab7f1809aad982b616a9d6dc00ef2c
3
+ metadata.gz: 3e2ae10652d7fff4bb616e0c98878a12ae47ca169e92741c96f04843b3025fb7
4
+ data.tar.gz: 56d78709528a4cdd327d00a45abebf5323880b1d954a75034c60032b423677e5
5
5
  SHA512:
6
- metadata.gz: 5f91a3a85d3e759df5da2e9e061e46fd36160c5583350affdcfcfed524f77ba0f4016d0e50c3a8da9a50cda81a643ac931526ffb09e26617481f31f6181e1000
7
- data.tar.gz: 4481a5fa76675d2e3931faf8f6aef919f6d3be1139f40075e1a3199d6f6de4a458fa10cc6812c45de04c5c8ca7b7f26ce0ac31362ff830c1d01d8c57046eb5eb
6
+ metadata.gz: 8e014981ef77cb0084fee9465ad338fe3fa89009062fb83b7ee2fae91444b261ca5c432d837c78e20a3f43a341ca84909e46dd13dc27a9e5372dcdcb7944a2bb
7
+ data.tar.gz: a6b7a27531f5d750432cd33b364db234fd4687518b62683a09e553b323687ddb6d6aaedf4bbdd784c91826e86902e4274badb43d6888a78a8a8e53ab058a0562
data/README.md CHANGED
@@ -188,12 +188,20 @@ Class | Method | HTTP request | Description
188
188
  *Zyphr::AuthRegistrationApi* | [**convert_anonymous_user**](docs/AuthRegistrationApi.md#convert_anonymous_user) | **POST** /auth/users/convert | Convert anonymous account to a full account
189
189
  *Zyphr::AuthRegistrationApi* | [**register_end_user**](docs/AuthRegistrationApi.md#register_end_user) | **POST** /auth/users/register | Register a new end user
190
190
  *Zyphr::AuthRegistrationApi* | [**sign_in_anonymously**](docs/AuthRegistrationApi.md#sign_in_anonymously) | **POST** /auth/users/anonymous | Sign in anonymously
191
+ *Zyphr::AuthRegistrationApi* | [**sign_in_with_game_center**](docs/AuthRegistrationApi.md#sign_in_with_game_center) | **POST** /auth/game-center | Sign in with Apple Game Center
191
192
  *Zyphr::AuthSessionsApi* | [**list_end_user_sessions**](docs/AuthSessionsApi.md#list_end_user_sessions) | **GET** /auth/sessions | List active sessions
192
193
  *Zyphr::AuthSessionsApi* | [**refresh_end_user_token**](docs/AuthSessionsApi.md#refresh_end_user_token) | **POST** /auth/sessions/refresh | Refresh access token
193
194
  *Zyphr::AuthSessionsApi* | [**revoke_all_end_user_sessions**](docs/AuthSessionsApi.md#revoke_all_end_user_sessions) | **POST** /auth/sessions/revoke-all | Revoke all sessions
194
195
  *Zyphr::AuthSessionsApi* | [**revoke_end_user_session**](docs/AuthSessionsApi.md#revoke_end_user_session) | **POST** /auth/sessions/revoke | Revoke a session
196
+ *Zyphr::AuthUserDirectoryApi* | [**delete_end_user_by_application**](docs/AuthUserDirectoryApi.md#delete_end_user_by_application) | **DELETE** /auth/users/{user_id} | Delete an end user (server-side admin)
197
+ *Zyphr::AuthUserDirectoryApi* | [**get_end_user_by_email**](docs/AuthUserDirectoryApi.md#get_end_user_by_email) | **GET** /auth/users/by-email | Look up an end user by email (server-side admin)
198
+ *Zyphr::AuthUserDirectoryApi* | [**get_end_user_by_id**](docs/AuthUserDirectoryApi.md#get_end_user_by_id) | **GET** /auth/users/{user_id} | Get an end user by id (server-side admin)
199
+ *Zyphr::AuthUserDirectoryApi* | [**get_end_user_claims**](docs/AuthUserDirectoryApi.md#get_end_user_claims) | **GET** /auth/users/{user_id}/claims | Get an end user's stored custom claims (server-side admin)
200
+ *Zyphr::AuthUserDirectoryApi* | [**invite_end_user**](docs/AuthUserDirectoryApi.md#invite_end_user) | **POST** /auth/users/invite | Pre-provision (invite) an end user (server-side admin)
201
+ *Zyphr::AuthUserDirectoryApi* | [**list_end_users**](docs/AuthUserDirectoryApi.md#list_end_users) | **GET** /auth/users | List / search end users (server-side admin)
202
+ *Zyphr::AuthUserDirectoryApi* | [**set_end_user_claims**](docs/AuthUserDirectoryApi.md#set_end_user_claims) | **PUT** /auth/users/{user_id}/claims | Set an end user's stored custom claims (server-side admin)
203
+ *Zyphr::AuthUserDirectoryApi* | [**update_end_user_by_application**](docs/AuthUserDirectoryApi.md#update_end_user_by_application) | **PATCH** /auth/users/{user_id} | Update an end user (server-side admin)
195
204
  *Zyphr::AuthUserProfileApi* | [**delete_end_user**](docs/AuthUserProfileApi.md#delete_end_user) | **DELETE** /auth/users/me | Delete current end user account
196
- *Zyphr::AuthUserProfileApi* | [**delete_end_user_by_application**](docs/AuthUserProfileApi.md#delete_end_user_by_application) | **DELETE** /auth/users/{user_id} | Delete an end user (test environment only)
197
205
  *Zyphr::AuthUserProfileApi* | [**get_end_user**](docs/AuthUserProfileApi.md#get_end_user) | **GET** /auth/users/me | Get current end user profile
198
206
  *Zyphr::AuthUserProfileApi* | [**update_end_user**](docs/AuthUserProfileApi.md#update_end_user) | **PATCH** /auth/users/me | Update current end user profile
199
207
  *Zyphr::AuthWebAuthnApi* | [**delete_web_authn_credential**](docs/AuthWebAuthnApi.md#delete_web_authn_credential) | **DELETE** /auth/webauthn/credentials/{id} | Delete a WebAuthn credential
@@ -500,6 +508,7 @@ Class | Method | HTTP request | Description
500
508
  - [Zyphr::InboxListMeta](docs/InboxListMeta.md)
501
509
  - [Zyphr::InboxListResponse](docs/InboxListResponse.md)
502
510
  - [Zyphr::InboxNotificationResponse](docs/InboxNotificationResponse.md)
511
+ - [Zyphr::InviteEndUserRequest](docs/InviteEndUserRequest.md)
503
512
  - [Zyphr::ListWaaSApplications200Response](docs/ListWaaSApplications200Response.md)
504
513
  - [Zyphr::ListWaaSEndpointDeliveries200Response](docs/ListWaaSEndpointDeliveries200Response.md)
505
514
  - [Zyphr::ListWaaSEndpoints200Response](docs/ListWaaSEndpoints200Response.md)
@@ -544,6 +553,7 @@ Class | Method | HTTP request | Description
544
553
  - [Zyphr::OAuthConnectionsResponseData](docs/OAuthConnectionsResponseData.md)
545
554
  - [Zyphr::OAuthProvider](docs/OAuthProvider.md)
546
555
  - [Zyphr::OAuthProviderInfo](docs/OAuthProviderInfo.md)
556
+ - [Zyphr::OAuthProviderName](docs/OAuthProviderName.md)
547
557
  - [Zyphr::OAuthProvidersResponse](docs/OAuthProvidersResponse.md)
548
558
  - [Zyphr::OAuthProvidersResponseData](docs/OAuthProvidersResponseData.md)
549
559
  - [Zyphr::OAuthTokensRefreshResponse](docs/OAuthTokensRefreshResponse.md)
@@ -647,9 +657,11 @@ Class | Method | HTTP request | Description
647
657
  - [Zyphr::SessionListResponseData](docs/SessionListResponseData.md)
648
658
  - [Zyphr::SessionListResponseDataSessionInfo](docs/SessionListResponseDataSessionInfo.md)
649
659
  - [Zyphr::SetDomainInboundRequest](docs/SetDomainInboundRequest.md)
660
+ - [Zyphr::SetEndUserClaimsRequest](docs/SetEndUserClaimsRequest.md)
650
661
  - [Zyphr::SetPreferencesRequest](docs/SetPreferencesRequest.md)
651
662
  - [Zyphr::SetPreferencesRequestPreferencesInner](docs/SetPreferencesRequestPreferencesInner.md)
652
663
  - [Zyphr::SignInAnonymouslyRequest](docs/SignInAnonymouslyRequest.md)
664
+ - [Zyphr::SignInWithGameCenterRequest](docs/SignInWithGameCenterRequest.md)
653
665
  - [Zyphr::SlackMessage](docs/SlackMessage.md)
654
666
  - [Zyphr::SlackMessageListResponse](docs/SlackMessageListResponse.md)
655
667
  - [Zyphr::SlackMessageListResponseMeta](docs/SlackMessageListResponseMeta.md)
@@ -705,6 +717,7 @@ Class | Method | HTTP request | Description
705
717
  - [Zyphr::UnsubscribeRequest](docs/UnsubscribeRequest.md)
706
718
  - [Zyphr::UnsubscribeResponse](docs/UnsubscribeResponse.md)
707
719
  - [Zyphr::UpdateCategoryRequest](docs/UpdateCategoryRequest.md)
720
+ - [Zyphr::UpdateEndUserByApplicationRequest](docs/UpdateEndUserByApplicationRequest.md)
708
721
  - [Zyphr::UpdateEndUserRequest](docs/UpdateEndUserRequest.md)
709
722
  - [Zyphr::UpdateOrganizationMemberRoleRequest](docs/UpdateOrganizationMemberRoleRequest.md)
710
723
  - [Zyphr::UpdateOrganizationRequest](docs/UpdateOrganizationRequest.md)
data/docs/AuthOAuthApi.md CHANGED
@@ -39,7 +39,7 @@ Zyphr.configure do |config|
39
39
  end
40
40
 
41
41
  api_instance = Zyphr::AuthOAuthApi.new
42
- provider = 'provider_example' # String | OAuth provider name
42
+ provider = Zyphr::OAuthProviderName::GOOGLE # OAuthProviderName | OAuth provider name
43
43
 
44
44
  begin
45
45
  # Disconnect OAuth provider
@@ -72,7 +72,7 @@ end
72
72
 
73
73
  | Name | Type | Description | Notes |
74
74
  | ---- | ---- | ----------- | ----- |
75
- | **provider** | **String** | OAuth provider name | |
75
+ | **provider** | [**OAuthProviderName**](.md) | OAuth provider name | |
76
76
 
77
77
  ### Return type
78
78
 
@@ -110,7 +110,7 @@ Zyphr.configure do |config|
110
110
  end
111
111
 
112
112
  api_instance = Zyphr::AuthOAuthApi.new
113
- provider = 'provider_example' # String | OAuth provider name
113
+ provider = Zyphr::OAuthProviderName::GOOGLE # OAuthProviderName | OAuth provider name
114
114
  redirect_uri = 'redirect_uri_example' # String | Redirect URI after authorization
115
115
 
116
116
  begin
@@ -144,7 +144,7 @@ end
144
144
 
145
145
  | Name | Type | Description | Notes |
146
146
  | ---- | ---- | ----------- | ----- |
147
- | **provider** | **String** | OAuth provider name | |
147
+ | **provider** | [**OAuthProviderName**](.md) | OAuth provider name | |
148
148
  | **redirect_uri** | **String** | Redirect URI after authorization | |
149
149
 
150
150
  ### Return type
@@ -186,7 +186,7 @@ Zyphr.configure do |config|
186
186
  end
187
187
 
188
188
  api_instance = Zyphr::AuthOAuthApi.new
189
- provider = 'provider_example' # String | OAuth provider name
189
+ provider = Zyphr::OAuthProviderName::GOOGLE # OAuthProviderName | OAuth provider name
190
190
 
191
191
  begin
192
192
  # Get OAuth connection info
@@ -219,7 +219,7 @@ end
219
219
 
220
220
  | Name | Type | Description | Notes |
221
221
  | ---- | ---- | ----------- | ----- |
222
- | **provider** | **String** | OAuth provider name | |
222
+ | **provider** | [**OAuthProviderName**](.md) | OAuth provider name | |
223
223
 
224
224
  ### Return type
225
225
 
@@ -262,7 +262,7 @@ Zyphr.configure do |config|
262
262
  end
263
263
 
264
264
  api_instance = Zyphr::AuthOAuthApi.new
265
- provider = 'provider_example' # String | OAuth provider name
265
+ provider = Zyphr::OAuthProviderName::GOOGLE # OAuthProviderName | OAuth provider name
266
266
  user_id = 'user_id_example' # String | End user ID
267
267
 
268
268
  begin
@@ -296,7 +296,7 @@ end
296
296
 
297
297
  | Name | Type | Description | Notes |
298
298
  | ---- | ---- | ----------- | ----- |
299
- | **provider** | **String** | OAuth provider name | |
299
+ | **provider** | [**OAuthProviderName**](.md) | OAuth provider name | |
300
300
  | **user_id** | **String** | End user ID | |
301
301
 
302
302
  ### Return type
@@ -328,7 +328,7 @@ require 'time'
328
328
  require 'zyphr'
329
329
 
330
330
  api_instance = Zyphr::AuthOAuthApi.new
331
- provider = 'provider_example' # String | OAuth provider name
331
+ provider = Zyphr::OAuthProviderName::GOOGLE # OAuthProviderName | OAuth provider name
332
332
  o_auth_callback_request = Zyphr::OAuthCallbackRequest.new({code: 'code_example', state: 'state_example'}) # OAuthCallbackRequest |
333
333
 
334
334
  begin
@@ -362,7 +362,7 @@ end
362
362
 
363
363
  | Name | Type | Description | Notes |
364
364
  | ---- | ---- | ----------- | ----- |
365
- | **provider** | **String** | OAuth provider name | |
365
+ | **provider** | [**OAuthProviderName**](.md) | OAuth provider name | |
366
366
  | **o_auth_callback_request** | [**OAuthCallbackRequest**](OAuthCallbackRequest.md) | | |
367
367
 
368
368
  ### Return type
@@ -545,7 +545,7 @@ Zyphr.configure do |config|
545
545
  end
546
546
 
547
547
  api_instance = Zyphr::AuthOAuthApi.new
548
- provider = 'provider_example' # String | OAuth provider name
548
+ provider = Zyphr::OAuthProviderName::GOOGLE # OAuthProviderName | OAuth provider name
549
549
  refresh_o_auth_tokens_request = Zyphr::RefreshOAuthTokensRequest.new({user_id: 'user_id_example'}) # RefreshOAuthTokensRequest |
550
550
 
551
551
  begin
@@ -579,7 +579,7 @@ end
579
579
 
580
580
  | Name | Type | Description | Notes |
581
581
  | ---- | ---- | ----------- | ----- |
582
- | **provider** | **String** | OAuth provider name | |
582
+ | **provider** | [**OAuthProviderName**](.md) | OAuth provider name | |
583
583
  | **refresh_o_auth_tokens_request** | [**RefreshOAuthTokensRequest**](RefreshOAuthTokensRequest.md) | | |
584
584
 
585
585
  ### Return type
@@ -7,6 +7,7 @@ All URIs are relative to *https://api.zyphr.dev/v1*
7
7
  | [**convert_anonymous_user**](AuthRegistrationApi.md#convert_anonymous_user) | **POST** /auth/users/convert | Convert anonymous account to a full account |
8
8
  | [**register_end_user**](AuthRegistrationApi.md#register_end_user) | **POST** /auth/users/register | Register a new end user |
9
9
  | [**sign_in_anonymously**](AuthRegistrationApi.md#sign_in_anonymously) | **POST** /auth/users/anonymous | Sign in anonymously |
10
+ | [**sign_in_with_game_center**](AuthRegistrationApi.md#sign_in_with_game_center) | **POST** /auth/game-center | Sign in with Apple Game Center |
10
11
 
11
12
 
12
13
  ## convert_anonymous_user
@@ -155,7 +156,7 @@ end
155
156
 
156
157
  Sign in anonymously
157
158
 
158
- Issue an end-user identity to a device without email, password, OAuth, or any other credential. Idempotent per (application, environment, device_id): repeated calls with the same device_id return the same user but a fresh token pair. Prior sessions for the user remain valid until natural expiry. Anonymous users do not count toward MAU quota until their first authenticated request after sign-in (excluding /v1/auth/refresh). Convert an anonymous user to a full account via POST /v1/auth/users/convert.
159
+ Issue an end-user identity to a device without email, password, OAuth, or any other credential. Idempotent per (application, environment, device_id): repeated calls with the same device_id return the same user but a fresh token pair. Prior sessions for the user remain valid until natural expiry. Anonymous users do not count toward MAU quota until their first authenticated request after sign-in (excluding /v1/auth/refresh). Convert an anonymous user to a full account via POST /v1/auth/users/convert. Pass an optional `organization_id` to create the anonymous user directly in an organization; the returned access token then carries `org_id` (and `orgs`), matching the org-scoped register/login flow.
159
160
 
160
161
  ### Examples
161
162
 
@@ -219,3 +220,74 @@ end
219
220
  - **Content-Type**: application/json
220
221
  - **Accept**: application/json
221
222
 
223
+
224
+ ## sign_in_with_game_center
225
+
226
+ > <AuthResultResponse> sign_in_with_game_center(sign_in_with_game_center_request)
227
+
228
+ Sign in with Apple Game Center
229
+
230
+ Exchange an Apple Game Center identity-verification assertion for a Zyphr end-user session. Zyphr independently re-verifies the assertion server-side (Apple certificate chain, RSA-SHA256 signature, timestamp freshness, single-use replay guard, and bundle-id binding) before provisioning-or-looking-up the user and minting tokens. The user is keyed on the modern scoped `playerId` (gamePlayerID). ## Producing the assertion (Integration) The assertion is produced **on-device by the iOS app** — there is no server-side way to mint it. The app calls GameKit's `GKLocalPlayer.fetchItems(forIdentityVerificationSignature:)`, which returns `publicKeyURL`, `signature`, `salt`, and `timestamp`; combine those with the local player's `gamePlayerID` and the app's bundle identifier and submit them here. Two integration shapes are supported: - **client-direct** — the iOS app holds the Zyphr application public key and calls this endpoint itself. - **backend-relayed** — the app forwards the fetched assertion fields to the customer's own backend, which relays them to this endpoint; the app never holds Zyphr keys. (This is the common shape for games.) On any verification failure the response is a single opaque `401` `invalid_assertion` — the specific control that failed is never disclosed.
231
+
232
+ ### Examples
233
+
234
+ ```ruby
235
+ require 'time'
236
+ require 'zyphr'
237
+ # setup authorization
238
+ Zyphr.configure do |config|
239
+ # Configure API key authorization: ApplicationPublicKey
240
+ config.api_key['X-Application-Key'] = 'YOUR API KEY'
241
+ # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
242
+ # config.api_key_prefix['X-Application-Key'] = 'Bearer'
243
+ end
244
+
245
+ api_instance = Zyphr::AuthRegistrationApi.new
246
+ sign_in_with_game_center_request = Zyphr::SignInWithGameCenterRequest.new({player_id: 'player_id_example', public_key_url: 'public_key_url_example', signature: 'signature_example', salt: 'salt_example', timestamp: 3.56, bundle_id: 'bundle_id_example'}) # SignInWithGameCenterRequest |
247
+
248
+ begin
249
+ # Sign in with Apple Game Center
250
+ result = api_instance.sign_in_with_game_center(sign_in_with_game_center_request)
251
+ p result
252
+ rescue Zyphr::ApiError => e
253
+ puts "Error when calling AuthRegistrationApi->sign_in_with_game_center: #{e}"
254
+ end
255
+ ```
256
+
257
+ #### Using the sign_in_with_game_center_with_http_info variant
258
+
259
+ This returns an Array which contains the response data, status code and headers.
260
+
261
+ > <Array(<AuthResultResponse>, Integer, Hash)> sign_in_with_game_center_with_http_info(sign_in_with_game_center_request)
262
+
263
+ ```ruby
264
+ begin
265
+ # Sign in with Apple Game Center
266
+ data, status_code, headers = api_instance.sign_in_with_game_center_with_http_info(sign_in_with_game_center_request)
267
+ p status_code # => 2xx
268
+ p headers # => { ... }
269
+ p data # => <AuthResultResponse>
270
+ rescue Zyphr::ApiError => e
271
+ puts "Error when calling AuthRegistrationApi->sign_in_with_game_center_with_http_info: #{e}"
272
+ end
273
+ ```
274
+
275
+ ### Parameters
276
+
277
+ | Name | Type | Description | Notes |
278
+ | ---- | ---- | ----------- | ----- |
279
+ | **sign_in_with_game_center_request** | [**SignInWithGameCenterRequest**](SignInWithGameCenterRequest.md) | | |
280
+
281
+ ### Return type
282
+
283
+ [**AuthResultResponse**](AuthResultResponse.md)
284
+
285
+ ### Authorization
286
+
287
+ [ApplicationPublicKey](../README.md#ApplicationPublicKey)
288
+
289
+ ### HTTP request headers
290
+
291
+ - **Content-Type**: application/json
292
+ - **Accept**: application/json
293
+