model_driven_api 2.3.3 → 2.3.4

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: c77b61d75c5b926929f9a65ae9694e918b2c36d7be0fa3bb0f5a9a5fd8909b29
4
- data.tar.gz: 979cb2cff870f9f41e457efb5ec4bd328dab62224b36c85adcfdcd596ad6058e
3
+ metadata.gz: b3732e187808e98168a540463302b48f5c790b636ec3058d8fe1d1368fe8d00c
4
+ data.tar.gz: e3cc94ae51641832ad46712014fd5519937d1d2533e1c8866e1fd04a9372f57a
5
5
  SHA512:
6
- metadata.gz: 1f7433104bcb521f99e9bb7940695047f2ff8d72e9471dc9ddaf0f8f3de876b0c5e7ed061f834959228e06cfd8b8465cbf85b8bd54a209778e8cac102697b094
7
- data.tar.gz: 3401e9d58984dcb9c28bc356254b832a322aad20d0eef59e5e8dbba1520654fbbfbbdd125415e1c06039f9e2c62f8a0a2034dbf85726f6015c1e9ecec0d7949f
6
+ metadata.gz: 3cb118e13b3362bd98396a5cf639ba3de1f8e5e161c36e21f04f9bbfacb7c722a985aef6baf5a249fe12fc6ba4572c62277905cdeb148c4b42742abf069b0726
7
+ data.tar.gz: 3dddb43d8f95f6203523ef3d770867682179e5d8abc04838bd42ef5809c91b1f458093c799ddee7d3758a008560f6802315b90fce0d9b83b71ff3272849cdea5
data/README.md CHANGED
@@ -422,7 +422,7 @@ Once loaded the tests inside the insomnia application, please right click on the
422
422
 
423
423
  ## TODO
424
424
 
425
- * Add a Trust management for API consumers, to have some low level interactions happen between API client and server done without the need for giving a USERNAME and a PASSWORD.
425
+ * Document the new feature (from version 2.3.3) to add Authentication methods which override the JWT described above. Useful for Webhooks and machine2machine trusted dialogues.
426
426
 
427
427
  ## References
428
428
  Thanks to all these people for ideas:
@@ -107,7 +107,8 @@ class Api::V2::ApplicationController < ActionController::API
107
107
  # call an unwanted method in the AR Model.
108
108
  resource = "custom_action_#{params[:do]}"
109
109
  raise NoMethodError unless @model.respond_to?(resource)
110
- return true, MultiJson.dump(params[:id].blank? ? @model.send(resource, params) : @model.send(resource, params[:id].to_i, params))
110
+ # return true, MultiJson.dump(params[:id].blank? ? @model.send(resource, params) : @model.send(resource, params[:id].to_i, params))
111
+ return true, MultiJson.dump(@model.send(resource, params))
111
112
  end
112
113
  # if it's here there is no custom action in the request querystring
113
114
  return false
@@ -123,8 +124,9 @@ class Api::V2::ApplicationController < ActionController::API
123
124
  def authenticate_request
124
125
  # puts request.headers.inspect
125
126
  @current_user = nil
127
+ # puts "Are there wbehooks headers to check for? #{Settings.ns(:security).allowed_authorization_headers}"
126
128
  Settings.ns(:security).allowed_authorization_headers.split(",").each do |header|
127
- # puts request.headers[header.underscore.dasherize]
129
+ # puts "Found header #{header}: #{request.headers[header.underscore.dasherize]}"
128
130
  check_authorization("Authorize#{header}".constantize.call(request.headers, request.raw_post)) if request.headers[header.underscore.dasherize]
129
131
  end
130
132
  return unauthenticated!(OpenStruct.new({message: @auth_errors})) unless @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: 2.3.3
4
+ version: 2.3.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Gabriele Tassoni
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-02-09 00:00:00.000000000 Z
11
+ date: 2021-02-10 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: thecore_backend_commons