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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 50e6447048e37e35c8b4edeb8ddf337e9d5e8195d5bb515e69858368242a49d4
4
- data.tar.gz: 8a902eb91707029d994c846edb09d5dea74444d7eca758dd678137c1e179be9e
3
+ metadata.gz: 480b526a7ad2eb29d72fde29103828c4d40828f8191159ead5c5e6c963576b44
4
+ data.tar.gz: e0d6cb01b2712a55ebb45dc0489731e13811ff3330e02dce98b208bc2617db4c
5
5
  SHA512:
6
- metadata.gz: d4b88c69f9909a692cf4c811ba50f60247e55cd8ae30d3673b4962bde51fd09e0c45736bac2cc61a3eed8c43e064555e6e1bc36d62c89bdf53307cb2160ed299
7
- data.tar.gz: c7ffd3833e0024b58945151f7db031b053617e385480493b256f201c59949902c2eb3dae6585fc9b04a8fb3ff7942695254fc4eee4c09000b256d6821f1d8617
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
- scope ENV.fetch("RAILS_RELATIVE_URL_ROOT", "/") do
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
- # 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]
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
- resources :users
23
+ resources :users
24
24
 
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
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
- namespace :raw do
38
- post :sql
39
- end
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
- post "authenticate" => "authentication#authenticate"
42
- post ":ctrl/search" => 'application#index'
43
+ post "authenticate" => "authentication#authenticate"
44
+ post ":ctrl/search" => "application#index"
43
45
 
44
- # 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
45
- # Can have all the verbs, but the most common are: get, post, put, delete
46
- get ":ctrl/custom_action/:action_name", to: 'application#index'
47
- get ":ctrl/custom_action/:action_name/:id", to: 'application#show'
48
- post ":ctrl/custom_action/:action_name", to: 'application#create'
49
- put ":ctrl/custom_action/:action_name/:id", to: 'application#update'
50
- patch ":ctrl/custom_action/:action_name/:id", to: 'application#update'
51
- delete ":ctrl/custom_action/:action_name/:id", to: 'application#destroy'
52
- # Catchall routes
53
- # # CRUD Show
54
- get '*path/:id', to: 'application#show'
55
- # # CRUD Index
56
- get '*path', to: 'application#index'
57
- # # CRUD Create
58
- post '*path', to: 'application#create'
59
- # CRUD Update
60
- put '*path/:id/multi', to: 'application#update_multi'
61
- patch '*path/:id/multi', to: 'application#update_multi'
62
- put '*path/:id', to: 'application#update'
63
- patch '*path/:id', to: 'application#patch'
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
- # # CRUD Delete
66
- delete '*path/:id/multi', to: 'application#destroy_multi'
67
- delete '*path/:id', to: 'application#destroy'
68
- end
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
@@ -1,3 +1,3 @@
1
1
  module ModelDrivenApi
2
- VERSION = "3.5.9".freeze
2
+ VERSION = "3.5.10".freeze
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: model_driven_api
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.5.9
4
+ version: 3.5.10
5
5
  platform: ruby
6
6
  authors:
7
7
  - Gabriele Tassoni