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,256 @@
|
|
|
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 'date'
|
|
14
|
+
require 'time'
|
|
15
|
+
|
|
16
|
+
module Zyphr
|
|
17
|
+
class UpdateEndUserByApplicationRequest
|
|
18
|
+
attr_accessor :email
|
|
19
|
+
|
|
20
|
+
attr_accessor :name
|
|
21
|
+
|
|
22
|
+
attr_accessor :avatar_url
|
|
23
|
+
|
|
24
|
+
attr_accessor :metadata
|
|
25
|
+
|
|
26
|
+
attr_accessor :status
|
|
27
|
+
|
|
28
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
|
29
|
+
def self.attribute_map
|
|
30
|
+
{
|
|
31
|
+
:'email' => :'email',
|
|
32
|
+
:'name' => :'name',
|
|
33
|
+
:'avatar_url' => :'avatar_url',
|
|
34
|
+
:'metadata' => :'metadata',
|
|
35
|
+
:'status' => :'status'
|
|
36
|
+
}
|
|
37
|
+
end
|
|
38
|
+
|
|
39
|
+
# Returns attribute mapping this model knows about
|
|
40
|
+
def self.acceptable_attribute_map
|
|
41
|
+
attribute_map
|
|
42
|
+
end
|
|
43
|
+
|
|
44
|
+
# Returns all the JSON keys this model knows about
|
|
45
|
+
def self.acceptable_attributes
|
|
46
|
+
acceptable_attribute_map.values
|
|
47
|
+
end
|
|
48
|
+
|
|
49
|
+
# Attribute type mapping.
|
|
50
|
+
def self.openapi_types
|
|
51
|
+
{
|
|
52
|
+
:'email' => :'String',
|
|
53
|
+
:'name' => :'String',
|
|
54
|
+
:'avatar_url' => :'String',
|
|
55
|
+
:'metadata' => :'Object',
|
|
56
|
+
:'status' => :'String'
|
|
57
|
+
}
|
|
58
|
+
end
|
|
59
|
+
|
|
60
|
+
# List of attributes with nullable: true
|
|
61
|
+
def self.openapi_nullable
|
|
62
|
+
Set.new([
|
|
63
|
+
])
|
|
64
|
+
end
|
|
65
|
+
|
|
66
|
+
# Initializes the object
|
|
67
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
68
|
+
def initialize(attributes = {})
|
|
69
|
+
if (!attributes.is_a?(Hash))
|
|
70
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `Zyphr::UpdateEndUserByApplicationRequest` initialize method"
|
|
71
|
+
end
|
|
72
|
+
|
|
73
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
|
74
|
+
acceptable_attribute_map = self.class.acceptable_attribute_map
|
|
75
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
|
76
|
+
if (!acceptable_attribute_map.key?(k.to_sym))
|
|
77
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `Zyphr::UpdateEndUserByApplicationRequest`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
|
|
78
|
+
end
|
|
79
|
+
h[k.to_sym] = v
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
if attributes.key?(:'email')
|
|
83
|
+
self.email = attributes[:'email']
|
|
84
|
+
end
|
|
85
|
+
|
|
86
|
+
if attributes.key?(:'name')
|
|
87
|
+
self.name = attributes[:'name']
|
|
88
|
+
end
|
|
89
|
+
|
|
90
|
+
if attributes.key?(:'avatar_url')
|
|
91
|
+
self.avatar_url = attributes[:'avatar_url']
|
|
92
|
+
end
|
|
93
|
+
|
|
94
|
+
if attributes.key?(:'metadata')
|
|
95
|
+
self.metadata = attributes[:'metadata']
|
|
96
|
+
end
|
|
97
|
+
|
|
98
|
+
if attributes.key?(:'status')
|
|
99
|
+
self.status = attributes[:'status']
|
|
100
|
+
end
|
|
101
|
+
end
|
|
102
|
+
|
|
103
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
|
104
|
+
# @return Array for valid properties with the reasons
|
|
105
|
+
def list_invalid_properties
|
|
106
|
+
warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
|
|
107
|
+
invalid_properties = Array.new
|
|
108
|
+
invalid_properties
|
|
109
|
+
end
|
|
110
|
+
|
|
111
|
+
# Check to see if the all the properties in the model are valid
|
|
112
|
+
# @return true if the model is valid
|
|
113
|
+
def valid?
|
|
114
|
+
warn '[DEPRECATED] the `valid?` method is obsolete'
|
|
115
|
+
true
|
|
116
|
+
end
|
|
117
|
+
|
|
118
|
+
# Checks equality by comparing each attribute.
|
|
119
|
+
# @param [Object] Object to be compared
|
|
120
|
+
def ==(o)
|
|
121
|
+
return true if self.equal?(o)
|
|
122
|
+
self.class == o.class &&
|
|
123
|
+
email == o.email &&
|
|
124
|
+
name == o.name &&
|
|
125
|
+
avatar_url == o.avatar_url &&
|
|
126
|
+
metadata == o.metadata &&
|
|
127
|
+
status == o.status
|
|
128
|
+
end
|
|
129
|
+
|
|
130
|
+
# @see the `==` method
|
|
131
|
+
# @param [Object] Object to be compared
|
|
132
|
+
def eql?(o)
|
|
133
|
+
self == o
|
|
134
|
+
end
|
|
135
|
+
|
|
136
|
+
# Calculates hash code according to all attributes.
|
|
137
|
+
# @return [Integer] Hash code
|
|
138
|
+
def hash
|
|
139
|
+
[email, name, avatar_url, metadata, status].hash
|
|
140
|
+
end
|
|
141
|
+
|
|
142
|
+
# Builds the object from hash
|
|
143
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
144
|
+
# @return [Object] Returns the model itself
|
|
145
|
+
def self.build_from_hash(attributes)
|
|
146
|
+
return nil unless attributes.is_a?(Hash)
|
|
147
|
+
attributes = attributes.transform_keys(&:to_sym)
|
|
148
|
+
transformed_hash = {}
|
|
149
|
+
openapi_types.each_pair do |key, type|
|
|
150
|
+
if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
|
|
151
|
+
transformed_hash["#{key}"] = nil
|
|
152
|
+
elsif type =~ /\AArray<(.*)>/i
|
|
153
|
+
# check to ensure the input is an array given that the attribute
|
|
154
|
+
# is documented as an array but the input is not
|
|
155
|
+
if attributes[attribute_map[key]].is_a?(Array)
|
|
156
|
+
transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
|
|
157
|
+
end
|
|
158
|
+
elsif !attributes[attribute_map[key]].nil?
|
|
159
|
+
transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
|
|
160
|
+
end
|
|
161
|
+
end
|
|
162
|
+
new(transformed_hash)
|
|
163
|
+
end
|
|
164
|
+
|
|
165
|
+
# Deserializes the data based on type
|
|
166
|
+
# @param string type Data type
|
|
167
|
+
# @param string value Value to be deserialized
|
|
168
|
+
# @return [Object] Deserialized data
|
|
169
|
+
def self._deserialize(type, value)
|
|
170
|
+
case type.to_sym
|
|
171
|
+
when :Time
|
|
172
|
+
Time.parse(value)
|
|
173
|
+
when :Date
|
|
174
|
+
Date.parse(value)
|
|
175
|
+
when :String
|
|
176
|
+
value.to_s
|
|
177
|
+
when :Integer
|
|
178
|
+
value.to_i
|
|
179
|
+
when :Float
|
|
180
|
+
value.to_f
|
|
181
|
+
when :Boolean
|
|
182
|
+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
|
183
|
+
true
|
|
184
|
+
else
|
|
185
|
+
false
|
|
186
|
+
end
|
|
187
|
+
when :Object
|
|
188
|
+
# generic object (usually a Hash), return directly
|
|
189
|
+
value
|
|
190
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
|
191
|
+
inner_type = Regexp.last_match[:inner_type]
|
|
192
|
+
value.map { |v| _deserialize(inner_type, v) }
|
|
193
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
|
194
|
+
k_type = Regexp.last_match[:k_type]
|
|
195
|
+
v_type = Regexp.last_match[:v_type]
|
|
196
|
+
{}.tap do |hash|
|
|
197
|
+
value.each do |k, v|
|
|
198
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
|
199
|
+
end
|
|
200
|
+
end
|
|
201
|
+
else # model
|
|
202
|
+
# models (e.g. Pet) or oneOf
|
|
203
|
+
klass = Zyphr.const_get(type)
|
|
204
|
+
klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
|
205
|
+
end
|
|
206
|
+
end
|
|
207
|
+
|
|
208
|
+
# Returns the string representation of the object
|
|
209
|
+
# @return [String] String presentation of the object
|
|
210
|
+
def to_s
|
|
211
|
+
to_hash.to_s
|
|
212
|
+
end
|
|
213
|
+
|
|
214
|
+
# to_body is an alias to to_hash (backward compatibility)
|
|
215
|
+
# @return [Hash] Returns the object in the form of hash
|
|
216
|
+
def to_body
|
|
217
|
+
to_hash
|
|
218
|
+
end
|
|
219
|
+
|
|
220
|
+
# Returns the object in the form of hash
|
|
221
|
+
# @return [Hash] Returns the object in the form of hash
|
|
222
|
+
def to_hash
|
|
223
|
+
hash = {}
|
|
224
|
+
self.class.attribute_map.each_pair do |attr, param|
|
|
225
|
+
value = self.send(attr)
|
|
226
|
+
if value.nil?
|
|
227
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
|
228
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
|
229
|
+
end
|
|
230
|
+
|
|
231
|
+
hash[param] = _to_hash(value)
|
|
232
|
+
end
|
|
233
|
+
hash
|
|
234
|
+
end
|
|
235
|
+
|
|
236
|
+
# Outputs non-array value in the form of hash
|
|
237
|
+
# For object, use to_hash. Otherwise, just return the value
|
|
238
|
+
# @param [Object] value Any valid value
|
|
239
|
+
# @return [Hash] Returns the value in the form of hash
|
|
240
|
+
def _to_hash(value)
|
|
241
|
+
if value.is_a?(Array)
|
|
242
|
+
value.compact.map { |v| _to_hash(v) }
|
|
243
|
+
elsif value.is_a?(Hash)
|
|
244
|
+
{}.tap do |hash|
|
|
245
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
|
246
|
+
end
|
|
247
|
+
elsif value.respond_to? :to_hash
|
|
248
|
+
value.to_hash
|
|
249
|
+
else
|
|
250
|
+
value
|
|
251
|
+
end
|
|
252
|
+
end
|
|
253
|
+
|
|
254
|
+
end
|
|
255
|
+
|
|
256
|
+
end
|
data/lib/zyphr.rb
CHANGED
|
@@ -144,6 +144,7 @@ require 'zyphr/models/inbound_email_response'
|
|
|
144
144
|
require 'zyphr/models/inbox_list_meta'
|
|
145
145
|
require 'zyphr/models/inbox_list_response'
|
|
146
146
|
require 'zyphr/models/inbox_notification_response'
|
|
147
|
+
require 'zyphr/models/invite_end_user_request'
|
|
147
148
|
require 'zyphr/models/list_waa_s_applications200_response'
|
|
148
149
|
require 'zyphr/models/list_waa_s_endpoint_deliveries200_response'
|
|
149
150
|
require 'zyphr/models/list_waa_s_endpoints200_response'
|
|
@@ -188,6 +189,7 @@ require 'zyphr/models/o_auth_connections_response'
|
|
|
188
189
|
require 'zyphr/models/o_auth_connections_response_data'
|
|
189
190
|
require 'zyphr/models/o_auth_provider'
|
|
190
191
|
require 'zyphr/models/o_auth_provider_info'
|
|
192
|
+
require 'zyphr/models/o_auth_provider_name'
|
|
191
193
|
require 'zyphr/models/o_auth_providers_response'
|
|
192
194
|
require 'zyphr/models/o_auth_providers_response_data'
|
|
193
195
|
require 'zyphr/models/o_auth_tokens_refresh_response'
|
|
@@ -291,9 +293,12 @@ require 'zyphr/models/session_list_response'
|
|
|
291
293
|
require 'zyphr/models/session_list_response_data'
|
|
292
294
|
require 'zyphr/models/session_list_response_data_session_info'
|
|
293
295
|
require 'zyphr/models/set_domain_inbound_request'
|
|
296
|
+
require 'zyphr/models/set_end_user_claims_request'
|
|
294
297
|
require 'zyphr/models/set_preferences_request'
|
|
295
298
|
require 'zyphr/models/set_preferences_request_preferences_inner'
|
|
296
299
|
require 'zyphr/models/sign_in_anonymously_request'
|
|
300
|
+
require 'zyphr/models/sign_in_with_game_center_request'
|
|
301
|
+
require 'zyphr/models/sign_in_with_google_play_games_request'
|
|
297
302
|
require 'zyphr/models/slack_message'
|
|
298
303
|
require 'zyphr/models/slack_message_list_response'
|
|
299
304
|
require 'zyphr/models/slack_message_list_response_meta'
|
|
@@ -349,6 +354,7 @@ require 'zyphr/models/unsubscribe_list_response'
|
|
|
349
354
|
require 'zyphr/models/unsubscribe_request'
|
|
350
355
|
require 'zyphr/models/unsubscribe_response'
|
|
351
356
|
require 'zyphr/models/update_category_request'
|
|
357
|
+
require 'zyphr/models/update_end_user_by_application_request'
|
|
352
358
|
require 'zyphr/models/update_end_user_request'
|
|
353
359
|
require 'zyphr/models/update_organization_member_role_request'
|
|
354
360
|
require 'zyphr/models/update_organization_request'
|
|
@@ -459,6 +465,7 @@ require 'zyphr/api/auth_password_reset_api'
|
|
|
459
465
|
require 'zyphr/api/auth_phone_api'
|
|
460
466
|
require 'zyphr/api/auth_registration_api'
|
|
461
467
|
require 'zyphr/api/auth_sessions_api'
|
|
468
|
+
require 'zyphr/api/auth_user_directory_api'
|
|
462
469
|
require 'zyphr/api/auth_user_profile_api'
|
|
463
470
|
require 'zyphr/api/auth_web_authn_api'
|
|
464
471
|
require 'zyphr/api/devices_api'
|
|
@@ -58,7 +58,7 @@ describe 'AuthRegistrationApi' do
|
|
|
58
58
|
|
|
59
59
|
# unit tests for sign_in_anonymously
|
|
60
60
|
# Sign in anonymously
|
|
61
|
-
# 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.
|
|
61
|
+
# 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.
|
|
62
62
|
# @param sign_in_anonymously_request
|
|
63
63
|
# @param [Hash] opts the optional parameters
|
|
64
64
|
# @return [AuthResultResponse]
|
|
@@ -68,4 +68,28 @@ describe 'AuthRegistrationApi' do
|
|
|
68
68
|
end
|
|
69
69
|
end
|
|
70
70
|
|
|
71
|
+
# unit tests for sign_in_with_game_center
|
|
72
|
+
# Sign in with Apple Game Center
|
|
73
|
+
# 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.
|
|
74
|
+
# @param sign_in_with_game_center_request
|
|
75
|
+
# @param [Hash] opts the optional parameters
|
|
76
|
+
# @return [AuthResultResponse]
|
|
77
|
+
describe 'sign_in_with_game_center test' do
|
|
78
|
+
it 'should work' do
|
|
79
|
+
# assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
|
|
80
|
+
end
|
|
81
|
+
end
|
|
82
|
+
|
|
83
|
+
# unit tests for sign_in_with_google_play_games
|
|
84
|
+
# Sign in with Google Play Games Services
|
|
85
|
+
# Exchange a Google Play Games Services (GPGS) **server auth code** for a Zyphr end-user session. Unlike Game Center (which submits an Apple-signed assertion), GPGS is verified by Google: Zyphr exchanges the single-use server auth code at Google's OAuth2 token endpoint, then calls the Play Games REST API (`players/me`) server-side to obtain the trusted, tamper-proof `playerId`. The user is provisioned-or-looked-up on that server-fetched `playerId` and tokens are minted. ## Producing the server auth code (Integration) The server auth code is obtained **on-device by the Android app** — there is no server-side way to mint it. The app calls `GamesSignInClient.requestServerSideAccess(serverClientId, …)` using the Google Cloud **web (server) client id** configured for the game, which returns a single-use auth code string. Submit that string here as `serverAuthCode`. The **backend-relayed** shape is the common one: the app forwards the auth code to the customer's own backend, which relays it to this endpoint; the app never holds Zyphr keys. ## Security The `playerId` is derived **only** from Zyphr's own server-side call to Google after the token exchange — a client-supplied player id is never accepted or trusted. On any verification failure the response is a single opaque `401` `invalid_auth_code`; the specific control that failed is never disclosed.
|
|
86
|
+
# @param sign_in_with_google_play_games_request
|
|
87
|
+
# @param [Hash] opts the optional parameters
|
|
88
|
+
# @return [AuthResultResponse]
|
|
89
|
+
describe 'sign_in_with_google_play_games test' do
|
|
90
|
+
it 'should work' do
|
|
91
|
+
# assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
|
|
92
|
+
end
|
|
93
|
+
end
|
|
94
|
+
|
|
71
95
|
end
|
|
@@ -0,0 +1,136 @@
|
|
|
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 'spec_helper'
|
|
14
|
+
require 'json'
|
|
15
|
+
|
|
16
|
+
# Unit tests for Zyphr::AuthUserDirectoryApi
|
|
17
|
+
# Automatically generated by openapi-generator (https://openapi-generator.tech)
|
|
18
|
+
# Please update as you see appropriate
|
|
19
|
+
describe 'AuthUserDirectoryApi' do
|
|
20
|
+
before do
|
|
21
|
+
# run before each test
|
|
22
|
+
@api_instance = Zyphr::AuthUserDirectoryApi.new
|
|
23
|
+
end
|
|
24
|
+
|
|
25
|
+
after do
|
|
26
|
+
# run after each test
|
|
27
|
+
end
|
|
28
|
+
|
|
29
|
+
describe 'test an instance of AuthUserDirectoryApi' do
|
|
30
|
+
it 'should create an instance of AuthUserDirectoryApi' do
|
|
31
|
+
expect(@api_instance).to be_instance_of(Zyphr::AuthUserDirectoryApi)
|
|
32
|
+
end
|
|
33
|
+
end
|
|
34
|
+
|
|
35
|
+
# unit tests for delete_end_user_by_application
|
|
36
|
+
# Delete an end user (server-side admin)
|
|
37
|
+
# 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.
|
|
38
|
+
# @param user_id
|
|
39
|
+
# @param [Hash] opts the optional parameters
|
|
40
|
+
# @return [nil]
|
|
41
|
+
describe 'delete_end_user_by_application test' do
|
|
42
|
+
it 'should work' do
|
|
43
|
+
# assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
|
|
44
|
+
end
|
|
45
|
+
end
|
|
46
|
+
|
|
47
|
+
# unit tests for get_end_user_by_email
|
|
48
|
+
# Look up an end user by email (server-side admin)
|
|
49
|
+
# 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.
|
|
50
|
+
# @param email
|
|
51
|
+
# @param [Hash] opts the optional parameters
|
|
52
|
+
# @return [nil]
|
|
53
|
+
describe 'get_end_user_by_email test' do
|
|
54
|
+
it 'should work' do
|
|
55
|
+
# assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
|
|
56
|
+
end
|
|
57
|
+
end
|
|
58
|
+
|
|
59
|
+
# unit tests for get_end_user_by_id
|
|
60
|
+
# Get an end user by id (server-side admin)
|
|
61
|
+
# 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.
|
|
62
|
+
# @param user_id
|
|
63
|
+
# @param [Hash] opts the optional parameters
|
|
64
|
+
# @return [nil]
|
|
65
|
+
describe 'get_end_user_by_id test' do
|
|
66
|
+
it 'should work' do
|
|
67
|
+
# assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
|
|
68
|
+
end
|
|
69
|
+
end
|
|
70
|
+
|
|
71
|
+
# unit tests for get_end_user_claims
|
|
72
|
+
# Get an end user's stored custom claims (server-side admin)
|
|
73
|
+
# 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.
|
|
74
|
+
# @param user_id
|
|
75
|
+
# @param [Hash] opts the optional parameters
|
|
76
|
+
# @return [nil]
|
|
77
|
+
describe 'get_end_user_claims test' do
|
|
78
|
+
it 'should work' do
|
|
79
|
+
# assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
|
|
80
|
+
end
|
|
81
|
+
end
|
|
82
|
+
|
|
83
|
+
# unit tests for invite_end_user
|
|
84
|
+
# Pre-provision (invite) an end user (server-side admin)
|
|
85
|
+
# 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).
|
|
86
|
+
# @param invite_end_user_request
|
|
87
|
+
# @param [Hash] opts the optional parameters
|
|
88
|
+
# @return [nil]
|
|
89
|
+
describe 'invite_end_user test' do
|
|
90
|
+
it 'should work' do
|
|
91
|
+
# assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
|
|
92
|
+
end
|
|
93
|
+
end
|
|
94
|
+
|
|
95
|
+
# unit tests for list_end_users
|
|
96
|
+
# List / search end users (server-side admin)
|
|
97
|
+
# 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.
|
|
98
|
+
# @param [Hash] opts the optional parameters
|
|
99
|
+
# @option opts [Integer] :page
|
|
100
|
+
# @option opts [Integer] :per_page
|
|
101
|
+
# @option opts [String] :search Substring match against email, name, or phone number.
|
|
102
|
+
# @option opts [String] :environment
|
|
103
|
+
# @return [nil]
|
|
104
|
+
describe 'list_end_users test' do
|
|
105
|
+
it 'should work' do
|
|
106
|
+
# assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
|
|
107
|
+
end
|
|
108
|
+
end
|
|
109
|
+
|
|
110
|
+
# unit tests for set_end_user_claims
|
|
111
|
+
# Set an end user's stored custom claims (server-side admin)
|
|
112
|
+
# 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.
|
|
113
|
+
# @param user_id
|
|
114
|
+
# @param set_end_user_claims_request
|
|
115
|
+
# @param [Hash] opts the optional parameters
|
|
116
|
+
# @return [nil]
|
|
117
|
+
describe 'set_end_user_claims test' do
|
|
118
|
+
it 'should work' do
|
|
119
|
+
# assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
|
|
120
|
+
end
|
|
121
|
+
end
|
|
122
|
+
|
|
123
|
+
# unit tests for update_end_user_by_application
|
|
124
|
+
# Update an end user (server-side admin)
|
|
125
|
+
# 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.
|
|
126
|
+
# @param user_id
|
|
127
|
+
# @param update_end_user_by_application_request
|
|
128
|
+
# @param [Hash] opts the optional parameters
|
|
129
|
+
# @return [nil]
|
|
130
|
+
describe 'update_end_user_by_application test' do
|
|
131
|
+
it 'should work' do
|
|
132
|
+
# assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
|
|
133
|
+
end
|
|
134
|
+
end
|
|
135
|
+
|
|
136
|
+
end
|
|
@@ -43,18 +43,6 @@ describe 'AuthUserProfileApi' do
|
|
|
43
43
|
end
|
|
44
44
|
end
|
|
45
45
|
|
|
46
|
-
# unit tests for delete_end_user_by_application
|
|
47
|
-
# Delete an end user (test environment only)
|
|
48
|
-
# 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.
|
|
49
|
-
# @param user_id
|
|
50
|
-
# @param [Hash] opts the optional parameters
|
|
51
|
-
# @return [nil]
|
|
52
|
-
describe 'delete_end_user_by_application test' do
|
|
53
|
-
it 'should work' do
|
|
54
|
-
# assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
|
|
55
|
-
end
|
|
56
|
-
end
|
|
57
|
-
|
|
58
46
|
# unit tests for get_end_user
|
|
59
47
|
# Get current end user profile
|
|
60
48
|
# Retrieve the profile of the currently authenticated end user.
|
|
@@ -0,0 +1,64 @@
|
|
|
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 'spec_helper'
|
|
14
|
+
require 'json'
|
|
15
|
+
require 'date'
|
|
16
|
+
|
|
17
|
+
# Unit tests for Zyphr::InviteEndUserRequest
|
|
18
|
+
# Automatically generated by openapi-generator (https://openapi-generator.tech)
|
|
19
|
+
# Please update as you see appropriate
|
|
20
|
+
describe Zyphr::InviteEndUserRequest do
|
|
21
|
+
let(:instance) { Zyphr::InviteEndUserRequest.new }
|
|
22
|
+
|
|
23
|
+
describe 'test an instance of InviteEndUserRequest' do
|
|
24
|
+
it 'should create an instance of InviteEndUserRequest' do
|
|
25
|
+
# uncomment below to test the instance creation
|
|
26
|
+
#expect(instance).to be_instance_of(Zyphr::InviteEndUserRequest)
|
|
27
|
+
end
|
|
28
|
+
end
|
|
29
|
+
|
|
30
|
+
describe 'test attribute "email"' do
|
|
31
|
+
it 'should work' do
|
|
32
|
+
# assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
|
|
33
|
+
end
|
|
34
|
+
end
|
|
35
|
+
|
|
36
|
+
describe 'test attribute "name"' do
|
|
37
|
+
it 'should work' do
|
|
38
|
+
# assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
|
|
39
|
+
end
|
|
40
|
+
end
|
|
41
|
+
|
|
42
|
+
describe 'test attribute "metadata"' do
|
|
43
|
+
it 'should work' do
|
|
44
|
+
# assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
|
|
45
|
+
end
|
|
46
|
+
end
|
|
47
|
+
|
|
48
|
+
describe 'test attribute "send_link"' do
|
|
49
|
+
it 'should work' do
|
|
50
|
+
# assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
|
|
51
|
+
# validator = Petstore::EnumTest::EnumAttributeValidator.new('String', ["magic", "password_reset", "none"])
|
|
52
|
+
# validator.allowable_values.each do |value|
|
|
53
|
+
# expect { instance.send_link = value }.not_to raise_error
|
|
54
|
+
# end
|
|
55
|
+
end
|
|
56
|
+
end
|
|
57
|
+
|
|
58
|
+
describe 'test attribute "redirect_url"' do
|
|
59
|
+
it 'should work' do
|
|
60
|
+
# assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
|
|
61
|
+
end
|
|
62
|
+
end
|
|
63
|
+
|
|
64
|
+
end
|
|
@@ -0,0 +1,30 @@
|
|
|
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 'spec_helper'
|
|
14
|
+
require 'json'
|
|
15
|
+
require 'date'
|
|
16
|
+
|
|
17
|
+
# Unit tests for Zyphr::OAuthProviderName
|
|
18
|
+
# Automatically generated by openapi-generator (https://openapi-generator.tech)
|
|
19
|
+
# Please update as you see appropriate
|
|
20
|
+
describe Zyphr::OAuthProviderName do
|
|
21
|
+
let(:instance) { Zyphr::OAuthProviderName.new }
|
|
22
|
+
|
|
23
|
+
describe 'test an instance of OAuthProviderName' do
|
|
24
|
+
it 'should create an instance of OAuthProviderName' do
|
|
25
|
+
# uncomment below to test the instance creation
|
|
26
|
+
#expect(instance).to be_instance_of(Zyphr::OAuthProviderName)
|
|
27
|
+
end
|
|
28
|
+
end
|
|
29
|
+
|
|
30
|
+
end
|
|
@@ -0,0 +1,36 @@
|
|
|
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 'spec_helper'
|
|
14
|
+
require 'json'
|
|
15
|
+
require 'date'
|
|
16
|
+
|
|
17
|
+
# Unit tests for Zyphr::SetEndUserClaimsRequest
|
|
18
|
+
# Automatically generated by openapi-generator (https://openapi-generator.tech)
|
|
19
|
+
# Please update as you see appropriate
|
|
20
|
+
describe Zyphr::SetEndUserClaimsRequest do
|
|
21
|
+
let(:instance) { Zyphr::SetEndUserClaimsRequest.new }
|
|
22
|
+
|
|
23
|
+
describe 'test an instance of SetEndUserClaimsRequest' do
|
|
24
|
+
it 'should create an instance of SetEndUserClaimsRequest' do
|
|
25
|
+
# uncomment below to test the instance creation
|
|
26
|
+
#expect(instance).to be_instance_of(Zyphr::SetEndUserClaimsRequest)
|
|
27
|
+
end
|
|
28
|
+
end
|
|
29
|
+
|
|
30
|
+
describe 'test attribute "claims"' do
|
|
31
|
+
it 'should work' do
|
|
32
|
+
# assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
|
|
33
|
+
end
|
|
34
|
+
end
|
|
35
|
+
|
|
36
|
+
end
|
|
@@ -45,4 +45,16 @@ describe Zyphr::SignInAnonymouslyRequest do
|
|
|
45
45
|
end
|
|
46
46
|
end
|
|
47
47
|
|
|
48
|
+
describe 'test attribute "organization_id"' do
|
|
49
|
+
it 'should work' do
|
|
50
|
+
# assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
|
|
51
|
+
end
|
|
52
|
+
end
|
|
53
|
+
|
|
54
|
+
describe 'test attribute "organization_role"' do
|
|
55
|
+
it 'should work' do
|
|
56
|
+
# assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
|
|
57
|
+
end
|
|
58
|
+
end
|
|
59
|
+
|
|
48
60
|
end
|