passageidentity 0.6.2 → 0.7.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (135) hide show
  1. checksums.yaml +4 -4
  2. data/lib/openapi_client/api/apps_api.rb +2 -2
  3. data/lib/openapi_client/api/magic_links_api.rb +4 -4
  4. data/lib/openapi_client/api/tokens_api.rb +2 -2
  5. data/lib/openapi_client/api/user_devices_api.rb +3 -3
  6. data/lib/openapi_client/api/users_api.rb +8 -8
  7. data/lib/openapi_client/api_client.rb +36 -30
  8. data/lib/openapi_client/api_error.rb +1 -1
  9. data/lib/openapi_client/configuration.rb +11 -1
  10. data/lib/openapi_client/models/app_info.rb +36 -3
  11. data/lib/openapi_client/models/app_response.rb +1 -1
  12. data/lib/openapi_client/models/apple_user_social_connection.rb +1 -1
  13. data/lib/openapi_client/models/auth_methods.rb +1 -1
  14. data/lib/openapi_client/models/create_magic_link_request.rb +2 -57
  15. data/lib/openapi_client/models/create_user_request.rb +1 -1
  16. data/lib/openapi_client/models/element_customization.rb +1 -1
  17. data/lib/openapi_client/models/font_family.rb +1 -1
  18. data/lib/openapi_client/models/github_user_social_connection.rb +1 -1
  19. data/lib/openapi_client/models/google_user_social_connection.rb +1 -1
  20. data/lib/openapi_client/models/layout_config.rb +1 -1
  21. data/lib/openapi_client/models/layouts.rb +1 -1
  22. data/lib/openapi_client/models/link.rb +1 -1
  23. data/lib/openapi_client/models/list_devices_response.rb +1 -1
  24. data/lib/openapi_client/models/list_paginated_users_item.rb +19 -2
  25. data/lib/openapi_client/models/list_paginated_users_response.rb +1 -1
  26. data/lib/openapi_client/models/magic_link.rb +1 -1
  27. data/lib/openapi_client/models/magic_link_auth_method.rb +1 -1
  28. data/lib/openapi_client/models/magic_link_channel.rb +1 -1
  29. data/lib/openapi_client/models/magic_link_response.rb +1 -1
  30. data/lib/openapi_client/models/magic_link_type.rb +1 -1
  31. data/lib/openapi_client/models/model400_error.rb +1 -1
  32. data/lib/openapi_client/models/model401_error.rb +1 -1
  33. data/lib/openapi_client/models/model403_error.rb +1 -1
  34. data/lib/openapi_client/models/model404_error.rb +3 -3
  35. data/lib/openapi_client/models/model500_error.rb +1 -1
  36. data/lib/openapi_client/models/nonce.rb +1 -1
  37. data/lib/openapi_client/models/otp_auth_method.rb +1 -1
  38. data/lib/openapi_client/models/paginated_links.rb +1 -1
  39. data/lib/openapi_client/models/passkeys_auth_method.rb +1 -1
  40. data/lib/openapi_client/models/social_connection_type.rb +41 -0
  41. data/lib/openapi_client/models/technologies.rb +1 -1
  42. data/lib/openapi_client/models/theme_type.rb +41 -0
  43. data/lib/openapi_client/models/ttl_display_unit.rb +1 -1
  44. data/lib/openapi_client/models/update_user_request.rb +1 -1
  45. data/lib/openapi_client/models/user_event_action.rb +41 -0
  46. data/lib/openapi_client/models/user_event_status.rb +1 -1
  47. data/lib/openapi_client/models/user_info.rb +19 -2
  48. data/lib/openapi_client/models/user_metadata_field.rb +1 -1
  49. data/lib/openapi_client/models/user_metadata_field_type.rb +1 -1
  50. data/lib/openapi_client/models/user_recent_event.rb +51 -5
  51. data/lib/openapi_client/models/user_response.rb +1 -1
  52. data/lib/openapi_client/models/user_social_connections.rb +1 -1
  53. data/lib/openapi_client/models/user_status.rb +1 -1
  54. data/lib/openapi_client/models/web_authn_devices.rb +1 -1
  55. data/lib/openapi_client/models/web_authn_icons.rb +1 -1
  56. data/lib/openapi_client/models/web_authn_type.rb +1 -1
  57. data/lib/openapi_client/version.rb +1 -1
  58. data/lib/openapi_client.rb +4 -4
  59. data/lib/passageidentity/auth.rb +205 -104
  60. data/lib/passageidentity/client.rb +71 -59
  61. data/lib/passageidentity/error.rb +42 -16
  62. data/lib/passageidentity/user_api.rb +120 -161
  63. data/lib/passageidentity/version.rb +1 -1
  64. data/lib/passageidentity.rb +6 -2
  65. metadata +33 -79
  66. data/.github/workflows/deploy.yml +0 -30
  67. data/.github/workflows/on-pull-request.yml +0 -33
  68. data/.gitignore +0 -58
  69. data/CHANGELOG.md +0 -57
  70. data/CONTRIBUTING.md +0 -66
  71. data/Gemfile +0 -13
  72. data/LICENSE +0 -21
  73. data/README.md +0 -84
  74. data/docs/custom/AuthApi.md +0 -141
  75. data/docs/custom/ClientApi.md +0 -107
  76. data/docs/custom/UserApi.md +0 -419
  77. data/docs/generated/AppInfo.md +0 -94
  78. data/docs/generated/AppResponse.md +0 -18
  79. data/docs/generated/AppleUserSocialConnection.md +0 -24
  80. data/docs/generated/AppsApi.md +0 -77
  81. data/docs/generated/AuthMethods.md +0 -22
  82. data/docs/generated/CreateMagicLinkRequest.md +0 -36
  83. data/docs/generated/CreateUserRequest.md +0 -22
  84. data/docs/generated/ElementCustomization.md +0 -56
  85. data/docs/generated/FontFamily.md +0 -15
  86. data/docs/generated/GithubUserSocialConnection.md +0 -24
  87. data/docs/generated/GoogleUserSocialConnection.md +0 -24
  88. data/docs/generated/LayoutConfig.md +0 -26
  89. data/docs/generated/Layouts.md +0 -20
  90. data/docs/generated/Link.md +0 -18
  91. data/docs/generated/ListDevicesResponse.md +0 -18
  92. data/docs/generated/ListPaginatedUsersItem.md +0 -38
  93. data/docs/generated/ListPaginatedUsersResponse.md +0 -28
  94. data/docs/generated/MagicLink.md +0 -36
  95. data/docs/generated/MagicLinkAuthMethod.md +0 -22
  96. data/docs/generated/MagicLinkChannel.md +0 -15
  97. data/docs/generated/MagicLinkResponse.md +0 -18
  98. data/docs/generated/MagicLinkType.md +0 -15
  99. data/docs/generated/MagicLinksApi.md +0 -79
  100. data/docs/generated/Model400Error.md +0 -20
  101. data/docs/generated/Model401Error.md +0 -20
  102. data/docs/generated/Model403Error.md +0 -20
  103. data/docs/generated/Model404Error.md +0 -20
  104. data/docs/generated/Model500Error.md +0 -20
  105. data/docs/generated/Nonce.md +0 -18
  106. data/docs/generated/OtpAuthMethod.md +0 -22
  107. data/docs/generated/PaginatedLinks.md +0 -26
  108. data/docs/generated/PasskeysAuthMethod.md +0 -18
  109. data/docs/generated/README.md +0 -158
  110. data/docs/generated/Technologies.md +0 -15
  111. data/docs/generated/TokensApi.md +0 -78
  112. data/docs/generated/TtlDisplayUnit.md +0 -15
  113. data/docs/generated/UpdateUserRequest.md +0 -22
  114. data/docs/generated/UserDevicesApi.md +0 -152
  115. data/docs/generated/UserEventStatus.md +0 -15
  116. data/docs/generated/UserInfo.md +0 -48
  117. data/docs/generated/UserMetadataField.md +0 -28
  118. data/docs/generated/UserMetadataFieldType.md +0 -15
  119. data/docs/generated/UserRecentEvent.md +0 -30
  120. data/docs/generated/UserResponse.md +0 -18
  121. data/docs/generated/UserSocialConnections.md +0 -22
  122. data/docs/generated/UserStatus.md +0 -15
  123. data/docs/generated/UsersApi.md +0 -534
  124. data/docs/generated/WebAuthnDevices.md +0 -34
  125. data/docs/generated/WebAuthnIcons.md +0 -20
  126. data/docs/generated/WebAuthnType.md +0 -15
  127. data/generate.sh +0 -31
  128. data/openapitools.json +0 -7
  129. data/passageidentity.gemspec +0 -32
  130. data/tests/all.rb +0 -3
  131. data/tests/app_test.rb +0 -15
  132. data/tests/auth_test.rb +0 -74
  133. data/tests/errors_test.rb +0 -30
  134. data/tests/magic_link_test.rb +0 -22
  135. data/tests/user_api_test.rb +0 -121
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 8cd467636d69820affe2b8c7132a5020043465a982176d1fe78e0a8e505528d8
4
- data.tar.gz: 2ca83b8a479ab84dfe3e8c995684b4cbb0b5a8c8051cb9eefbcc370ed3a36936
3
+ metadata.gz: a753c1f07983a5f98df91f9f245475167c3c263b7e5f976b6c0ac6b71e931a18
4
+ data.tar.gz: eb323a9ba0d18b45cf854989bd6a46f83a3aff42b9b2db4d1be2cea70343bdc3
5
5
  SHA512:
