scimitar 2.1.0 → 2.1.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/controllers/scimitar/application_controller.rb +2 -2
- data/app/models/scimitar/error_response.rb +1 -1
- data/app/models/scimitar/resources/mixin.rb +5 -1
- data/lib/scimitar/version.rb +2 -2
- data/spec/controllers/scimitar/application_controller_spec.rb +5 -1
- data/spec/models/scimitar/resources/mixin_spec.rb +18 -0
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2418199bee8396f36fd0588b82f111b019d28b095d8830c82c808cc67323f220
|
4
|
+
data.tar.gz: 0b3fcf08adbbc8d9385e245f4e55b3ca2e30c7a8ce254d9417e4a4ab3a662dcf
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3c52d9e9d70525d25e5c3cc9ee627a41e2de7946b53829525506716cb502076aa42fa2c6fa253edbee990799fe8bf6b1ae089325f6aeb8015f3a3f5b14eff5eb
|
7
|
+
data.tar.gz: 41cfeb646bd77b2f0a53ccac2c5f94cbc1ca02261adc169ad21b3a96a7edc2cdcdcd75f4f0ef1e0e5ae387f8f4c3bd7c67382258515bd4612911bb5c15f85260
|
@@ -25,8 +25,8 @@ module Scimitar
|
|
25
25
|
#
|
26
26
|
# ...to "globally" invoke this handler if you wish.
|
27
27
|
#
|
28
|
-
# +
|
29
|
-
#
|
28
|
+
# +exception+:: Exception instance, used for a configured error reporter
|
29
|
+
# via #handle_scim_error (if present).
|
30
30
|
#
|
31
31
|
def handle_resource_not_found(exception)
|
32
32
|
handle_scim_error(NotFoundError.new(params[:id]), exception)
|
@@ -17,7 +17,7 @@ module Scimitar
|
|
17
17
|
data
|
18
18
|
end
|
19
19
|
|
20
|
-
#
|
20
|
+
# Originally Scimitar used attribute "detail" for exception text; it was
|
21
21
|
# only for JSON responses at the time, but in hindsight was a bad choice.
|
22
22
|
# It should have been "message" given inheritance from StandardError, which
|
23
23
|
# then works properly with e.g. error reporting services.
|
@@ -902,7 +902,11 @@ module Scimitar
|
|
902
902
|
altering_hash[path_component] = value
|
903
903
|
end
|
904
904
|
when 'replace'
|
905
|
-
|
905
|
+
if path_component == 'root'
|
906
|
+
altering_hash[path_component].merge!(value)
|
907
|
+
else
|
908
|
+
altering_hash[path_component] = value
|
909
|
+
end
|
906
910
|
when 'remove'
|
907
911
|
altering_hash.delete(path_component)
|
908
912
|
end
|
data/lib/scimitar/version.rb
CHANGED
@@ -3,11 +3,11 @@ module Scimitar
|
|
3
3
|
# Gem version. If this changes, be sure to re-run "bundle install" or
|
4
4
|
# "bundle update".
|
5
5
|
#
|
6
|
-
VERSION = '2.1.
|
6
|
+
VERSION = '2.1.1'
|
7
7
|
|
8
8
|
# Date for VERSION. If this changes, be sure to re-run "bundle install"
|
9
9
|
# or "bundle update".
|
10
10
|
#
|
11
|
-
DATE = '2022-
|
11
|
+
DATE = '2022-11-04'
|
12
12
|
|
13
13
|
end
|
@@ -208,7 +208,11 @@ RSpec.describe Scimitar::ApplicationController do
|
|
208
208
|
context 'and bad JSON' do
|
209
209
|
controller do
|
210
210
|
def index
|
211
|
-
|
211
|
+
begin
|
212
|
+
raise 'Hello'
|
213
|
+
rescue
|
214
|
+
raise ActionDispatch::Http::Parameters::ParseError
|
215
|
+
end
|
212
216
|
end
|
213
217
|
end
|
214
218
|
|
@@ -1747,6 +1747,24 @@ RSpec.describe Scimitar::Resources::Mixin do
|
|
1747
1747
|
expect(scim_hash['emails'][0]['type' ]).to eql('work')
|
1748
1748
|
expect(scim_hash['emails'][0]['value']).to eql('work@test.com')
|
1749
1749
|
end
|
1750
|
+
|
1751
|
+
context 'when prior value already exists, and no path' do
|
1752
|
+
it 'simple value: overwrites' do
|
1753
|
+
path = [ 'root' ]
|
1754
|
+
scim_hash = { 'root' => { 'userName' => 'bar', 'active' => true } }.with_indifferent_case_insensitive_access()
|
1755
|
+
|
1756
|
+
@instance.send(
|
1757
|
+
:from_patch_backend!,
|
1758
|
+
nature: 'replace',
|
1759
|
+
path: path,
|
1760
|
+
value: { 'active' => false }.with_indifferent_case_insensitive_access(),
|
1761
|
+
altering_hash: scim_hash
|
1762
|
+
)
|
1763
|
+
|
1764
|
+
expect(scim_hash['root']['userName']).to eql('bar')
|
1765
|
+
expect(scim_hash['root']['active']).to eql(false)
|
1766
|
+
end
|
1767
|
+
end
|
1750
1768
|
end # context 'when value is not present' do
|
1751
1769
|
end # "context 'replace' do"
|
1752
1770
|
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: scimitar
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.1.
|
4
|
+
version: 2.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- RIPA Global
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2022-
|
12
|
+
date: 2022-11-04 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: rails
|
@@ -260,7 +260,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
260
260
|
- !ruby/object:Gem::Version
|
261
261
|
version: '0'
|
262
262
|
requirements: []
|
263
|
-
rubygems_version: 3.3.
|
263
|
+
rubygems_version: 3.3.13
|
264
264
|
signing_key:
|
265
265
|
specification_version: 4
|
266
266
|
summary: SCIM v2 for Rails
|