Class: Mudbase::AuthenticationApi

Inherits:
Object
  • Object
show all
Defined in:
lib/mudbase/api/authentication_api.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(api_client = ApiClient.default) ⇒ AuthenticationApi

Returns a new instance of AuthenticationApi.



19
20
21
# File 'lib/mudbase/api/authentication_api.rb', line 19

def initialize(api_client = ApiClient.default)
  @api_client = api_client
end

Instance Attribute Details

#api_clientObject

Returns the value of attribute api_client.



17
18
19
# File 'lib/mudbase/api/authentication_api.rb', line 17

def api_client
  @api_client
end

Instance Method Details

#accept_invite(accept_invite_request, opts = {}) ⇒ AcceptInvite201Response

Accept organization invitation Accept an organization invitation using the token from the invite email link (e.g. /invite/{token}?orgId=...). Creates a new user with the invited email and adds them to the organization with the invited role. Returns a JWT and user so the client can log the user in immediately. No authentication required.

Parameters:

  • accept_invite_request (AcceptInviteRequest)
  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



27
28
29
30
# File 'lib/mudbase/api/authentication_api.rb', line 27

def accept_invite(accept_invite_request, opts = {})
  data, _status_code, _headers = accept_invite_with_http_info(accept_invite_request, opts)
  data
end

#accept_invite_with_http_info(accept_invite_request, opts = {}) ⇒ Array<(AcceptInvite201Response, Integer, Hash)>

Accept organization invitation Accept an organization invitation using the token from the invite email link (e.g. `/invite/token?orgId=...`). Creates a new user with the invited email and adds them to the organization with the invited role. Returns a JWT and user so the client can log the user in immediately. No authentication required.

Parameters:

  • accept_invite_request (AcceptInviteRequest)
  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(AcceptInvite201Response, Integer, Hash)>)

    AcceptInvite201Response data, response status code and response headers



37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
# File 'lib/mudbase/api/authentication_api.rb', line 37