6
- metadata.gz: 89e9d432cea8930db2686f203813f28ac902fde133080aa150987147e57aec8b2115b5c30b2fde84839e348b539239e09c2c7220f6f5ae1471b92b2b8f11b3b8
7
- data.tar.gz: 599688eac0e4ac800315dc07cd47f73c7a04349db737526b492ab5fdeb57049de936b17e406d01d057085a2170794f8939b4cda719adcb3f95d89abd554c1508
6
+ metadata.gz: 6d32c13743e03c73a629cf99a87a05f36081ad1d991d54f254806849bf6c237a7c845f6f983ac35fb15b73cfcd76f86f37514c316b2bf2771563fbc118ce7758
7
+ data.tar.gz: 47d7cfebc0f96c4f1e38c8f77970722cfbb7e2248feac0f0b10c8cfd913dc6a1d0cbb99ff6385c17c0abeb6cd28fa5f4745ec2994691c7de63dd93a42ee84781
@@ -6,7 +6,7 @@
6
6
  The version of the OpenAPI document: 1
7
7
  Contact: support@passage.id
8
8
  Generated by: https://openapi-generator.tech
9
- OpenAPI Generator version: 7.1.0
9
+ Generator version: 7.11.0-SNAPSHOT
10
10
 
11
11
  =end
