1 # Copyright (C) The Arvados Authors. All rights reserved.
3 # SPDX-License-Identifier: AGPL-3.0
5 Rails.application.routes.draw do
6 # OPTIONS requests are not allowed at routes that use cookies.
7 ['/auth/*a', '/login', '/logout'].each do |nono|
8 match nono, to: 'user_sessions#cross_origin_forbidden', via: 'OPTIONS'
10 # OPTIONS at discovery and API paths get an empty response with CORS headers.
11 match '/discovery/v1/*a', to: 'static#empty', via: 'OPTIONS'
12 match '/arvados/v1/*a', to: 'static#empty', via: 'OPTIONS'
16 resources :api_client_authorizations do
17 post 'create_system_auth', on: :collection
18 get 'current', on: :collection
20 resources :authorized_keys
21 resources :collections do
22 get 'provenance', on: :member
23 get 'used_by', on: :member
24 post 'trash', on: :member
25 post 'untrash', on: :member
28 get 'contents', on: :collection
29 get 'contents', on: :member
30 get 'shared', on: :collection
31 post 'trash', on: :member
32 post 'untrash', on: :member
34 resources :containers do
35 get 'auth', on: :member
36 post 'lock', on: :member
37 post 'unlock', on: :member
38 post 'update_priority', on: :member
39 get 'secret_mounts', on: :member
40 get 'current', on: :collection
42 resources :container_requests do
43 get 'container_status', on: :member
45 resources :keep_services do
46 get 'accessible', on: :collection
50 resources :user_agreements do
51 get 'signatures', on: :collection
52 post 'sign', on: :collection
55 get 'current', on: :collection
56 get 'system', on: :collection
57 post 'activate', on: :member
58 post 'setup', on: :collection
59 post 'unsetup', on: :member
60 post 'merge', on: :collection
61 patch 'batch_update', on: :collection
63 resources :virtual_machines do
64 get 'logins', on: :member
65 get 'get_all_logins', on: :collection
68 get '/computed_permissions', to: 'computed_permissions#index'
69 get '/permissions/:uuid', to: 'links#get_permissions'
73 post '/sys/trash_sweep', to: 'sys#trash_sweep'
75 if Rails.env == 'test'
76 post '/database/reset', to: 'database#reset'
80 match '/auth/:provider/callback', to: 'user_sessions#create', via: [:get, :post]
81 match '/auth/failure', to: 'user_sessions#failure', via: [:get, :post]
82 # not handled by omniauth provider -> 403 with no CORS headers.
83 get '/auth/*a', to: 'user_sessions#cross_origin_forbidden'
86 match '/login', to: 'user_sessions#login', via: [:get, :post]
87 match '/logout', to: 'user_sessions#logout', via: [:get, :post]
89 match '/discovery/v1/apis/arvados/v1/rest', to: 'arvados/v1/schema#index', via: [:get, :post]
91 match '/static/login_failure', to: 'static#login_failure', as: :login_failure, via: [:get, :post]
93 match '/_health/:check', to: 'arvados/v1/management#health', via: [:get]
94 match '/metrics', to: 'arvados/v1/management#metrics', via: [:get]
96 # Send unroutable requests to an arbitrary controller
97 # (ends up at ApplicationController#render_not_found)
98 match '*a', to: 'static#render_not_found', via: [:get, :post, :put, :patch, :delete, :options]
100 root to: 'static#home'