model_driven_api 3.16.0 → 3.17.0

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: b690a0afab20bfa86c9cfe8dbc57e9e4927a2f0f8b358975bbd5acd7eac16357
4
- data.tar.gz: 6aadf884c1177f78eb61d9fbfeda255b7e1833197b9c9f40c6cb5a8872174cf4
3
+ metadata.gz: 8ab0bcc6554cbf9711eeb67df0e7cc996f187527bd3ea7393ad3d42e4f6107f3
4
+ data.tar.gz: 6d4bdb9d4be44078ae4a69cd65456a1d22cf4e5727783d02bcef333d2c5ba770
5
5
  SHA512:
6
- metadata.gz: 3858ad35e5cfadd584d71813f18280600b7a0507d264d15cd5c7343b005adb4adcf6b762c2d7a13bbbfd21b9a6face5210e237de04760b97b232994007fd3651
7
- data.tar.gz: 652ea73728caa6b872df593c814a87e8920c5b1261d48dbbb9d3605c5a8a249f420e4f2b33d1cdd37b315abf70be4d14c3a83060ea111365448bb32c32a177db
6
+ metadata.gz: fe1733f08abafc143a01d67ca0b18ff293fb8411085d2fd57bb2383725c0a8f9bda5a78fd74a6e9d94afe87f2f5bc85eceaa2f6ca1d88637377f0aa169b7c6ae
7
+ data.tar.gz: c6775bc6268cfa95904339251e469dc3ba41829d9e9d75a457ecb2d2dbec9e1a4319c8bb0a7e3a67a94733ce86d331477ffb723a524bf516978a22ebf102cf7b
@@ -130,7 +130,12 @@ class Api::V2::InfoController < Api::V2::ApplicationController
130
130
  render json: pivot.to_json, status: 200
131
131
  end
132
132
 
133
+ # GET '/api/v2|v3/info/settings': every setting by namespace; a Secret setting keeps its key
134
+ # with a null value, since it is write-only (host ADR 0046 point 10, host Odoo #6084).
133
135
  def settings
134
- render json: ThecoreSettings::Setting.pluck(:ns, :key, :raw).inject({}) { |result, array| (result[array.first] ||= {})[array.second] = array.third; result }.to_json, status: 200
136
+ pivot = ThecoreSettings::Setting.pluck(:ns, :key, :raw).each_with_object({}) do |(ns, key, raw), result|
137
+ (result[ns] ||= {})[key] = ThecoreSettings::Setting.secret_key?(key) ? nil : raw
138
+ end
139
+ render json: pivot.to_json, status: 200
135
140
  end
136
141
  end
@@ -165,7 +165,7 @@ module Api
165
165
  "get" => {
166
166
  "summary" => "Settings", "tags" => ["Info"],
167
167
  "security" => [{ "bearerAuth" => [] }],
168
- "responses" => { "200" => { "description" => "All ThecoreSettings::Setting values" } },
168
+ "responses" => { "200" => { "description" => "Every ThecoreSettings::Setting by namespace; a Secret setting (password, private_key, ...) is null" } },
169
169
  },
170
170
  },
171
171
  "/info/swagger" => {
@@ -7,6 +7,9 @@ module Api
7
7
  except = Array(jattrs[:except]).map(&:to_sym)
8
8
  only = model_class.column_names.map(&:to_sym) - except
9
9
  end
10
+ # A model's write-only attributes (LdapServer#admin_password) are never serialized, whatever
11
+ # json_attrs asks (host Odoo #6084).
12
+ only -= Array(model_class.write_only_attributes).map(&:to_sym) if model_class.respond_to?(:write_only_attributes)
10
13
  new(only.reject { |a| a == :id }, Array(jattrs[:methods]).map(&:to_sym), jattrs[:include])
11
14
  end
12
15
 
@@ -1,3 +1,3 @@
1
1
  module ModelDrivenApi
2
- VERSION = "3.16.0".freeze
2
+ VERSION = "3.17.0".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.16.0
4
+ version: 3.17.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Gabriele Tassoni
@@ -30,7 +30,7 @@ dependencies:
30
30
  requirements:
31
31
  - - ">="
32
32
  - !ruby/object:Gem::Version
33
- version: 3.7.0
33
+ version: 3.8.0
34
34
  - - "<"
35
35
  - !ruby/object:Gem::Version
36
36
  version: '4'
@@ -40,7 +40,7 @@ dependencies:
40
40
  requirements:
41
41
  - - ">="
42
42
  - !ruby/object:Gem::Version
43
- version: 3.7.0
43
+ version: 3.8.0
44
44
  - - "<"
45
45
  - !ruby/object:Gem::Version
46
46
  version: '4'