1 # Copyright (C) The Arvados Authors. All rights reserved.
3 # SPDX-License-Identifier: AGPL-3.0
5 Rails.application.routes.draw do
8 # OPTIONS requests are not allowed at routes that use cookies.
9 ['/auth/*a', '/login', '/logout'].each do |nono|
10 match nono, to: 'user_sessions#cross_origin_forbidden', via: 'OPTIONS'
12 # OPTIONS at discovery and API paths get an empty response with CORS headers.
13 match '/discovery/v1/*a', to: 'static#empty', via: 'OPTIONS'
14 match '/arvados/v1/*a', to: 'static#empty', via: 'OPTIONS'
18 resources :api_client_authorizations do
19 post 'create_system_auth', on: :collection
20 get 'current', on: :collection
22 resources :api_clients
23 resources :authorized_keys
24 resources :collections do
25 get 'provenance', on: :member
26 get 'used_by', on: :member
27 post 'trash', on: :member
28 post 'untrash', on: :member
31 get 'contents', on: :collection
32 get 'contents', on: :member
33 get 'shared', on: :collection
34 post 'trash', on: :member
35 post 'untrash', on: :member
39 resources :containers do
40 get 'auth', on: :member
41 post 'lock', on: :member
42 post 'unlock', on: :member
43 post 'update_priority', on: :member
44 get 'secret_mounts', on: :member
45 get 'current', on: :collection
47 resources :container_requests
49 get 'queue', on: :collection
50 get 'queue_size', on: :collection
51 post 'cancel', on: :member
52 post 'lock', on: :member
54 resources :keep_disks do
55 post 'ping', on: :collection
57 resources :keep_services do
58 get 'accessible', on: :collection
63 post 'ping', on: :member
65 resources :pipeline_instances do
66 post 'cancel', on: :member
68 resources :pipeline_templates
70 resources :repositories do
71 get 'get_all_permissions', on: :collection
75 resources :user_agreements do
76 get 'signatures', on: :collection
77 post 'sign', on: :collection
80 get 'current', on: :collection
81 get 'system', on: :collection
82 post 'activate', on: :member
83 post 'setup', on: :collection
84 post 'unsetup', on: :member
85 post 'merge', on: :collection
86 patch 'batch_update', on: :collection
88 resources :virtual_machines do
89 get 'logins', on: :member
90 get 'get_all_logins', on: :collection
92 get '/permissions/:uuid', to: 'links#get_permissions'
96 post '/sys/trash_sweep', to: 'sys#trash_sweep'
98 if Rails.env == 'test'
99 post '/database/reset', to: 'database#reset'
103 match '/auth/:provider/callback', to: 'user_sessions#create', via: [:get, :post]
104 match '/auth/failure', to: 'user_sessions#failure', via: [:get, :post]
105 # not handled by omniauth provider -> 403 with no CORS headers.
106 get '/auth/*a', to: 'user_sessions#cross_origin_forbidden'
109 match '/login', to: 'user_sessions#login', via: [:get, :post]
110 match '/logout', to: 'user_sessions#logout', via: [:get, :post]
112 match '/discovery/v1/apis/arvados/v1/rest', to: 'arvados/v1/schema#index', via: [:get, :post]
114 match '/static/login_failure', to: 'static#login_failure', as: :login_failure, via: [:get, :post]
116 match '/_health/:check', to: 'arvados/v1/management#health', via: [:get]
117 match '/metrics', to: 'arvados/v1/management#metrics', via: [:get]
119 # Send unroutable requests to an arbitrary controller
120 # (ends up at ApplicationController#render_not_found)
121 match '*a', to: 'static#render_not_found', via: [:get, :post, :put, :patch, :delete, :options]
123 root to: 'static#home'