12
12
 
@@ -51,7 +51,7 @@ module OpenapiClient
51
51
  # header parameters
52
52
  header_params = opts[:header_params] || {}
53
53
  # HTTP header 'Accept' (if needed)
54
- header_params['Accept'] = @api_client.select_header_accept(['application/json'])
54
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
55
55
 
56
56
  # form parameters
57
57
  form_params = opts[:form_params] || {}
@@ -6,7 +6,7 @@
6
6
  The version of the OpenAPI document: 1
7
7
  Contact: support@passage.id
8
8
  Generated by: https://openapi-generator.tech
9
- OpenAPI Generator version: 7.1.0
9
+ Generator version: 7.11.0-SNAPSHOT
10
10
 
11
11
  =end
12
12
 
@@ -22,7 +22,7 @@ module OpenapiClient
22
22
  # Create Embeddable Magic Link
23
23
  # Create magic link for a user.
24
24
  # @param app_id [String] App ID
25
- # @param create_magic_link_request [CreateMagicLinkRequest] magic link request
25
+ # @param create_magic_link_request [CreateMagicLinkRequest] Request to create a magic link
26
26
  # @param [Hash] opts the optional parameters
27
27
  # @return [MagicLinkResponse]
28
28
  def create_magic_link(app_id, create_magic_link_request, opts = {})
@@ -33,7 +33,7 @@ module OpenapiClient
33
33
  # Create Embeddable Magic Link
34
34
  # Create magic link for a user.
35
35
  # @param app_id [String] App ID
36
- # @param create_magic_link_request [CreateMagicLinkRequest] magic link request
36
+ # @param create_magic_link_request [CreateMagicLinkRequest] Request to create a magic link
37
37
  # @param [Hash] opts the optional parameters
38
38
  # @return [Array<(MagicLinkResponse, Integer, Hash)>] MagicLinkResponse data, response status code and response headers
39
39
  def create_magic_link_with_http_info(app_id, create_magic_link_request, opts = {})
@@ -57,7 +57,7 @@ module OpenapiClient
57
57
  # header parameters
58
58
  header_params = opts[:header_params] || {}
59
59
  # HTTP header 'Accept' (if needed)
60
- header_params['Accept'] = @api_client.select_header_accept(['application/json'])
60
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
61
61
  # HTTP header 'Content-Type'
62
62
  content_type = @api_client.select_header_content_type(['application/json'])
63
63
  if !content_type.nil?
@@ -6,7 +6,7 @@
6
6
  The version of the OpenAPI document: 1
7
7
  Contact: support@passage.id
8
8
  Generated by: https://openapi-generator.tech
9
- OpenAPI Generator version: 7.1.0
9
+ Generator version: 7.11.0-SNAPSHOT
10
10
 
11
11
  =end
12
12
 
@@ -57,7 +57,7 @@ module OpenapiClient
57
57
  # header parameters
58
58
  header_params = opts[:header_params] || {}
59
59
  # HTTP header 'Accept' (if needed)
60
- header_params['Accept'] = @api_client.select_header_accept(['application/json'])
60
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
61
61
 
62
62
  # form parameters
63
63
  form_params = opts[:form_params] || {}
@@ -6,7 +6,7 @@
6
6
  The version of the OpenAPI document: 1
7
7
  Contact: support@passage.id
8
8
  Generated by: https://openapi-generator.tech
9
- OpenAPI Generator version: 7.1.0
9
+ Generator version: 7.11.0-SNAPSHOT
10
10
 
11
11
  =end
12
12
 
@@ -63,7 +63,7 @@ module OpenapiClient
63
63
  # header parameters
64
64
  header_params = opts[:header_params] || {}
65
65
  # HTTP header 'Accept' (if needed)
66
- header_params['Accept'] = @api_client.select_header_accept(['application/json'])
66
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
67
67
 
68
68
  # form parameters
69
69
  form_params = opts[:form_params] || {}
@@ -132,7 +132,7 @@ module OpenapiClient
132
132
  # header parameters
133
133
  header_params = opts[:header_params] || {}
134
134
  # HTTP header 'Accept' (if needed)
135
- header_params['Accept'] = @api_client.select_header_accept(['application/json'])
135
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
136
136
 
137
137
  # form parameters
138
138
  form_params = opts[:form_params] || {}
