model_driven_api 3.0.10 → 3.0.11
Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 77497a359b4d336baf533725376f1122b376d2a97b05bcf3e8f7e203d4963780
|
4
|
+
data.tar.gz: 8a799a1009588c764b5dbec7ea1b1cfd4c7f8c1d4ac4554bccb22b35877531a1
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: abd1210273d04c393f6a6b46e593f52da8dba14bce52dd3351b3cc3c5575c9c931826538035566a186c9d4af0596cea2f54aa1ce6d685dc7136feb933f82ce1a
|
7
|
+
data.tar.gz: 6b822a4b6da0f2718a7837124e654fc6c5ba7223798171621d669de2fd54aa4e9a933a99d5c5cf7c5b0b5641fc2eab6f5b729bef7d4d7ae8a4531fda20e3aa87
|
@@ -129,11 +129,12 @@ class Api::V2::ApplicationController < ActionController::API
|
|
129
129
|
unless params[:do].blank?
|
130
130
|
# Poor man's solution to avoid the possibility to
|
131
131
|
# call an unwanted method in the AR Model.
|
132
|
-
|
132
|
+
custom_action, token = params[:do].split("-")
|
133
|
+
resource = "custom_action_#{custom_action}"
|
133
134
|
raise NoMethodError unless @model.respond_to?(resource)
|
134
135
|
# puts json_attrs
|
135
136
|
params[:request_url] = request.url
|
136
|
-
params[:token] = bearer_token
|
137
|
+
params[:token] = token.presence || bearer_token
|
137
138
|
body, status = @model.send(resource, params)
|
138
139
|
return true, body.to_json(json_attrs), status
|
139
140
|
end
|
@@ -158,10 +159,10 @@ class Api::V2::ApplicationController < ActionController::API
|
|
158
159
|
@current_user = nil
|
159
160
|
Settings.ns(:security).allowed_authorization_headers.split(",").each do |header|
|
160
161
|
# puts "Found header #{header}: #{request.headers[header]}"
|
161
|
-
check_authorization("Authorize#{header}".constantize.call(request
|
162
|
+
check_authorization("Authorize#{header}".constantize.call(request))
|
162
163
|
end
|
163
164
|
|
164
|
-
check_authorization AuthorizeApiRequest.call(request
|
165
|
+
check_authorization AuthorizeApiRequest.call(request) unless @current_user
|
165
166
|
return unauthenticated!(OpenStruct.new({message: @auth_errors})) unless @current_user
|
166
167
|
|
167
168
|
current_user = @current_user
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: model_driven_api
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 3.0.
|
4
|
+
version: 3.0.11
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Gabriele Tassoni
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2023-
|
11
|
+
date: 2023-09-21 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: thecore_backend_commons
|