def accept_invite_with_http_info(accept_invite_request, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: AuthenticationApi.accept_invite ...'
  end
  # verify the required parameter 'accept_invite_request' is set
  if @api_client.config.client_side_validation && accept_invite_request.nil?
    fail ArgumentError, "Missing the required parameter 'accept_invite_request' when calling AuthenticationApi.accept_invite"
  end
  # resource path
  local_var_path = '/api/auth/accept-invite'

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
  # HTTP header 'Content-Type'
  content_type = @api_client.select_header_content_type(['application/json'])
  if !content_type.nil?
      header_params['Content-Type'] = content_type
  end

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body] || @api_client.object_to_http_body(accept_invite_request)

  # return_type
  return_type = opts[:debug_return_type] || 'AcceptInvite201Response'

  # auth_names
  auth_names = opts[:debug_auth_names] || []

  new_options = opts.merge(
    :operation => :"AuthenticationApi.accept_invite",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: AuthenticationApi#accept_invite\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#confirm_local_password_reset_with_otp(confirm_local_password_reset_with_otp_request, opts = {}) ⇒ MessageResponse

Confirm password reset with OTP (project-based) Set new password using the OTP sent to the user's email. Call after POST /api/auth/local/password-reset with projectId. Rate limited (OTP limit). If the user's email was not yet verified, it is marked as verified upon successful reset.

Parameters:

Returns:



95
96
97
98
# File 'lib/mudbase/api/authentication_api.rb', line 95

def confirm_local_password_reset_with_otp(confirm_local_password_reset_with_otp_request, opts = {})
  data, _status_code, _headers = confirm_local_password_reset_with_otp_with_http_info(confirm_local_password_reset_with_otp_request, opts)
  data
end

#confirm_local_password_reset_with_otp_with_http_info(confirm_local_password_reset_with_otp_request, opts = {}) ⇒ Array<(MessageResponse, Integer, Hash)>

Confirm password reset with OTP (project-based) Set new password using the OTP sent to the user's email. Call after POST /api/auth/local/password-reset with projectId. Rate limited (OTP limit). If the user's email was not yet verified, it is marked as verified upon successful reset.

Parameters:

Returns:

  • (Array<(MessageResponse, Integer, Hash)>)

    MessageResponse data, response status code and response headers



105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
# File 'lib/mudbase/api/authentication_api.rb', line 105

def confirm_local_password_reset_with_otp_with_http_info(confirm_local_password_reset_with_otp_request, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: AuthenticationApi.confirm_local_password_reset_with_otp ...'
  end
  # verify the required parameter 'confirm_local_password_reset_with_otp_request' is set
  if @api_client.config.client_side_validation && confirm_local_password_reset_with_otp_request.nil?
    fail ArgumentError, "Missing the required parameter 'confirm_local_password_reset_with_otp_request' when calling AuthenticationApi.confirm_local_password_reset_with_otp"
  end
  # resource path
  local_var_path = '/api/auth/local/password-reset/confirm'

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
  # HTTP header 'Content-Type'
  content_type = @api_client.select_header_content_type(['application/json'])
  if !content_type.nil?
      header_params['Content-Type'] = content_type
  end

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body] || @api_client.object_to_http_body(confirm_local_password_reset_with_otp_request)

  # return_type
  return_type = opts[:debug_return_type] || 'MessageResponse'

  # auth_names
  auth_names = opts[:debug_auth_names] || []

  new_options = opts.merge(
    :operation => :"AuthenticationApi.confirm_local_password_reset_with_otp",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: AuthenticationApi#confirm_local_password_reset_with_otp\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#convert_anonymous_account(convert_anonymous_account_request, opts = {}) ⇒ ConvertAnonymousAccount200Response

Convert anonymous account to full account Convert an anonymous user session to a full authenticated account. Preserves user data. Requires JWT Bearer token authentication. Both OrgBearerAuth and ProjectBearerAuth are supported (they use the same JWT token format). API keys are not supported for this endpoint.

Parameters:

Returns:



163
164
165
166
# File 'lib/mudbase/api/authentication_api.rb', line 163

def (, opts = {})
  data, _status_code, _headers = (, opts)
  data
end

#convert_anonymous_account_with_http_info(convert_anonymous_account_request, opts = {}) ⇒ Array<(ConvertAnonymousAccount200Response, Integer, Hash)>

Convert anonymous account to full account Convert an anonymous user session to a full authenticated account. Preserves user data. Requires JWT Bearer token authentication. Both OrgBearerAuth and ProjectBearerAuth are supported (they use the same JWT token format). API keys are not supported for this endpoint.

Parameters:

Returns:



173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
# File 'lib/mudbase/api/authentication_api.rb', line 173

def (, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: AuthenticationApi.convert_anonymous_account ...'
  end
  # verify the required parameter 'convert_anonymous_account_request' is set
  if @api_client.config.client_side_validation && .nil?
    fail ArgumentError, "Missing the required parameter 'convert_anonymous_account_request' when calling AuthenticationApi.convert_anonymous_account"
  end
  # resource path
  local_var_path = '/api/auth/anonymous/convert'

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
  # HTTP header 'Content-Type'
  content_type = @api_client.select_header_content_type(['application/json'])
  if !content_type.nil?
      header_params['Content-Type'] = content_type
  end

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body] || @api_client.object_to_http_body()

  # return_type
  return_type = opts[:debug_return_type] || 'ConvertAnonymousAccount200Response'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['OrgBearerAuth', 'ProjectBearerAuth']

  new_options = opts.merge(
    :operation => :"AuthenticationApi.convert_anonymous_account",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: AuthenticationApi#convert_anonymous_account\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#create_anonymous_session(opts = {}) ⇒ CreateAnonymousSession200Response

Create anonymous session Create an anonymous user session for guest access. Users can later convert to full accounts.

Parameters:

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

Returns:



231
232
233
234
# File 'lib/mudbase/api/authentication_api.rb', line 231

def create_anonymous_session(opts = {})
  data, _status_code, _headers = create_anonymous_session_with_http_info(opts)
  data
end

#create_anonymous_session_with_http_info(opts = {}) ⇒ Array<(CreateAnonymousSession200Response, Integer, Hash)>

Create anonymous session Create an anonymous user session for guest access. Users can later convert to full accounts.

Parameters:

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

Returns:



241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
# File 'lib/mudbase/api/authentication_api.rb', line 241

def create_anonymous_session_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: AuthenticationApi.create_anonymous_session ...'
  end
  # resource path
  local_var_path = '/api/auth/anonymous'

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
  # HTTP header 'Content-Type'
  content_type = @api_client.select_header_content_type(['application/json'])
  if !content_type.nil?
      header_params['Content-Type'] = content_type
  end

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body] || @api_client.object_to_http_body(opts[:'create_anonymous_session_request'])

  # return_type
  return_type = opts[:debug_return_type] || 'CreateAnonymousSession200Response'

  # auth_names
  auth_names = opts[:debug_auth_names] || []

  new_options = opts.merge(
    :operation => :"AuthenticationApi.create_anonymous_session",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: AuthenticationApi#create_anonymous_session\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_available_o_auth_providers(opts = {}) ⇒ GetAvailableOAuthProviders200Response

Get all available OAuth providers Returns a list of all supported OAuth providers with their configuration details

Parameters:

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



294
295
296
297
# File 'lib/mudbase/api/authentication_api.rb', line 294

def get_available_o_auth_providers(opts = {})
  data, _status_code, _headers = get_available_o_auth_providers_with_http_info(opts)
  data
end

#get_available_o_auth_providers_with_http_info(opts = {}) ⇒ Array<(GetAvailableOAuthProviders200Response, Integer, Hash)>

Get all available OAuth providers Returns a list of all supported OAuth providers with their configuration details

Parameters:

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
# File 'lib/mudbase/api/authentication_api.rb', line 303

def get_available_o_auth_providers_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: AuthenticationApi.get_available_o_auth_providers ...'
  end
  # resource path
  local_var_path = '/api/auth/oauth/providers/available'

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'GetAvailableOAuthProviders200Response'

  # auth_names
  auth_names = opts[:debug_auth_names] || []

  new_options = opts.merge(
    :operation => :"AuthenticationApi.get_available_o_auth_providers",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: AuthenticationApi#get_available_o_auth_providers\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_current_session(opts = {}) ⇒ SessionResponse

Get current session Get the current authenticated user session information. Requires JWT Bearer token authentication. Both OrgBearerAuth and ProjectBearerAuth are supported (they use the same JWT token format). API keys are not supported for this endpoint.

Parameters:

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



351
352
353
354
# File 'lib/mudbase/api/authentication_api.rb', line 351

def get_current_session(opts = {})
  data, _status_code, _headers = get_current_session_with_http_info(opts)
  data
end

#get_current_session_with_http_info(opts = {}) ⇒ Array<(SessionResponse, Integer, Hash)>

Get current session Get the current authenticated user session information. Requires JWT Bearer token authentication. Both OrgBearerAuth and ProjectBearerAuth are supported (they use the same JWT token format). API keys are not supported for this endpoint.

Parameters:

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(SessionResponse, Integer, Hash)>)

    SessionResponse data, response status code and response headers



360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
# File 'lib/mudbase/api/authentication_api.rb', line 360

def get_current_session_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: AuthenticationApi.get_current_session ...'
  end
  # resource path
  local_var_path = '/api/auth/session'

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'SessionResponse'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['OrgBearerAuth', 'ProjectBearerAuth']

  new_options = opts.merge(
    :operation => :"AuthenticationApi.get_current_session",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: AuthenticationApi#get_current_session\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_local_session(opts = {}) ⇒ GetLocalSession200Response

Get current session (project-based) Get the current authenticated user session (project-based). Requires JWT Bearer token authentication. Both OrgBearerAuth and ProjectBearerAuth are supported (they use the same JWT token format). API keys are not supported for this endpoint.

Parameters:

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :project_id (String)

Returns:



409
410
411
412
# File 'lib/mudbase/api/authentication_api.rb', line 409

def get_local_session(opts = {})
  data, _status_code, _headers = get_local_session_with_http_info(opts)
  data
end

#get_local_session_with_http_info(opts = {}) ⇒ Array<(GetLocalSession200Response, Integer, Hash)>

Get current session (project-based) Get the current authenticated user session (project-based). Requires JWT Bearer token authentication. Both OrgBearerAuth and ProjectBearerAuth are supported (they use the same JWT token format). API keys are not supported for this endpoint.

Parameters:

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :project_id (String)

Returns:

  • (Array<(GetLocalSession200Response, Integer, Hash)>)

    GetLocalSession200Response data, response status code and response headers



419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
# File 'lib/mudbase/api/authentication_api.rb', line 419

def get_local_session_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: AuthenticationApi.get_local_session ...'
  end
  # resource path
  local_var_path = '/api/auth/local/session'

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'projectId'] = opts[:'project_id'] if !opts[:'project_id'].nil?

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'GetLocalSession200Response'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['OrgBearerAuth', 'ProjectBearerAuth']

  new_options = opts.merge(
    :operation => :"AuthenticationApi.get_local_session",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: AuthenticationApi#get_local_session\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_org_o_auth_providers(opts = {}) ⇒ GetOrgOAuthProviders200Response

Get available OAuth providers for organization-based auth Returns a list of OAuth providers that are configured and available for organization-based authentication. Providers are configured via environment variables (e.g., GOOGLE_CLIENT_ID, GITHUB_CLIENT_ID).

Parameters:

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



468
469
470
471
# File 'lib/mudbase/api/authentication_api.rb', line 468

def get_org_o_auth_providers(opts = {})
  data, _status_code, _headers = get_org_o_auth_providers_with_http_info(opts)
  data
end

#get_org_o_auth_providers_with_http_info(opts = {}) ⇒ Array<(GetOrgOAuthProviders200Response, Integer, Hash)>

Get available OAuth providers for organization-based auth Returns a list of OAuth providers that are configured and available for organization-based authentication. Providers are configured via environment variables (e.g., GOOGLE_CLIENT_ID, GITHUB_CLIENT_ID).

Parameters:

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
# File 'lib/mudbase/api/authentication_api.rb', line 477

def get_org_o_auth_providers_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: AuthenticationApi.get_org_o_auth_providers ...'
  end
  # resource path
  local_var_path = '/api/auth/oauth-org/providers'

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'GetOrgOAuthProviders200Response'

  # auth_names
  auth_names = opts[:debug_auth_names] || []

  new_options = opts.merge(
    :operation => :"AuthenticationApi.get_org_o_auth_providers",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: AuthenticationApi#get_org_o_auth_providers\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#initiate_o_auth(provider, project_id, opts = {}) ⇒ nil

Initiate OAuth authentication Initiates OAuth authentication flow for a specified provider and project. The OAuth provider must be configured and enabled for the project first. Returns an HTTP 302 redirect to the OAuth provider's consent screen. Note: Swagger "Try it out" may show "Failed to fetch" for this endpoint due to browser CORS restrictions on cross-origin redirects. Use top-level browser navigation or curl to test.

Parameters:

  • provider (String)
  • project_id (String)
  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :redirect_url (String)

    The URL to redirect to after authentication. Must be pre-registered in project settings.

Returns:

  • (nil)


528
529
530
531
# File 'lib/mudbase/api/authentication_api.rb', line 528

def initiate_o_auth(provider, project_id, opts = {})
  initiate_o_auth_with_http_info(provider, project_id, opts)
  nil
end

#initiate_o_auth_with_http_info(provider, project_id, opts = {}) ⇒ Array<(nil, Integer, Hash)>

Initiate OAuth authentication Initiates OAuth authentication flow for a specified provider and project. The OAuth provider must be configured and enabled for the project first. Returns an HTTP 302 redirect to the OAuth provider's consent screen. Note: Swagger &quot;Try it out&quot; may show &quot;Failed to fetch&quot; for this endpoint due to browser CORS restrictions on cross-origin redirects. Use top-level browser navigation or curl to test.

Parameters:

  • provider (String)
  • project_id (String)
  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :redirect_url (String)

    The URL to redirect to after authentication. Must be pre-registered in project settings.

Returns:

  • (Array<(nil, Integer, Hash)>)

    nil, response status code and response headers



540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
# File 'lib/mudbase/api/authentication_api.rb', line 540

def initiate_o_auth_with_http_info(provider, project_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: AuthenticationApi.initiate_o_auth ...'
  end
  # verify the required parameter 'provider' is set
  if @api_client.config.client_side_validation && provider.nil?
    fail ArgumentError, "Missing the required parameter 'provider' when calling AuthenticationApi.initiate_o_auth"
  end
  # verify enum value
  allowable_values = ["google", "github", "facebook", "microsoft", "apple", "twitter", "discord", "linkedin", "dropbox", "slack", "reddit", "twitch", "figma", "zoom", "bitbucket", "salesforce", "shopify", "line", "spotify", "strava", "paypal", "asana", "trello", "okta", "gitea", "yandex", "yahoo", "vk", "meetup"]
  if @api_client.config.client_side_validation && !allowable_values.include?(provider)
    fail ArgumentError, "invalid value for \"provider\", must be one of #{allowable_values}"
  end
  # verify the required parameter 'project_id' is set
  if @api_client.config.client_side_validation && project_id.nil?
    fail ArgumentError, "Missing the required parameter 'project_id' when calling AuthenticationApi.initiate_o_auth"
  end
  # resource path
  local_var_path = '/api/auth/oauth/{provider}/{projectId}'.sub('{' + 'provider' + '}', CGI.escape(provider.to_s)).sub('{' + 'projectId' + '}', CGI.escape(project_id.to_s))

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'redirect_url'] = opts[:'redirect_url'] if !opts[:'redirect_url'].nil?

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type]

  # auth_names
  auth_names = opts[:debug_auth_names] || []

  new_options = opts.merge(
    :operation => :"AuthenticationApi.initiate_o_auth",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: AuthenticationApi#initiate_o_auth\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#initiate_org_o_auth(provider, opts = {}) ⇒ nil

Initiate OAuth authentication for organization Initiates OAuth authentication flow for organization-level signup/login. The OAuth provider must be configured via environment variables (e.g., GOOGLE_CLIENT_ID, GOOGLE_CLIENT_SECRET). After successful authentication, creates a new organization and user account, or logs in existing user.

Parameters:

  • provider (String)
  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :redirect_url (String)

    The URL to redirect to after authentication

Returns:

  • (nil)


604
605
606
607
# File 'lib/mudbase/api/authentication_api.rb', line 604

def initiate_org_o_auth(provider, opts = {})
  initiate_org_o_auth_with_http_info(provider, opts)
  nil
end

#initiate_org_o_auth_with_http_info(provider, opts = {}) ⇒ Array<(nil, Integer, Hash)>

Initiate OAuth authentication for organization Initiates OAuth authentication flow for organization-level signup/login. The OAuth provider must be configured via environment variables (e.g., GOOGLE_CLIENT_ID, GOOGLE_CLIENT_SECRET). After successful authentication, creates a new organization and user account, or logs in existing user.

Parameters:

  • provider (String)
  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :redirect_url (String)

    The URL to redirect to after authentication

Returns:

  • (Array<(nil, Integer, Hash)>)

    nil, response status code and response headers



615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
# File 'lib/mudbase/api/authentication_api.rb', line 615

def initiate_org_o_auth_with_http_info(provider, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: AuthenticationApi.initiate_org_o_auth ...'
  end
  # verify the required parameter 'provider' is set
  if @api_client.config.client_side_validation && provider.nil?
    fail ArgumentError, "Missing the required parameter 'provider' when calling AuthenticationApi.initiate_org_o_auth"
  end
  # verify enum value
  allowable_values = ["google", "github", "facebook", "microsoft", "discord", "linkedin"]
  if @api_client.config.client_side_validation && !allowable_values.include?(provider)
    fail ArgumentError, "invalid value for \"provider\", must be one of #{allowable_values}"
  end
  # resource path
  local_var_path = '/api/auth/oauth-org/{provider}'.sub('{' + 'provider' + '}', CGI.escape(provider.to_s))

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'redirect_url'] = opts[:'redirect_url'] if !opts[:'redirect_url'].nil?

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type]

  # auth_names
  auth_names = opts[:debug_auth_names] || []

  new_options = opts.merge(
    :operation => :"AuthenticationApi.initiate_org_o_auth",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: AuthenticationApi#initiate_org_o_auth\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#login_local_user(login_local_user_request, opts = {}) ⇒ LoginLocalUser200Response

Login user (project-based) When the project has requireEmailVerification enabled and the user has not verified their email, returns 403 with code EMAIL_VERIFICATION_REQUIRED (user must verify email first, then login again).

Parameters:

  • login_local_user_request (LoginLocalUserRequest)
  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



674
675
676
677
# File 'lib/mudbase/api/authentication_api.rb', line 674

def (, opts = {})
  data, _status_code, _headers = (, opts)
  data
end

#login_local_user_with_http_info(login_local_user_request, opts = {}) ⇒ Array<(LoginLocalUser200Response, Integer, Hash)>

Login user (project-based) When the project has requireEmailVerification enabled and the user has not verified their email, returns 403 with code EMAIL_VERIFICATION_REQUIRED (user must verify email first, then login again).

Parameters:

  • login_local_user_request (LoginLocalUserRequest)
  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(LoginLocalUser200Response, Integer, Hash)>)

    LoginLocalUser200Response data, response status code and response headers



684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
# File 'lib/mudbase/api/authentication_api.rb', line 684

def (, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: AuthenticationApi.login_local_user ...'
  end
  # verify the required parameter 'login_local_user_request' is set
  if @api_client.config.client_side_validation && .nil?
    fail ArgumentError, "Missing the required parameter 'login_local_user_request' when calling AuthenticationApi.login_local_user"
  end
  # resource path
  local_var_path = '/api/auth/local/login'

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
  # HTTP header 'Content-Type'
  content_type = @api_client.select_header_content_type(['application/json'])
  if !content_type.nil?
      header_params['Content-Type'] = content_type
  end

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body] || @api_client.object_to_http_body()

  # return_type
  return_type = opts[:debug_return_type] || 'LoginLocalUser200Response'

  # auth_names
  auth_names = opts[:debug_auth_names] || []

  new_options = opts.merge(
    :operation => :"AuthenticationApi.login_local_user",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: AuthenticationApi#login_local_user\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#login_user(login_request, opts = {}) ⇒ AuthResponse

Login user

Parameters:

  • login_request (LoginRequest)
  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



741
742
743
744
# File 'lib/mudbase/api/authentication_api.rb', line 741

def (, opts = {})
  data, _status_code, _headers = (, opts)
  data
end

#login_user_with_http_info(login_request, opts = {}) ⇒ Array<(AuthResponse, Integer, Hash)>

Login user

Parameters:

  • login_request (LoginRequest)
  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(AuthResponse, Integer, Hash)>)

    AuthResponse data, response status code and response headers



750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
# File 'lib/mudbase/api/authentication_api.rb', line 750

def (, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: AuthenticationApi.login_user ...'
  end
  # verify the required parameter 'login_request' is set
  if @api_client.config.client_side_validation && .nil?
    fail ArgumentError, "Missing the required parameter 'login_request' when calling AuthenticationApi.login_user"
  end
  # resource path
  local_var_path = '/api/auth/login'

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
  # HTTP header 'Content-Type'
  content_type = @api_client.select_header_content_type(['application/json'])
  if !content_type.nil?
      header_params['Content-Type'] = content_type
  end

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body] || @api_client.object_to_http_body()

  # return_type
  return_type = opts[:debug_return_type] || 'AuthResponse'

  # auth_names
  auth_names = opts[:debug_auth_names] || []

  new_options = opts.merge(
    :operation => :"AuthenticationApi.login_user",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: AuthenticationApi#login_user\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#logout_local_user(opts = {}) ⇒ MessageResponse

Logout user (project-based) Logout the current authenticated user session (project-based). Requires JWT Bearer token authentication. Both OrgBearerAuth and ProjectBearerAuth are supported (they use the same JWT token format). API keys are not supported for this endpoint.

Parameters:

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



807
808
809
810
# File 'lib/mudbase/api/authentication_api.rb', line 807

def logout_local_user(opts = {})
  data, _status_code, _headers = logout_local_user_with_http_info(opts)
  data
end

#logout_local_user_with_http_info(opts = {}) ⇒ Array<(MessageResponse, Integer, Hash)>

Logout user (project-based) Logout the current authenticated user session (project-based). Requires JWT Bearer token authentication. Both OrgBearerAuth and ProjectBearerAuth are supported (they use the same JWT token format). API keys are not supported for this endpoint.

Parameters:

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(MessageResponse, Integer, Hash)>)

    MessageResponse data, response status code and response headers



816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
# File 'lib/mudbase/api/authentication_api.rb', line 816

def logout_local_user_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: AuthenticationApi.logout_local_user ...'
  end
  # resource path
  local_var_path = '/api/auth/local/logout'

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'MessageResponse'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['OrgBearerAuth', 'ProjectBearerAuth']

  new_options = opts.merge(
    :operation => :"AuthenticationApi.logout_local_user",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: AuthenticationApi#logout_local_user\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#logout_user(opts = {}) ⇒ MessageResponse

Logout user Logout the current authenticated user session. Requires JWT Bearer token authentication. Both OrgBearerAuth and ProjectBearerAuth are supported (they use the same JWT token format). API keys are not supported for this endpoint.

Parameters:

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



864
865
866
867
# File 'lib/mudbase/api/authentication_api.rb', line 864

def logout_user(opts = {})
  data, _status_code, _headers = logout_user_with_http_info(opts)
  data
end

#logout_user_with_http_info(opts = {}) ⇒ Array<(MessageResponse, Integer, Hash)>

Logout user Logout the current authenticated user session. Requires JWT Bearer token authentication. Both OrgBearerAuth and ProjectBearerAuth are supported (they use the same JWT token format). API keys are not supported for this endpoint.

Parameters:

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(MessageResponse, Integer, Hash)>)

    MessageResponse data, response status code and response headers



873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
# File 'lib/mudbase/api/authentication_api.rb', line 873

def logout_user_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: AuthenticationApi.logout_user ...'
  end
  # resource path
  local_var_path = '/api/auth/logout'

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'MessageResponse'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['OrgBearerAuth', 'ProjectBearerAuth']

  new_options = opts.merge(
    :operation => :"AuthenticationApi.logout_user",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: AuthenticationApi#logout_user\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#oauth_callback(provider, opts = {}) ⇒ nil

OAuth callback handler (project-based) Handles OAuth callback for project-based authentication. This route must be matched before /api/auth/oauth/provider/projectId. Redirects to frontend with query params token, refreshToken, and expiresIn.

Parameters:

  • provider (String)
  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (nil)


922
923
924
925
# File 'lib/mudbase/api/authentication_api.rb', line 922

def oauth_callback(provider, opts = {})
  oauth_callback_with_http_info(provider, opts)
  nil
end

#oauth_callback_with_http_info(provider, opts = {}) ⇒ Array<(nil, Integer, Hash)>

OAuth callback handler (project-based) Handles OAuth callback for project-based authentication. This route must be matched before /api/auth/oauth/provider/projectId. Redirects to frontend with query params token, refreshToken, and expiresIn.

Parameters:

  • provider (String)
  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(nil, Integer, Hash)>)

    nil, response status code and response headers



932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
# File 'lib/mudbase/api/authentication_api.rb', line 932

def oauth_callback_with_http_info(provider, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: AuthenticationApi.oauth_callback ...'
  end
  # verify the required parameter 'provider' is set
  if @api_client.config.client_side_validation && provider.nil?
    fail ArgumentError, "Missing the required parameter 'provider' when calling AuthenticationApi.oauth_callback"
  end
  # resource path
  local_var_path = '/api/auth/oauth/callback/{provider}'.sub('{' + 'provider' + '}', CGI.escape(provider.to_s))

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type]

  # auth_names
  auth_names = opts[:debug_auth_names] || []

  new_options = opts.merge(
    :operation => :"AuthenticationApi.oauth_callback",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: AuthenticationApi#oauth_callback\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#org_o_auth_callback(provider, opts = {}) ⇒ nil

OAuth callback handler for organization Handles OAuth callback for organization-based authentication. Creates a new organization and user account if the user doesn't exist, or logs in existing user. Redirects to frontend with query params token, refreshToken, and expiresIn.

Parameters:

  • provider (String)
  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :code (String)

    Authorization code from OAuth provider

  • :state (String)

    State parameter for CSRF protection

Returns:

  • (nil)


987
988
989
990
# File 'lib/mudbase/api/authentication_api.rb', line 987

def org_o_auth_callback(provider, opts = {})
  org_o_auth_callback_with_http_info(provider, opts)
  nil
end

#org_o_auth_callback_with_http_info(provider, opts = {}) ⇒ Array<(nil, Integer, Hash)>

OAuth callback handler for organization Handles OAuth callback for organization-based authentication. Creates a new organization and user account if the user doesn't exist, or logs in existing user. Redirects to frontend with query params token, refreshToken, and expiresIn.

Parameters:

  • provider (String)
  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :code (String)

    Authorization code from OAuth provider

  • :state (String)

    State parameter for CSRF protection

Returns:

  • (Array<(nil, Integer, Hash)>)

    nil, response status code and response headers



999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
# File 'lib/mudbase/api/authentication_api.rb', line 999

def org_o_auth_callback_with_http_info(provider, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: AuthenticationApi.org_o_auth_callback ...'
  end
  # verify the required parameter 'provider' is set
  if @api_client.config.client_side_validation && provider.nil?
    fail ArgumentError, "Missing the required parameter 'provider' when calling AuthenticationApi.org_o_auth_callback"
  end
  # verify enum value
  allowable_values = ["google", "github", "facebook", "microsoft", "discord", "linkedin"]
  if @api_client.config.client_side_validation && !allowable_values.include?(provider)
    fail ArgumentError, "invalid value for \"provider\", must be one of #{allowable_values}"
  end
  # resource path
  local_var_path = '/api/auth/oauth-org/callback/{provider}'.sub('{' + 'provider' + '}', CGI.escape(provider.to_s))

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'code'] = opts[:'code'] if !opts[:'code'].nil?
  query_params[:'state'] = opts[:'state'] if !opts[:'state'].nil?

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type]

  # auth_names
  auth_names = opts[:debug_auth_names] || []

  new_options = opts.merge(
    :operation => :"AuthenticationApi.org_o_auth_callback",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: AuthenticationApi#org_o_auth_callback\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#refresh_token(refresh_token_request, opts = {}) ⇒ RefreshToken200Response

Refresh access token (org and project) Exchange a valid refresh token for a new JWT access token and refresh token. Works for both org-based (platform/dashboard) and project-based auth; the same endpoint is used. The previous refresh token is invalidated (rotation). If the same refresh token is used again, the session is revoked (reuse detection).

Parameters:

  • refresh_token_request (RefreshTokenRequest)
  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



1059
1060
1061
1062
# File 'lib/mudbase/api/authentication_api.rb', line 1059

def refresh_token(refresh_token_request, opts = {})
  data, _status_code, _headers = refresh_token_with_http_info(refresh_token_request, opts)
  data
end

#refresh_token_with_http_info(refresh_token_request, opts = {}) ⇒ Array<(RefreshToken200Response, Integer, Hash)>

Refresh access token (org and project) Exchange a valid refresh token for a new JWT access token and refresh token. Works for both org-based (platform/dashboard) and project-based auth; the same endpoint is used. The previous refresh token is invalidated (rotation). If the same refresh token is used again, the session is revoked (reuse detection).

Parameters:

  • refresh_token_request (RefreshTokenRequest)
  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(RefreshToken200Response, Integer, Hash)>)

    RefreshToken200Response data, response status code and response headers



1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
# File 'lib/mudbase/api/authentication_api.rb', line 1069

def refresh_token_with_http_info(refresh_token_request, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: AuthenticationApi.refresh_token ...'
  end
  # verify the required parameter 'refresh_token_request' is set
  if @api_client.config.client_side_validation && refresh_token_request.nil?
    fail ArgumentError, "Missing the required parameter 'refresh_token_request' when calling AuthenticationApi.refresh_token"
  end
  # resource path
  local_var_path = '/api/auth/refresh'

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
  # HTTP header 'Content-Type'
  content_type = @api_client.select_header_content_type(['application/json'])
  if !content_type.nil?
      header_params['Content-Type'] = content_type
  end

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body] || @api_client.object_to_http_body(refresh_token_request)

  # return_type
  return_type = opts[:debug_return_type] || 'RefreshToken200Response'

  # auth_names
  auth_names = opts[:debug_auth_names] || []

  new_options = opts.merge(
    :operation => :"AuthenticationApi.refresh_token",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: AuthenticationApi#refresh_token\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#register_local_user(register_local_user_request, opts = {}) ⇒ RegisterLocalUser201Response

Register new user (project-based) When the project has requireEmailVerification enabled (default), the response is 201 with requireVerification: true and no token; the user must verify their email then sign in via login. When email verification is disabled, a token and refreshToken are returned.

Parameters:

Returns:



1127
1128
1129
1130
# File 'lib/mudbase/api/authentication_api.rb', line 1127

def register_local_user(register_local_user_request, opts = {})
  data, _status_code, _headers = register_local_user_with_http_info(register_local_user_request, opts)
  data
end

#register_local_user_with_http_info(register_local_user_request, opts = {}) ⇒ Array<(RegisterLocalUser201Response, Integer, Hash)>

Register new user (project-based) When the project has requireEmailVerification enabled (default), the response is 201 with requireVerification: true and no token; the user must verify their email then sign in via login. When email verification is disabled, a token and refreshToken are returned.

Parameters:

Returns:



1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
# File 'lib/mudbase/api/authentication_api.rb', line 1137

def register_local_user_with_http_info(register_local_user_request, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: AuthenticationApi.register_local_user ...'
  end
  # verify the required parameter 'register_local_user_request' is set
  if @api_client.config.client_side_validation && register_local_user_request.nil?
    fail ArgumentError, "Missing the required parameter 'register_local_user_request' when calling AuthenticationApi.register_local_user"
  end
  # resource path
  local_var_path = '/api/auth/local/register'

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
  # HTTP header 'Content-Type'
  content_type = @api_client.select_header_content_type(['application/json'])
  if !content_type.nil?
      header_params['Content-Type'] = content_type
  end

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body] || @api_client.object_to_http_body(register_local_user_request)

  # return_type
  return_type = opts[:debug_return_type] || 'RegisterLocalUser201Response'

  # auth_names
  auth_names = opts[:debug_auth_names] || []

  new_options = opts.merge(
    :operation => :"AuthenticationApi.register_local_user",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: AuthenticationApi#register_local_user\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#register_user(register_request, opts = {}) ⇒ AuthResponse

Register new user

Parameters:

  • register_request (RegisterRequest)
  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



1194
1195
1196
1197
# File 'lib/mudbase/api/authentication_api.rb', line 1194

def register_user(register_request, opts = {})
  data, _status_code, _headers = register_user_with_http_info(register_request, opts)
  data
end

#register_user_with_http_info(register_request, opts = {}) ⇒ Array<(AuthResponse, Integer, Hash)>

Register new user

Parameters:

  • register_request (RegisterRequest)
  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(AuthResponse, Integer, Hash)>)

    AuthResponse data, response status code and response headers



1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
# File 'lib/mudbase/api/authentication_api.rb', line 1203

def register_user_with_http_info(register_request, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: AuthenticationApi.register_user ...'
  end
  # verify the required parameter 'register_request' is set
  if @api_client.config.client_side_validation && register_request.nil?
    fail ArgumentError, "Missing the required parameter 'register_request' when calling AuthenticationApi.register_user"
  end
  # resource path
  local_var_path = '/api/auth/register'

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
  # HTTP header 'Content-Type'
  content_type = @api_client.select_header_content_type(['application/json'])
  if !content_type.nil?
      header_params['Content-Type'] = content_type
  end

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body] || @api_client.object_to_http_body(register_request)

  # return_type
  return_type = opts[:debug_return_type] || 'AuthResponse'

  # auth_names
  auth_names = opts[:debug_auth_names] || []

  new_options = opts.merge(
    :operation => :"AuthenticationApi.register_user",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: AuthenticationApi#register_user\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#request_local_password_reset(request_local_password_reset_request, opts = {}) ⇒ MessageResponse

Request password reset (project-based, OTP) When projectId is provided, sends a 6-digit OTP to the user's email (project-based reset uses OTP, not link). When projectId is omitted, sends a token link (org/platform local account). Rate limited.

Parameters:

Returns:



1261
1262
1263
1264
# File 'lib/mudbase/api/authentication_api.rb', line 1261

def request_local_password_reset(request_local_password_reset_request, opts = {})
  data, _status_code, _headers = request_local_password_reset_with_http_info(request_local_password_reset_request, opts)
  data
end

#request_local_password_reset_with_http_info(request_local_password_reset_request, opts = {}) ⇒ Array<(MessageResponse, Integer, Hash)>

Request password reset (project-based, OTP) When projectId is provided, sends a 6-digit OTP to the user's email (project-based reset uses OTP, not link). When projectId is omitted, sends a token link (org/platform local account). Rate limited.

Parameters:

Returns:

  • (Array<(MessageResponse, Integer, Hash)>)

    MessageResponse data, response status code and response headers



1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
# File 'lib/mudbase/api/authentication_api.rb', line 1271

def request_local_password_reset_with_http_info(request_local_password_reset_request, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: AuthenticationApi.request_local_password_reset ...'
  end
  # verify the required parameter 'request_local_password_reset_request' is set
  if @api_client.config.client_side_validation && request_local_password_reset_request.nil?
    fail ArgumentError, "Missing the required parameter 'request_local_password_reset_request' when calling AuthenticationApi.request_local_password_reset"
  end
  # resource path
  local_var_path = '/api/auth/local/password-reset'

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
  # HTTP header 'Content-Type'
  content_type = @api_client.select_header_content_type(['application/json'])
  if !content_type.nil?
      header_params['Content-Type'] = content_type
  end

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body] || @api_client.object_to_http_body(request_local_password_reset_request)

  # return_type
  return_type = opts[:debug_return_type] || 'MessageResponse'

  # auth_names
  auth_names = opts[:debug_auth_names] || []

  new_options = opts.merge(
    :operation => :"AuthenticationApi.request_local_password_reset",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: AuthenticationApi#request_local_password_reset\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#request_password_reset(request_password_reset_request, opts = {}) ⇒ MessageResponse

Request password reset (organization / platform) Sends a password reset link to the user's email. Use this for organization (platform) accounts. For project-based accounts use POST /api/auth/local/password-reset with projectId (sends OTP instead).

Parameters:

Returns:



1329
1330
1331
1332
# File 'lib/mudbase/api/authentication_api.rb', line 1329

def request_password_reset(request_password_reset_request, opts = {})
  data, _status_code, _headers = request_password_reset_with_http_info(request_password_reset_request, opts)
  data
end

#request_password_reset_with_http_info(request_password_reset_request, opts = {}) ⇒ Array<(MessageResponse, Integer, Hash)>

Request password reset (organization / platform) Sends a password reset link to the user's email. Use this for organization (platform) accounts. For project-based accounts use POST /api/auth/local/password-reset with projectId (sends OTP instead).

Parameters:

Returns:

  • (Array<(MessageResponse, Integer, Hash)>)

    MessageResponse data, response status code and response headers



1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
# File 'lib/mudbase/api/authentication_api.rb', line 1339

def request_password_reset_with_http_info(request_password_reset_request, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: AuthenticationApi.request_password_reset ...'
  end
  # verify the required parameter 'request_password_reset_request' is set
  if @api_client.config.client_side_validation && request_password_reset_request.nil?
    fail ArgumentError, "Missing the required parameter 'request_password_reset_request' when calling AuthenticationApi.request_password_reset"
  end
  # resource path
  local_var_path = '/api/auth/password-reset'

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
  # HTTP header 'Content-Type'
  content_type = @api_client.select_header_content_type(['application/json'])
  if !content_type.nil?
      header_params['Content-Type'] = content_type
  end

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body] || @api_client.object_to_http_body(request_password_reset_request)

  # return_type
  return_type = opts[:debug_return_type] || 'MessageResponse'

  # auth_names
  auth_names = opts[:debug_auth_names] || []

  new_options = opts.merge(
    :operation => :"AuthenticationApi.request_password_reset",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: AuthenticationApi#request_password_reset\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#resend_verification_auth(resend_verification_auth_request, opts = {}) ⇒ MessageResponse

Resend verification email (no auth) Sends a new verification email to the given email (and optional project). For unauthenticated users who have not verified yet. Rate limited (e.g. 3 per 15 min per IP).

Parameters:

Returns:



1397
1398
1399
1400
# File 'lib/mudbase/api/authentication_api.rb', line 1397

def resend_verification_auth(resend_verification_auth_request, opts = {})
  data, _status_code, _headers = resend_verification_auth_with_http_info(resend_verification_auth_request, opts)
  data
end

#resend_verification_auth_with_http_info(resend_verification_auth_request, opts = {}) ⇒ Array<(MessageResponse, Integer, Hash)>

Resend verification email (no auth) Sends a new verification email to the given email (and optional project). For unauthenticated users who have not verified yet. Rate limited (e.g. 3 per 15 min per IP).

Parameters:

Returns:

  • (Array<(MessageResponse, Integer, Hash)>)

    MessageResponse data, response status code and response headers



1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
1458
# File 'lib/mudbase/api/authentication_api.rb', line 1407

def resend_verification_auth_with_http_info(resend_verification_auth_request, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: AuthenticationApi.resend_verification_auth ...'
  end
  # verify the required parameter 'resend_verification_auth_request' is set
  if @api_client.config.client_side_validation && resend_verification_auth_request.nil?
    fail ArgumentError, "Missing the required parameter 'resend_verification_auth_request' when calling AuthenticationApi.resend_verification_auth"
  end
  # resource path
  local_var_path = '/api/auth/resend-verification'

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
  # HTTP header 'Content-Type'
  content_type = @api_client.select_header_content_type(['application/json'])
  if !content_type.nil?
      header_params['Content-Type'] = content_type
  end

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body] || @api_client.object_to_http_body(resend_verification_auth_request)

  # return_type
  return_type = opts[:debug_return_type] || 'MessageResponse'

  # auth_names
  auth_names = opts[:debug_auth_names] || []

  new_options = opts.merge(
    :operation => :"AuthenticationApi.resend_verification_auth",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: AuthenticationApi#resend_verification_auth\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#reset_local_password(token, reset_local_password_request, opts = {}) ⇒ MessageResponse

Reset password with token (project-based, legacy) Legacy token-based completion. Prefer OTP flow: use POST .../password-reset/confirm with the OTP sent to email for project-based resets.

Parameters:

  • token (String)
  • reset_local_password_request (ResetLocalPasswordRequest)
  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



1466
1467
1468
1469
# File 'lib/mudbase/api/authentication_api.rb', line 1466

def reset_local_password(token, reset_local_password_request, opts = {})
  data, _status_code, _headers = reset_local_password_with_http_info(token, reset_local_password_request, opts)
  data
end

#reset_local_password_with_http_info(token, reset_local_password_request, opts = {}) ⇒ Array<(MessageResponse, Integer, Hash)>

Reset password with token (project-based, legacy) Legacy token-based completion. Prefer OTP flow: use POST .../password-reset/confirm with the OTP sent to email for project-based resets.

Parameters:

  • token (String)
  • reset_local_password_request (ResetLocalPasswordRequest)
  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(MessageResponse, Integer, Hash)>)

    MessageResponse data, response status code and response headers



1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
1487
1488
1489
1490
1491
1492
1493
1494
1495
1496
1497
1498
1499
1500
1501
1502
1503
1504
1505
1506
1507
1508
1509
1510
1511
1512
1513
1514
1515
1516
1517
1518
1519
1520
1521
1522
1523
1524
1525
1526
1527
1528
1529
1530
1531
1532
# File 'lib/mudbase/api/authentication_api.rb', line 1477

def reset_local_password_with_http_info(token, reset_local_password_request, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: AuthenticationApi.reset_local_password ...'
  end
  # verify the required parameter 'token' is set
  if @api_client.config.client_side_validation && token.nil?
    fail ArgumentError, "Missing the required parameter 'token' when calling AuthenticationApi.reset_local_password"
  end
  # verify the required parameter 'reset_local_password_request' is set
  if @api_client.config.client_side_validation && reset_local_password_request.nil?
    fail ArgumentError, "Missing the required parameter 'reset_local_password_request' when calling AuthenticationApi.reset_local_password"
  end
  # resource path
  local_var_path = '/api/auth/local/password-reset/{token}'.sub('{' + 'token' + '}', CGI.escape(token.to_s))

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
  # HTTP header 'Content-Type'
  content_type = @api_client.select_header_content_type(['application/json'])
  if !content_type.nil?
      header_params['Content-Type'] = content_type
  end

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body] || @api_client.object_to_http_body(reset_local_password_request)

  # return_type
  return_type = opts[:debug_return_type] || 'MessageResponse'

  # auth_names
  auth_names = opts[:debug_auth_names] || []

  new_options = opts.merge(
    :operation => :"AuthenticationApi.reset_local_password",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: AuthenticationApi#reset_local_password\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#reset_password(token, reset_password_request, opts = {}) ⇒ MessageResponse

Reset password with token (organization / platform) Set new password using the token from the reset link. Validate the token first with POST /api/auth/password-reset/validate before showing the form. If the user's email was not yet verified, it is marked as verified upon successful reset.

Parameters:

  • token (String)
  • reset_password_request (ResetPasswordRequest)
  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



1540
1541
1542
1543
# File 'lib/mudbase/api/authentication_api.rb', line 1540

def reset_password(token, reset_password_request, opts = {})
  data, _status_code, _headers = reset_password_with_http_info(token, reset_password_request, opts)
  data
end

#reset_password_with_http_info(token, reset_password_request, opts = {}) ⇒ Array<(MessageResponse, Integer, Hash)>

Reset password with token (organization / platform) Set new password using the token from the reset link. Validate the token first with POST /api/auth/password-reset/validate before showing the form. If the user's email was not yet verified, it is marked as verified upon successful reset.

Parameters:

  • token (String)
  • reset_password_request (ResetPasswordRequest)
  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(MessageResponse, Integer, Hash)>)

    MessageResponse data, response status code and response headers



1551
1552
1553
1554
1555
1556
1557
1558
1559
1560
1561
1562
1563
1564
1565
1566
1567
1568
1569
1570
1571
1572
1573
1574
1575
1576
1577
1578
1579
1580
1581
1582
1583
1584
1585
1586
1587
1588
1589
1590
1591
1592
1593
1594
1595
1596
1597
1598
1599
1600
1601
1602
1603
1604
1605
1606
# File 'lib/mudbase/api/authentication_api.rb', line 1551

def reset_password_with_http_info(token, reset_password_request, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: AuthenticationApi.reset_password ...'
  end
  # verify the required parameter 'token' is set
  if @api_client.config.client_side_validation && token.nil?
    fail ArgumentError, "Missing the required parameter 'token' when calling AuthenticationApi.reset_password"
  end
  # verify the required parameter 'reset_password_request' is set
  if @api_client.config.client_side_validation && reset_password_request.nil?
    fail ArgumentError, "Missing the required parameter 'reset_password_request' when calling AuthenticationApi.reset_password"
  end
  # resource path
  local_var_path = '/api/auth/password-reset/{token}'.sub('{' + 'token' + '}', CGI.escape(token.to_s))

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
  # HTTP header 'Content-Type'
  content_type = @api_client.select_header_content_type(['application/json'])
  if !content_type.nil?
      header_params['Content-Type'] = content_type
  end

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body] || @api_client.object_to_http_body(reset_password_request)

  # return_type
  return_type = opts[:debug_return_type] || 'MessageResponse'

  # auth_names
  auth_names = opts[:debug_auth_names] || []

  new_options = opts.merge(
    :operation => :"AuthenticationApi.reset_password",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: AuthenticationApi#reset_password\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

Send magic link

Parameters:

  • magic_link_request (MagicLinkRequest)
  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



1612
1613
1614
1615
# File 'lib/mudbase/api/authentication_api.rb', line 1612

def send_magic_link(magic_link_request, opts = {})
  data, _status_code, _headers = send_magic_link_with_http_info(magic_link_request, opts)
  data
end

Send magic link

Parameters:

  • magic_link_request (MagicLinkRequest)
  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(MessageResponse, Integer, Hash)>)

    MessageResponse data, response status code and response headers



1621
1622
1623
1624
1625
1626
1627
1628
1629
1630
1631
1632
1633
1634
1635
1636
1637
1638
1639
1640
1641
1642
1643
1644
1645
1646
1647
1648
1649
1650
1651
1652
1653
1654
1655
1656
1657
1658
1659
1660
1661
1662
1663
1664
1665
1666
1667
1668
1669
1670
1671
1672
# File 'lib/mudbase/api/authentication_api.rb', line 1621

def send_magic_link_with_http_info(magic_link_request, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: AuthenticationApi.send_magic_link ...'
  end
  # verify the required parameter 'magic_link_request' is set
  if @api_client.config.client_side_validation && magic_link_request.nil?
    fail ArgumentError, "Missing the required parameter 'magic_link_request' when calling AuthenticationApi.send_magic_link"
  end
  # resource path
  local_var_path = '/api/auth/magic-link/send'

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
  # HTTP header 'Content-Type'
  content_type = @api_client.select_header_content_type(['application/json'])
  if !content_type.nil?
      header_params['Content-Type'] = content_type
  end

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body] || @api_client.object_to_http_body(magic_link_request)

  # return_type
  return_type = opts[:debug_return_type] || 'MessageResponse'

  # auth_names
  auth_names = opts[:debug_auth_names] || []

  new_options = opts.merge(
    :operation => :"AuthenticationApi.send_magic_link",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: AuthenticationApi#send_magic_link\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#send_otp(otp_send_request, opts = {}) ⇒ MessageResponse

Send OTP code

Parameters:

  • otp_send_request (OTPSendRequest)
  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



1678
1679
1680
1681
# File 'lib/mudbase/api/authentication_api.rb', line 1678

def send_otp(otp_send_request, opts = {})
  data, _status_code, _headers = send_otp_with_http_info(otp_send_request, opts)
  data
end

#send_otp_with_http_info(otp_send_request, opts = {}) ⇒ Array<(MessageResponse, Integer, Hash)>

Send OTP code

Parameters:

  • otp_send_request (OTPSendRequest)
  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(MessageResponse, Integer, Hash)>)

    MessageResponse data, response status code and response headers



1687
1688
1689
1690
1691
1692
1693
1694
1695
1696
1697
1698
1699
1700
1701
1702
1703
1704
1705
1706
1707
1708
1709
1710
1711
1712
1713
1714
1715
1716
1717
1718
1719
1720
1721
1722
1723
1724
1725
1726
1727
1728
1729
1730
1731
1732
1733
1734
1735
1736
1737
1738
# File 'lib/mudbase/api/authentication_api.rb', line 1687

def send_otp_with_http_info(otp_send_request, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: AuthenticationApi.send_otp ...'
  end
  # verify the required parameter 'otp_send_request' is set
  if @api_client.config.client_side_validation && otp_send_request.nil?
    fail ArgumentError, "Missing the required parameter 'otp_send_request' when calling AuthenticationApi.send_otp"
  end
  # resource path
  local_var_path = '/api/auth/otp/send'

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
  # HTTP header 'Content-Type'
  content_type = @api_client.select_header_content_type(['application/json'])
  if !content_type.nil?
      header_params['Content-Type'] = content_type
  end

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body] || @api_client.object_to_http_body(otp_send_request)

  # return_type
  return_type = opts[:debug_return_type] || 'MessageResponse'

  # auth_names
  auth_names = opts[:debug_auth_names] || []

  new_options = opts.merge(
    :operation => :"AuthenticationApi.send_otp",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: AuthenticationApi#send_otp\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#validate_password_reset_token(validate_password_reset_token_request, opts = {}) ⇒ ValidatePasswordResetToken200Response

Validate password reset token Call before showing the "set new password" form. Validates that the token from the reset link is still valid and not expired. Organization (platform) reset only.

Parameters:

Returns:



1745
1746
1747
1748
# File 'lib/mudbase/api/authentication_api.rb', line 1745

def validate_password_reset_token(validate_password_reset_token_request, opts = {})
  data, _status_code, _headers = validate_password_reset_token_with_http_info(validate_password_reset_token_request, opts)
  data
end

#validate_password_reset_token_with_http_info(validate_password_reset_token_request, opts = {}) ⇒ Array<(ValidatePasswordResetToken200Response, Integer, Hash)>

Validate password reset token Call before showing the &quot;set new password&quot; form. Validates that the token from the reset link is still valid and not expired. Organization (platform) reset only.

Parameters:

Returns:



1755
1756
1757
1758
1759
1760
1761
1762
1763
1764
1765
1766
1767
1768
1769
1770
1771
1772
1773
1774
1775
1776
1777
1778
1779
1780
1781
1782
1783
1784
1785
1786
1787
1788
1789
1790
1791
1792
1793
1794
1795
1796
1797
1798
1799
1800
1801
1802
1803
1804
1805
1806
# File 'lib/mudbase/api/authentication_api.rb', line 1755

def validate_password_reset_token_with_http_info(validate_password_reset_token_request, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: AuthenticationApi.validate_password_reset_token ...'
  end
  # verify the required parameter 'validate_password_reset_token_request' is set
  if @api_client.config.client_side_validation && validate_password_reset_token_request.nil?
    fail ArgumentError, "Missing the required parameter 'validate_password_reset_token_request' when calling AuthenticationApi.validate_password_reset_token"
  end
  # resource path
  local_var_path = '/api/auth/password-reset/validate'

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
  # HTTP header 'Content-Type'
  content_type = @api_client.select_header_content_type(['application/json'])
  if !content_type.nil?
      header_params['Content-Type'] = content_type
  end

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body] || @api_client.object_to_http_body(validate_password_reset_token_request)

  # return_type
  return_type = opts[:debug_return_type] || 'ValidatePasswordResetToken200Response'

  # auth_names
  auth_names = opts[:debug_auth_names] || []

  new_options = opts.merge(
    :operation => :"AuthenticationApi.validate_password_reset_token",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: AuthenticationApi#validate_password_reset_token\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#verify_email_auth(verify_email_auth_request, opts = {}) ⇒ MessageResponse

Verify email address (no auth) Verifies the user's email using the token from the link sent at signup. Use this for both organization and project signups (unauthenticated). Same behavior as POST /api/users/verify-email.

Parameters:

  • verify_email_auth_request (VerifyEmailAuthRequest)
  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



1813
1814
1815
1816
# File 'lib/mudbase/api/authentication_api.rb', line 1813

def verify_email_auth(verify_email_auth_request, opts = {})
  data, _status_code, _headers = verify_email_auth_with_http_info(verify_email_auth_request, opts)
  data
end

#verify_email_auth_with_http_info(verify_email_auth_request, opts = {}) ⇒ Array<(MessageResponse, Integer, Hash)>

Verify email address (no auth) Verifies the user's email using the token from the link sent at signup. Use this for both organization and project signups (unauthenticated). Same behavior as POST /api/users/verify-email.

Parameters:

  • verify_email_auth_request (VerifyEmailAuthRequest)
  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(MessageResponse, Integer, Hash)>)

    MessageResponse data, response status code and response headers



1823
1824
1825
1826
1827
1828
1829
1830
1831
1832
1833
1834
1835
1836
1837
1838
1839
1840
1841
1842
1843
1844
1845
1846
1847
1848
1849
1850
1851
1852
1853
1854
1855
1856
1857
1858
1859
1860
1861
1862
1863
1864
1865
1866
1867
1868
1869
1870
1871
1872
1873
1874
# File 'lib/mudbase/api/authentication_api.rb', line 1823

def verify_email_auth_with_http_info(verify_email_auth_request, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: AuthenticationApi.verify_email_auth ...'
  end
  # verify the required parameter 'verify_email_auth_request' is set
  if @api_client.config.client_side_validation && verify_email_auth_request.nil?
    fail ArgumentError, "Missing the required parameter 'verify_email_auth_request' when calling AuthenticationApi.verify_email_auth"
  end
  # resource path
  local_var_path = '/api/auth/verify-email'

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
  # HTTP header 'Content-Type'
  content_type = @api_client.select_header_content_type(['application/json'])
  if !content_type.nil?
      header_params['Content-Type'] = content_type
  end

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body] || @api_client.object_to_http_body(verify_email_auth_request)

  # return_type
  return_type = opts[:debug_return_type] || 'MessageResponse'

  # auth_names
  auth_names = opts[:debug_auth_names] || []

  new_options = opts.merge(
    :operation => :"AuthenticationApi.verify_email_auth",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: AuthenticationApi#verify_email_auth\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

Verify magic link

Parameters:

  • verify_magic_link_request (VerifyMagicLinkRequest)
  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



1880
1881
1882
1883
# File 'lib/mudbase/api/authentication_api.rb', line 1880

def verify_magic_link(verify_magic_link_request, opts = {})
  data, _status_code, _headers = verify_magic_link_with_http_info(verify_magic_link_request, opts)
  data
end

Verify magic link

Parameters:

  • verify_magic_link_request (VerifyMagicLinkRequest)
  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(AuthResponse, Integer, Hash)>)

    AuthResponse data, response status code and response headers



1889
1890
1891
1892
1893
1894
1895
1896
1897
1898
1899
1900
1901
1902
1903
1904
1905
1906
1907
1908
1909
1910
1911
1912
1913
1914
1915
1916
1917
1918
1919
1920
1921
1922
1923
1924
1925
1926
1927
1928
1929
1930
1931
1932
1933
1934
1935
1936
1937
1938
1939
1940
# File 'lib/mudbase/api/authentication_api.rb', line 1889

def verify_magic_link_with_http_info(verify_magic_link_request, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: AuthenticationApi.verify_magic_link ...'
  end
  # verify the required parameter 'verify_magic_link_request' is set
  if @api_client.config.client_side_validation && verify_magic_link_request.nil?
    fail ArgumentError, "Missing the required parameter 'verify_magic_link_request' when calling AuthenticationApi.verify_magic_link"
  end
  # resource path
  local_var_path = '/api/auth/magic-link/verify'

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
  # HTTP header 'Content-Type'
  content_type = @api_client.select_header_content_type(['application/json'])
  if !content_type.nil?
      header_params['Content-Type'] = content_type
  end

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body] || @api_client.object_to_http_body(verify_magic_link_request)

  # return_type
  return_type = opts[:debug_return_type] || 'AuthResponse'

  # auth_names
  auth_names = opts[:debug_auth_names] || []

  new_options = opts.merge(
    :operation => :"AuthenticationApi.verify_magic_link",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: AuthenticationApi#verify_magic_link\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#verify_otp(otp_verify_request, opts = {}) ⇒ AuthResponse

Verify OTP code

Parameters:

  • otp_verify_request (OTPVerifyRequest)
  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



1946
1947
1948
1949
# File 'lib/mudbase/api/authentication_api.rb', line 1946

def verify_otp(otp_verify_request, opts = {})
  data, _status_code, _headers = verify_otp_with_http_info(otp_verify_request, opts)
  data
end

#verify_otp_with_http_info(otp_verify_request, opts = {}) ⇒ Array<(AuthResponse, Integer, Hash)>

Verify OTP code

Parameters:

  • otp_verify_request (OTPVerifyRequest)
  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(AuthResponse, Integer, Hash)>)

    AuthResponse data, response status code and response headers



1955
1956
1957
1958
1959
1960
1961
1962
1963
1964
1965
1966
1967
1968
1969
1970
1971
1972
1973
1974
1975
1976
1977
1978
1979
1980
1981
1982
1983
1984
1985
1986
1987
1988
1989
1990
1991
1992
1993
1994
1995
1996
1997
1998
1999
2000
2001
2002
2003
2004
2005
2006
# File 'lib/mudbase/api/authentication_api.rb', line 1955

def verify_otp_with_http_info(otp_verify_request, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: AuthenticationApi.verify_otp ...'
  end
  # verify the required parameter 'otp_verify_request' is set
  if @api_client.config.client_side_validation && otp_verify_request.nil?
    fail ArgumentError, "Missing the required parameter 'otp_verify_request' when calling AuthenticationApi.verify_otp"
  end
  # resource path
  local_var_path = '/api/auth/otp/verify'

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
  # HTTP header 'Content-Type'
  content_type = @api_client.select_header_content_type(['application/json'])
  if !content_type.nil?
      header_params['Content-Type'] = content_type
  end

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body] || @api_client.object_to_http_body(otp_verify_request)

  # return_type
  return_type = opts[:debug_return_type] || 'AuthResponse'

  # auth_names
  auth_names = opts[:debug_auth_names] || []

  new_options = opts.merge(
    :operation => :"AuthenticationApi.verify_otp",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: AuthenticationApi#verify_otp\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end