@@ -6,7 +6,7 @@
6
6
  The version of the OpenAPI document: 1
7
7
  Contact: support@passage.id
8
8
  Generated by: https://openapi-generator.tech
9
- OpenAPI Generator version: 7.1.0
9
+ Generator version: 7.11.0-SNAPSHOT
10
10
 
11
11
  =end
12
12
 
@@ -57,7 +57,7 @@ module OpenapiClient
57
57
  # header parameters
58
58
  header_params = opts[:header_params] || {}
59
59
  # HTTP header 'Accept' (if needed)
60
- header_params['Accept'] = @api_client.select_header_accept(['application/json'])
60
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
61
61
 
62
62
  # form parameters
63
63
  form_params = opts[:form_params] || {}
@@ -126,7 +126,7 @@ module OpenapiClient
126
126
  # header parameters
127
127
  header_params = opts[:header_params] || {}
128
128
  # HTTP header 'Accept' (if needed)
129
- header_params['Accept'] = @api_client.select_header_accept(['application/json'])
129
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
130
130
  # HTTP header 'Content-Type'
131
131
  content_type = @api_client.select_header_content_type(['application/json'])
132
132
  if !content_type.nil?
@@ -200,7 +200,7 @@ module OpenapiClient
200
200
  # header parameters
201
201
  header_params = opts[:header_params] || {}
202
202
  # HTTP header 'Accept' (if needed)
203
- header_params['Accept'] = @api_client.select_header_accept(['application/json'])
203
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
204
204
 
205
205
  # form parameters
206
206
  form_params = opts[:form_params] || {}
@@ -269,7 +269,7 @@ module OpenapiClient
269
269
  # header parameters
270
270
  header_params = opts[:header_params] || {}
271
271
  # HTTP header 'Accept' (if needed)
272
- header_params['Accept'] = @api_client.select_header_accept(['application/json'])
272
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
273
273
 
274
274
  # form parameters
275
275
  form_params = opts[:form_params] || {}
@@ -338,7 +338,7 @@ module OpenapiClient
338
338
  # header parameters
339
339
  header_params = opts[:header_params] || {}
340
340
  # HTTP header 'Accept' (if needed)
341
- header_params['Accept'] = @api_client.select_header_accept(['application/json'])
341
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
342
342
 
343
343
  # form parameters
344
344
  form_params = opts[:form_params] || {}
@@ -434,7 +434,7 @@ module OpenapiClient
434
434
  # header parameters
435
435
  header_params = opts[:header_params] || {}
436
436
  # HTTP header 'Accept' (if needed)
437
- header_params['Accept'] = @api_client.select_header_accept(['application/json'])
437
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
438
438
 
439
439
  # form parameters
440
440
  form_params = opts[:form_params] || {}
@@ -509,7 +509,7 @@ module OpenapiClient
509
509
  # header parameters
510
510
  header_params = opts[:header_params] || {}
511
511
  # HTTP header 'Accept' (if needed)
512
- header_params['Accept'] = @api_client.select_header_accept(['application/json'])
512
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
513
513
  # HTTP header 'Content-Type'
514
514
  content_type = @api_client.select_header_content_type(['application/json'])
515
515
  if !content_type.nil?
@@ -6,7 +6,7 @@
6
6
  The version of the OpenAPI document: 1
7
7
  Contact: support@passage.id
8
8
  Generated by: https://openapi-generator.tech
9
- OpenAPI Generator version: 7.1.0
9
+ Generator version: 7.11.0-SNAPSHOT
10
10
 
11
11
  =end
12
12
 
@@ -17,6 +17,7 @@ require 'tempfile'
17
17
  require 'time'
18
18
  require 'faraday'
19
19
  require 'faraday/multipart' if Gem::Version.new(Faraday::VERSION) >= Gem::Version.new('2.0')
20
+ require 'marcel'
20
21
 
21
22
 
22
23
  module OpenapiClient
@@ -52,7 +53,7 @@ module OpenapiClient
52
53
  stream = nil
53
54
  begin
54
55
  response = connection(opts).public_send(http_method.to_sym.downcase) do |req|
55
- build_request(http_method, path, req, opts)
56
+ request = build_request(http_method, path, req, opts)
56
57
  stream = download_file(request) if opts[:return_type] == 'File' || opts[:return_type] == 'Binary'
57
58
  end
58
59
 
@@ -79,7 +80,7 @@ module OpenapiClient
79
80
  end
80
81
 
81
82
  if opts[:return_type] == 'File' || opts[:return_type] == 'Binary'
82
- data = deserialize_file(stream)
83
+ data = deserialize_file(response, stream)
83
84
  elsif opts[:return_type]
84
85
  data = deserialize(response, opts[:return_type])
85
86
  else
@@ -140,8 +141,7 @@ module OpenapiClient
140
141
  form_params.each do |key, value|
141
142
  case value
142
143
  when ::File, ::Tempfile
143
- # TODO hardcode to application/octet-stream, need better way to detect content type
144
- data[key] = Faraday::FilePart.new(value.path, 'application/octet-stream', value.path)
144
+ data[key] = Faraday::FilePart.new(value.path, Marcel::MimeType.for(Pathname.new(value.path)))
145
145
  when ::Array, nil
