model_driven_api 3.5.9 → 3.5.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/config/routes.rb +60 -58
- data/lib/model_driven_api/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 480b526a7ad2eb29d72fde29103828c4d40828f8191159ead5c5e6c963576b44
|
|
4
|
+
data.tar.gz: e0d6cb01b2712a55ebb45dc0489731e13811ff3330e02dce98b208bc2617db4c
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: f55b360c3768fbb9ec7e43cff3626ddea0f299e32e3c97f92270dba1d535eb2994b9eabbff4fb8fc20f92b74f88a32ab103bfd56b59f50bc878aaa7243303acb
|
|
7
|
+
data.tar.gz: 5c92387cb385739839db471b2e95cc5ffde332bb33ea903fc608f16f3294383db370f49ca4e4dd93d1d4b8c35db875cacf1671df6e4695b823ac3afca97040fd
|
data/config/routes.rb
CHANGED
|
@@ -1,71 +1,73 @@
|
|
|
1
1
|
# require 'ransack'
|
|
2
2
|
|
|
3
3
|
Rails.application.routes.draw do
|
|
4
|
-
|
|
4
|
+
scope ENV.fetch("RAILS_RELATIVE_URL_ROOT", "/") do
|
|
5
|
+
if ThecoreAuthCommons.oauth_vars?
|
|
6
|
+
# OmniAuth callbacks need these top-level paths:
|
|
7
|
+
match "/auth/:provider/callback", to: redirect("/api/v2/auth/%{provider}/callback"), via: [:get, :post]
|
|
8
|
+
match "/auth/failure", to: redirect("/api/v2/auth/failure"), via: [:get, :post]
|
|
9
|
+
end
|
|
10
|
+
namespace :api, constraints: { format: :json } do
|
|
11
|
+
namespace :v2 do
|
|
12
|
+
# Authentication via Oauth2 only if the environment variable is set
|
|
5
13
|
if ThecoreAuthCommons.oauth_vars?
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
match
|
|
14
|
+
namespace :auth do
|
|
15
|
+
# Omniauth routes for OAuth2 authentication
|
|
16
|
+
match ":provider/callback", to: "oauth#callback", via: [:get, :post]
|
|
17
|
+
get :failure, to: "oauth#failure"
|
|
18
|
+
get ":provider", to: redirect("/auth/%{provider}") # triggers OmniAuth middleware
|
|
19
|
+
post :jwt, to: "oauth#exchange_token" # Optional endpoint to allow frontends to send the OAuth token
|
|
20
|
+
end
|
|
9
21
|
end
|
|
10
|
-
namespace :api, constraints: { format: :json } do
|
|
11
|
-
namespace :v2 do
|
|
12
|
-
# Authentication via Oauth2 only if the environment variable is set
|
|
13
|
-
if ThecoreAuthCommons.oauth_vars?
|
|
14
|
-
namespace :auth do
|
|
15
|
-
# Omniauth routes for OAuth2 authentication
|
|
16
|
-
match ':provider/callback', to: 'oauth#callback', via: [:get, :post]
|
|
17
|
-
get :failure, to: 'oauth#failure'
|
|
18
|
-
get ':provider', to: redirect('/auth/%{provider}') # triggers OmniAuth middleware
|
|
19
|
-
post :jwt, to: 'oauth#exchange_token' # Optional endpoint to allow frontends to send the OAuth token
|
|
20
|
-
end
|
|
21
|
-
end
|
|
22
22
|
|
|
23
|
-
|
|
23
|
+
resources :users
|
|
24
24
|
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
25
|
+
namespace :info do
|
|
26
|
+
get :version
|
|
27
|
+
get :roles
|
|
28
|
+
get :translations
|
|
29
|
+
get :schema
|
|
30
|
+
get :dsl
|
|
31
|
+
get :heartbeat
|
|
32
|
+
get :settings
|
|
33
|
+
get :swagger
|
|
34
|
+
get :openapi
|
|
35
|
+
end
|
|
36
36
|
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
37
|
+
namespace :raw do
|
|
38
|
+
# both post and get for raw queries, the query is sent in the body as JSON with a "query" key
|
|
39
|
+
post "query", to: "raw#query"
|
|
40
|
+
get "query", to: "raw#query"
|
|
41
|
+
end
|
|
40
42
|
|
|
41
|
-
|
|
42
|
-
|
|
43
|
+
post "authenticate" => "authentication#authenticate"
|
|
44
|
+
post ":ctrl/search" => "application#index"
|
|
43
45
|
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
46
|
+
# Add a route with placeholders for custom actions, the custom actions routes have a form like: :ctrl/custom_action/:action_name or :ctrl/custom_action/:action_name/:id
|
|
47
|
+
# Can have all the verbs, but the most common are: get, post, put, delete
|
|
48
|
+
get ":ctrl/custom_action/:action_name", to: "application#index"
|
|
49
|
+
get ":ctrl/custom_action/:action_name/:id", to: "application#show"
|
|
50
|
+
post ":ctrl/custom_action/:action_name", to: "application#create"
|
|
51
|
+
put ":ctrl/custom_action/:action_name/:id", to: "application#update"
|
|
52
|
+
patch ":ctrl/custom_action/:action_name/:id", to: "application#update"
|
|
53
|
+
delete ":ctrl/custom_action/:action_name/:id", to: "application#destroy"
|
|
54
|
+
# Catchall routes
|
|
55
|
+
# # CRUD Show
|
|
56
|
+
get "*path/:id", to: "application#show"
|
|
57
|
+
# # CRUD Index
|
|
58
|
+
get "*path", to: "application#index"
|
|
59
|
+
# # CRUD Create
|
|
60
|
+
post "*path", to: "application#create"
|
|
61
|
+
# CRUD Update
|
|
62
|
+
put "*path/:id/multi", to: "application#update_multi"
|
|
63
|
+
patch "*path/:id/multi", to: "application#update_multi"
|
|
64
|
+
put "*path/:id", to: "application#update"
|
|
65
|
+
patch "*path/:id", to: "application#patch"
|
|
64
66
|
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
end
|
|
67
|
+
# # CRUD Delete
|
|
68
|
+
delete "*path/:id/multi", to: "application#destroy_multi"
|
|
69
|
+
delete "*path/:id", to: "application#destroy"
|
|
70
|
+
end
|
|
70
71
|
end
|
|
72
|
+
end
|
|
71
73
|
end
|