user.rb 4.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. # Copyright (C) 2012-2025 Zammad Foundation, https://zammad-foundation.org/
  2. Zammad::Application.routes.draw do
  3. api_path = Rails.configuration.api_path
  4. # two-factor
  5. scope Rails.configuration.api_path do
  6. resource 'admin_two_factors', path: '/users/:id/admin_two_factor', controller: 'user/admin_two_factors', only: [] do
  7. delete :remove_authentication_method
  8. delete :remove_all_authentication_methods
  9. get :enabled_authentication_methods
  10. end
  11. resource 'two_factors', path: '/users/two_factor', controller: 'user/two_factors', only: [] do
  12. get :personal_configuration
  13. post 'authentication_method_initiate_configuration/:method', to: 'authentication_method_initiate_configuration'
  14. post 'authentication_method_configuration/:method', to: 'authentication_method_configuration'
  15. post :enabled_authentication_methods
  16. post :verify_configuration
  17. post :default_authentication_method
  18. post :recovery_codes_generate
  19. delete :remove_authentication_method
  20. delete 'authentication_remove_credentials/:method', to: 'authentication_remove_credentials'
  21. end
  22. end
  23. # users
  24. match api_path + '/users/search', to: 'users#search', via: %i[get post option]
  25. match api_path + '/users/password_reset', to: 'users#password_reset_send', via: :post
  26. match api_path + '/users/password_reset_verify', to: 'users#password_reset_verify', via: :post
  27. match api_path + '/users/password_change', to: 'users#password_change', via: :post
  28. match api_path + '/users/password_check', to: 'users#password_check', via: :post
  29. match api_path + '/users/preferences', to: 'users#preferences', via: :put
  30. match api_path + '/users/preferences_notifications_reset', to: 'users#preferences_notifications_reset', via: :post
  31. match api_path + '/users/out_of_office', to: 'users#out_of_office', via: :put
  32. match api_path + '/users/account', to: 'users#account_remove', via: :delete
  33. match api_path + '/users/import_example', to: 'users#import_example', via: :get
  34. match api_path + '/users/import', to: 'users#import_start', via: :post
  35. match api_path + '/users/avatar', to: 'users#avatar_new', via: :post
  36. match api_path + '/users/avatar', to: 'users#avatar_list', via: :get
  37. match api_path + '/users/avatar', to: 'users#avatar_destroy', via: :delete
  38. match api_path + '/users/avatar/set', to: 'users#avatar_set_default', via: :post
  39. match api_path + '/users/me', to: 'users#me', via: :get
  40. match api_path + '/users/after_auth', to: 'user/after_auth#show', via: :get
  41. match api_path + '/users', to: 'users#index', via: :get
  42. match api_path + '/users/:id', to: 'users#show', via: :get
  43. match api_path + '/users/history/:id', to: 'users#history', via: :get
  44. match api_path + '/users', to: 'users#create', via: :post
  45. match api_path + '/users/:id', to: 'users#update', via: :put, as: 'api_v1_update_user'
  46. match api_path + '/users/:id', to: 'users#destroy', via: :delete, as: 'api_v1_delete_user'
  47. match api_path + '/users/image/:hash', to: 'users#image', via: :get
  48. match api_path + '/users/unlock/:id', to: 'users#unlock', via: :put
  49. match api_path + '/users/email_verify', to: 'users#email_verify', via: :post
  50. match api_path + '/users/email_verify_send', to: 'users#email_verify_send', via: :post
  51. match api_path + '/users/admin_password_auth', to: 'users#admin_password_auth_send', via: :post
  52. match api_path + '/users/admin_password_auth_verify', to: 'users#admin_password_auth_verify', via: :post
  53. end