146
146
  # let Faraday handle Array and nil parameters
147
147
  data[key] = value
@@ -164,35 +164,41 @@ module OpenapiClient
164
164
  request.options.on_data = Proc.new do |chunk, overall_received_bytes|
165
165
  stream << chunk
166
166
  end
167
+
167
168
  stream
168
169
  end
169
170
 
170
171
  def deserialize_file(response, stream)
171
- body = response.body
172
- if @config.return_binary_data == true
173
- # return byte stream
174
- encoding = body.encoding
175
- stream.join.force_encoding(encoding)
172
+ body = response.body
173
+ encoding = body.encoding
174
+
175
+ # reconstruct content
176
+ content = stream.join
177
+ content = content.unpack('m').join if response.headers['Content-Transfer-Encoding'] == 'binary'
178
+ content = content.force_encoding(encoding)
179
+
180
+ # return byte stream
181
+ return content if @config.return_binary_data == true
182
+
183
+ # return file instead of binary data
184
+ content_disposition = response.headers['Content-Disposition']
185
+ if content_disposition && content_disposition =~ /filename=/i
186
+ filename = content_disposition[/filename=['"]?([^'"\s]+)['"]?/, 1]
187
+ prefix = sanitize_filename(filename)
176
188
  else
177
- # return file instead of binary data
178
- content_disposition = response.headers['Content-Disposition']
179
- if content_disposition && content_disposition =~ /filename=/i
180
- filename = content_disposition[/filename=['"]?([^'"\s]+)['"]?/, 1]
181
- prefix = sanitize_filename(filename)
182
- else
183
- prefix = 'download-'
184
- end
185
- prefix = prefix + '-' unless prefix.end_with?('-')
186
- encoding = body.encoding
187
- tempfile = Tempfile.open(prefix, @config.temp_folder_path, encoding: encoding)
188
- tempfile.write(stream.join.force_encoding(encoding))
189
- tempfile.close
190
- config.logger.info "Temp file written to #{tempfile.path}, please copy the file to a proper folder "\
191
- "with e.g. `FileUtils.cp(tempfile.path, '/new/file/path')` otherwise the temp file "\
192
- "will be deleted automatically with GC. It's also recommended to delete the temp file "\
193
- "explicitly with `tempfile.delete`"
194
- tempfile
189
+ prefix = 'download-'
195
190
  end
191
+ prefix = prefix + '-' unless prefix.end_with?('-')
192
+
193
+ tempfile = Tempfile.open(prefix, @config.temp_folder_path, encoding: encoding)
194
+ tempfile.write(content)
195
+ tempfile.close
196
+
197
+ config.logger.info "Temp file written to #{tempfile.path}, please copy the file to a proper folder "\
198
+ "with e.g. `FileUtils.cp(tempfile.path, '/new/file/path')` otherwise the temp file "\
199
+ "will be deleted automatically with GC. It's also recommended to delete the temp file "\
200
+ "explicitly with `tempfile.delete`"
201
+ tempfile
196
202
  end
197
203
 
198
204
  def connection(opts)
@@ -249,7 +255,7 @@ module OpenapiClient
249
255
  # @param [String] mime MIME
250
256
  # @return [Boolean] True if the MIME is application/json
251
257
  def json_mime?(mime)
252
- (mime == '*/*') || !(mime =~ /Application\/.*json(?!p)(;.*)?/i).nil?
258
+ (mime == '*/*') || !(mime =~ /^Application\/.*json(?!p)(;.*)?/i).nil?
253
259
  end
254
260
 
255
261
  # Deserialize the response to the given return type.
@@ -328,7 +334,7 @@ module OpenapiClient
328
334
  # @param [String] filename the filename to be sanitized
329
335
  # @return [String] the sanitized filename
330
336
  def sanitize_filename(filename)
331
- filename.gsub(/.*[\/\\]/, '')
337
+ filename.split(/[\/\\]/).last
332
338
  end
333
339
 
334
340
  def build_request_url(path, opts = {})
@@ -6,7 +6,7 @@
6
6
  The version of the OpenAPI document: 1
7
7
  Contact: support@passage.id
8
8
  Generated by: https://openapi-generator.tech
9
- OpenAPI Generator version: 7.1.0
9
+ Generator version: 7.11.0-SNAPSHOT
10
10
 
11
11
  =end
12
12
 
@@ -6,7 +6,7 @@
6
6
  The version of the OpenAPI document: 1
7
7
  Contact: support@passage.id
8
8
  Generated by: https://openapi-generator.tech
9
- OpenAPI Generator version: 7.1.0
9
+ Generator version: 7.11.0-SNAPSHOT
10
10
 
11
11
  =end
12
12
 
@@ -79,6 +79,14 @@ module OpenapiClient
79
79
  # @return [true, false]
80
80
  attr_accessor :debugging
81
81
 
82
+ # Set this to ignore operation servers for the API client. This is useful when you need to
83
+ # send requests to a different server than the one specified in the OpenAPI document.
84
+ # Will default to the base url defined in the spec but can be overridden by setting
85
+ # `scheme`, `host`, `base_path` directly.
86
+ # Default to false.
87
+ # @return [true, false]
88
+ attr_accessor :ignore_operation_servers
89
+
82
90
  # Defines the logger used for debugging.
83
91
  # Default to `Rails.logger` (when in Rails) or logging to STDOUT.
84
92
  #
@@ -170,6 +178,7 @@ module OpenapiClient
170
178
  @return_binary_data = false
171
179
  @params_encoder = nil
172
180
  @debugging = false
181
+ @ignore_operation_servers = false
173
182
  @inject_format = false
174
183
  @force_ending_format = false
175
184
  @logger = defined?(Rails) ? Rails.logger : Logger.new(STDOUT)
@@ -204,6 +213,7 @@ module OpenapiClient
204
213
 
205
214
  # Returns base URL for specified operation based on server settings
206
215
  def base_url(operation = nil)
216
+ return "#{scheme}://#{[host, base_path].join('/').gsub(/\/+/, '/')}".sub(/\/+\z/, '') if ignore_operation_servers
207
217
  if operation_server_settings.key?(operation) then
208
218
  index = server_operation_index.fetch(operation, server_index)
209
219
  server_url(index.nil? ? 0 : index, server_operation_variables.fetch(operation, server_variables), operation_server_settings[operation])
@@ -6,7 +6,7 @@
6
6
  The version of the OpenAPI document: 1
7
7
  Contact: support@passage.id
8
8
  Generated by: https://openapi-generator.tech
9
- OpenAPI Generator version: 7.1.0
9
+ Generator version: 7.11.0-SNAPSHOT
10
10
 
11
11
  =end
12
12
 
@@ -38,6 +38,9 @@ module OpenapiClient
38
38
 
39
39
  attr_accessor :auth_origin
40
40
 
41
+ # Deprecated Property. Please use `hosted_theme` to set hosted page theming instead.
42
+ attr_accessor :auto_theme_enabled
43
+
41
44
  attr_accessor :created_at
42
45
 
43
46
  attr_accessor :default_language
@@ -54,12 +57,14 @@ module OpenapiClient
54
57
 
55
58
  attr_accessor :name
56
59
 
57
- # whether or not the app's login page hosted by passage
60
+ # whether or not the app's login page is hosted by Passage
58
61
  attr_accessor :hosted
59
62
 
60
63
  # the subdomain of the app's hosted login page
61
64
  attr_accessor :hosted_subdomain
62
65
 
66
+ attr_accessor :hosted_theme
67
+
63
68
  attr_accessor :id_token_lifetime
64
69
 
65
70
  attr_accessor :passage_branding
@@ -135,6 +140,7 @@ module OpenapiClient
135
140
  :'auth_fallback_method_ttl' => :'auth_fallback_method_ttl',
136
141
  :'auth_methods' => :'auth_methods',
137
142
  :'auth_origin' => :'auth_origin',
143
+ :'auto_theme_enabled' => :'auto_theme_enabled',
138
144
  :'created_at' => :'created_at',
139
145
  :'default_language' => :'default_language',
140
146
  :'id' => :'id',
@@ -145,6 +151,7 @@ module OpenapiClient
145
151
  :'name' => :'name',
146
152
  :'hosted' => :'hosted',
147
153
  :'hosted_subdomain' => :'hosted_subdomain',
154
+ :'hosted_theme' => :'hosted_theme',
148
155
  :'id_token_lifetime' => :'id_token_lifetime',
149
156
  :'passage_branding' => :'passage_branding',
150
157
  :'profile_management' => :'profile_management',
@@ -185,6 +192,7 @@ module OpenapiClient
185
192
  :'auth_fallback_method_ttl' => :'Integer',
186
193
  :'auth_methods' => :'AuthMethods',
187
194
  :'auth_origin' => :'String',
195
+ :'auto_theme_enabled' => :'Boolean',
188
196
  :'created_at' => :'Time',
189
197
  :'default_language' => :'String',
190
198
  :'id' => :'String',
@@ -195,6 +203,7 @@ module OpenapiClient
195
203
  :'name' => :'String',
196
204
  :'hosted' => :'Boolean',
197
205
  :'hosted_subdomain' => :'String',
206
+ :'hosted_theme' => :'ThemeType',
198
207
  :'id_token_lifetime' => :'Integer',
199
208
  :'passage_branding' => :'Boolean',
200
209
  :'profile_management' => :'Boolean',
@@ -299,6 +308,12 @@ module OpenapiClient
299
308
  self.auth_origin = nil
300
309
  end
301
310
 
311
+ if attributes.key?(:'auto_theme_enabled')
312
+ self.auto_theme_enabled = attributes[:'auto_theme_enabled']
313
+ else
314
+ self.auto_theme_enabled = nil
315
+ end
316
+
302
317
  if attributes.key?(:'created_at')
303
318
  self.created_at = attributes[:'created_at']
304
319
  else
@@ -355,6 +370,12 @@ module OpenapiClient
355
370
  self.hosted_subdomain = nil
356
371
  end
357
372
 
373
+ if attributes.key?(:'hosted_theme')
374
+ self.hosted_theme = attributes[:'hosted_theme']
375
+ else
376
+ self.hosted_theme = nil
377
+ end
378
+
358
379
  if attributes.key?(:'id_token_lifetime')
359
380
  self.id_token_lifetime = attributes[:'id_token_lifetime']
360
381
  end
@@ -517,6 +538,10 @@ module OpenapiClient
517
538
  invalid_properties.push('invalid value for "auth_origin", auth_origin cannot be nil.')
518
539
  end
519
540
 
541
+ if @auto_theme_enabled.nil?
542
+ invalid_properties.push('invalid value for "auto_theme_enabled", auto_theme_enabled cannot be nil.')
543
+ end
544
+
520
545
  if @created_at.nil?
521
546
  invalid_properties.push('invalid value for "created_at", created_at cannot be nil.')
522
547
  end
@@ -549,6 +574,10 @@ module OpenapiClient
549
574
  invalid_properties.push('invalid value for "hosted_subdomain", hosted_subdomain cannot be nil.')
550
575
  end
551
576
 
577
+ if @hosted_theme.nil?
578
+ invalid_properties.push('invalid value for "hosted_theme", hosted_theme cannot be nil.')
579
+ end
580
+
552
581
  if @passage_branding.nil?
553
582
  invalid_properties.push('invalid value for "passage_branding", passage_branding cannot be nil.')
554
583
  end
@@ -637,6 +666,7 @@ module OpenapiClient
637
666
  return false if @auth_fallback_method_ttl.nil?
638
667
  return false if @auth_methods.nil?
639
668
  return false if @auth_origin.nil?
669
+ return false if @auto_theme_enabled.nil?
640
670
  return false if @created_at.nil?
641
671
  return false if @default_language.nil?
642
672
  return false if @id.nil?
@@ -645,6 +675,7 @@ module OpenapiClient
645
675
  return false if @name.nil?
646
676
  return false if @hosted.nil?
647
677
  return false if @hosted_subdomain.nil?
678
+ return false if @hosted_theme.nil?
648
679
  return false if @passage_branding.nil?
649
680
  return false if @profile_management.nil?
650
681
  return false if @public_signup.nil?
@@ -692,6 +723,7 @@ module OpenapiClient
692
723
  auth_fallback_method_ttl == o.auth_fallback_method_ttl &&
693
724
  auth_methods == o.auth_methods &&
694
725
  auth_origin == o.auth_origin &&
726
+ auto_theme_enabled == o.auto_theme_enabled &&
695
727
  created_at == o.created_at &&
696
728
  default_language == o.default_language &&
697
729
  id == o.id &&
@@ -702,6 +734,7 @@ module OpenapiClient
702
734
  name == o.name &&
703
735
  hosted == o.hosted &&
704
736
  hosted_subdomain == o.hosted_subdomain &&
737
+ hosted_theme == o.hosted_theme &&
705
738
  id_token_lifetime == o.id_token_lifetime &&
706
739
  passage_branding == o.passage_branding &&
707
740
  profile_management == o.profile_management &&
@@ -733,7 +766,7 @@ module OpenapiClient
733
766
  # Calculates hash code according to all attributes.
734
767
  # @return [Integer] Hash code
735
768
  def hash
736
- [additional_auth_origins, allowed_callback_urls, allowed_identifier, allowed_logout_urls, application_login_uri, auth_fallback_method, auth_fallback_method_ttl, auth_methods, auth_origin, created_at, default_language, id, layouts, login_url, light_logo_url, dark_logo_url, name, hosted, hosted_subdomain, id_token_lifetime, passage_branding, profile_management, public_signup, redirect_url, refresh_absolute_lifetime, refresh_enabled, refresh_inactivity_lifetime, require_email_verification, require_identifier_verification, required_identifier, role, rsa_public_key, secret, session_timeout_length, type, user_metadata_schema, technologies, element_customization, element_customization_dark].hash
769
+ [additional_auth_origins, allowed_callback_urls, allowed_identifier, allowed_logout_urls, application_login_uri, auth_fallback_method, auth_fallback_method_ttl, auth_methods, auth_origin, auto_theme_enabled, created_at, default_language, id, layouts, login_url, light_logo_url, dark_logo_url, name, hosted, hosted_subdomain, hosted_theme, id_token_lifetime, passage_branding, profile_management, public_signup, redirect_url, refresh_absolute_lifetime, refresh_enabled, refresh_inactivity_lifetime, require_email_verification, require_identifier_verification, required_identifier, role, rsa_public_key, secret, session_timeout_length, type, user_metadata_schema, technologies, element_customization, element_customization_dark].hash
737
770
  end
738
771
 
739
772
  # Builds the object from hash
@@ -6,7 +6,7 @@
6
6
  The version of the OpenAPI document: 1
7
7
  Contact: support@passage.id
8
8
  Generated by: https://openapi-generator.tech
9
- OpenAPI Generator version: 7.1.0
9
+ Generator version: 7.11.0-SNAPSHOT
10
10
 
11
11
  =end
12
12
 
@@ -6,7 +6,7 @@
6
6
  The version of the OpenAPI document: 1
7
7
  Contact: support@passage.id
8
8
  Generated by: https://openapi-generator.tech
9
- OpenAPI Generator version: 7.1.0
9
+ Generator version: 7.11.0-SNAPSHOT
10
10
 
11
11
  =end
12
12
 
@@ -6,7 +6,7 @@
6
6
  The version of the OpenAPI document: 1
7
7
  Contact: support@passage.id
8
8
  Generated by: https://openapi-generator.tech
9
- OpenAPI Generator version: 7.1.0
9
+ Generator version: 7.11.0-SNAPSHOT
10
10
 
11
11
  =end
12
12
 
@@ -6,7 +6,7 @@
6
6
  The version of the OpenAPI document: 1
7
7
  Contact: support@passage.id
8
8
  Generated by: https://openapi-generator.tech
9
- OpenAPI Generator version: 7.1.0
9
+ Generator version: 7.11.0-SNAPSHOT
10
10
 
11
11
  =end
12
12
 
@@ -22,6 +22,7 @@ module OpenapiClient
22
22
  # language of the email to send (optional)
23
23
  attr_accessor :language
24
24
 
25
+ # must be a relative url
25
26
  attr_accessor :magic_link_path
26
27
 
27
28
  attr_accessor :phone
@@ -118,14 +119,10 @@ module OpenapiClient
118
119
 
119
120
  if attributes.key?(:'channel')
120
121
  self.channel = attributes[:'channel']
121
- else
122
- self.channel = nil
123
122
  end
124
123
 
125
124
  if attributes.key?(:'email')
126
125
  self.email = attributes[:'email']
127
- else
128
- self.email = nil
129
126
  end
130
127
 
131
128
  if attributes.key?(:'language')
@@ -134,32 +131,22 @@ module OpenapiClient
134
131
 
135
132
  if attributes.key?(:'magic_link_path')
136
133
  self.magic_link_path = attributes[:'magic_link_path']
137
- else
138
- self.magic_link_path = nil
139
134
  end
140
135
 
141
136
  if attributes.key?(:'phone')
142
137
  self.phone = attributes[:'phone']
143
- else
144
- self.phone = nil
145
138
  end
146
139
 
147
140
  if attributes.key?(:'redirect_url')
148
141
  self.redirect_url = attributes[:'redirect_url']
149
- else
150
- self.redirect_url = nil
151
142
  end
152
143
 
153
144
  if attributes.key?(:'_send')
154
145
  self._send = attributes[:'_send']
155
- else
156
- self._send = nil
157
146
  end
158
147
 
159
148
  if attributes.key?(:'ttl')
160
149
  self.ttl = attributes[:'ttl']
161
- else
162
- self.ttl = nil
163
150
  end
164
151
 
165
152
  if attributes.key?(:'type')
@@ -168,8 +155,6 @@ module OpenapiClient
168
155
 
169
156
  if attributes.key?(:'user_id')
170
157
  self.user_id = attributes[:'user_id']
171
- else
172
- self.user_id = nil
173
158
  end
174
159
  end
175
160
 
@@ -178,38 +163,6 @@ module OpenapiClient
178
163
  def list_invalid_properties
179
164
  warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
180
165
  invalid_properties = Array.new
181
- if @channel.nil?
182
- invalid_properties.push('invalid value for "channel", channel cannot be nil.')
183
- end
184
-
185
- if @email.nil?
186
- invalid_properties.push('invalid value for "email", email cannot be nil.')
187
- end
188
-
189
- if @magic_link_path.nil?
190
- invalid_properties.push('invalid value for "magic_link_path", magic_link_path cannot be nil.')
191
- end
192
-
193
- if @phone.nil?
194
- invalid_properties.push('invalid value for "phone", phone cannot be nil.')
195
- end
196
-
197
- if @redirect_url.nil?
198
- invalid_properties.push('invalid value for "redirect_url", redirect_url cannot be nil.')
199
- end
200
-
201
- if @_send.nil?
202
- invalid_properties.push('invalid value for "_send", _send cannot be nil.')
203
- end
204
-
205
- if @ttl.nil?
206
- invalid_properties.push('invalid value for "ttl", ttl cannot be nil.')
207
- end
208
-
209
- if @user_id.nil?
210
- invalid_properties.push('invalid value for "user_id", user_id cannot be nil.')
211
- end
212
-
213
166
  invalid_properties
214
167
  end
215
168
 
@@ -217,14 +170,6 @@ module OpenapiClient
217
170
  # @return true if the model is valid
218
171
  def valid?
219
172
  warn '[DEPRECATED] the `valid?` method is obsolete'
220
- return false if @channel.nil?
221
- return false if @email.nil?
222
- return false if @magic_link_path.nil?
223
- return false if @phone.nil?
224
- return false if @redirect_url.nil?
225
- return false if @_send.nil?
226
- return false if @ttl.nil?
227
- return false if @user_id.nil?
228
173
  true
229
174
  end
230
175