scimitar 1.10.0 → 1.11.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 +4 -4
- data/LICENSE.txt +1 -1
- data/README.md +2 -2
- data/app/controllers/scimitar/application_controller.rb +3 -4
- data/app/controllers/scimitar/resource_types_controller.rb +7 -1
- data/lib/scimitar/engine.rb +2 -2
- data/lib/scimitar/version.rb +2 -2
- data/spec/controllers/scimitar/resource_types_controller_spec.rb +8 -4
- data/spec/requests/engine_spec.rb +6 -6
- 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: 5860adcfd6c793922be88ef8bb7bb878571e8fcd34ea89ead9d0278f09582cff
|
4
|
+
data.tar.gz: 2f7bf25e40156c0f006255c0c015f6302c8de39fc1634be789dba462d43f8c4a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8047867c9365db25571693526e765d1a1a6b6d9cd17278f4bca2037815b5f9e0b9945390cc5ffba0228b9fabd3b15deae253519bbbe74ada2c262718d1c54989
|
7
|
+
data.tar.gz: 6ef777d96c932404c1ae0209804010fee98e993ce289d4eac09e0c8c3395b0de390fb423611d599fb6750a5d46e34545e0685e9563441fcc2d582fb5b6d1618f
|
data/LICENSE.txt
CHANGED
data/README.md
CHANGED
@@ -321,7 +321,7 @@ end
|
|
321
321
|
|
322
322
|
#### Other source types
|
323
323
|
|
324
|
-
If you do _not_ use ActiveRecord to store data, or if you have very esoteric read-write requirements, you can subclass [`
|
324
|
+
If you do _not_ use ActiveRecord to store data, or if you have very esoteric read-write requirements, you can subclass [`Scimitar::ResourcesController`](https://www.rubydoc.info/gems/scimitar/Scimitar/ResourcesController) in a manner similar to this:
|
325
325
|
|
326
326
|
```ruby
|
327
327
|
class UsersController < Scimitar::ResourcesController
|
@@ -594,7 +594,7 @@ By default, Scimitar advertises (via things like [the `/Schemas` endpoint](https
|
|
594
594
|
|
595
595
|
```ruby
|
596
596
|
Rails.application.config.to_prepare do
|
597
|
-
Scimitar::Engine
|
597
|
+
Scimitar::Engine.set_default_resources([Scimitar::Resources::User])
|
598
598
|
# ...other Scimitar configuration / initialisation code...
|
599
599
|
end
|
600
600
|
```
|
@@ -9,10 +9,6 @@ module Scimitar
|
|
9
9
|
before_action :add_mandatory_response_headers
|
10
10
|
before_action :authenticate
|
11
11
|
|
12
|
-
if Scimitar.engine_configuration.application_controller_mixin
|
13
|
-
include Scimitar.engine_configuration.application_controller_mixin
|
14
|
-
end
|
15
|
-
|
16
12
|
# =========================================================================
|
17
13
|
# PROTECTED INSTANCE METHODS
|
18
14
|
# =========================================================================
|
@@ -153,5 +149,8 @@ module Scimitar
|
|
153
149
|
return result
|
154
150
|
end
|
155
151
|
|
152
|
+
if Scimitar.engine_configuration.application_controller_mixin
|
153
|
+
include Scimitar.engine_configuration.application_controller_mixin
|
154
|
+
end
|
156
155
|
end
|
157
156
|
end
|
@@ -5,7 +5,13 @@ module Scimitar
|
|
5
5
|
resource.resource_type(scim_resource_type_url(name: resource.resource_type_id))
|
6
6
|
end
|
7
7
|
|
8
|
-
render json:
|
8
|
+
render json: {
|
9
|
+
schemas: [
|
10
|
+
'urn:ietf:params:scim:api:messages:2.0:ListResponse'
|
11
|
+
],
|
12
|
+
totalResults: resource_types.size,
|
13
|
+
Resources: resource_types
|
14
|
+
}
|
9
15
|
end
|
10
16
|
|
11
17
|
def show
|
data/lib/scimitar/engine.rb
CHANGED
@@ -88,9 +88,9 @@ module Scimitar
|
|
88
88
|
unrecognised_resources = resource_array - @standard_default_resources
|
89
89
|
|
90
90
|
if unrecognised_resources.any?
|
91
|
-
raise "Scimitar::Engine
|
91
|
+
raise "Scimitar::Engine.set_default_resources: Only #{@standard_default_resources.map(&:name).join(', ')} are supported"
|
92
92
|
elsif resource_array.empty?
|
93
|
-
raise 'Scimitar::Engine
|
93
|
+
raise 'Scimitar::Engine.set_default_resources: At least one resource must be given'
|
94
94
|
end
|
95
95
|
|
96
96
|
@default_resources = resource_array
|
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 = '1.
|
6
|
+
VERSION = '1.11.0'
|
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 = '2024-
|
11
|
+
DATE = '2024-10-22'
|
12
12
|
|
13
13
|
end
|
@@ -9,11 +9,15 @@ RSpec.describe Scimitar::ResourceTypesController do
|
|
9
9
|
it 'renders the resource type for user' do
|
10
10
|
get :index, format: :scim
|
11
11
|
response_hash = JSON.parse(response.body)
|
12
|
-
expected_response =
|
13
|
-
|
14
|
-
|
12
|
+
expected_response = {
|
13
|
+
schemas: ['urn:ietf:params:scim:api:messages:2.0:ListResponse'],
|
14
|
+
totalResults: 2,
|
15
|
+
Resources: [
|
16
|
+
Scimitar::Resources::User.resource_type(scim_resource_type_url(name: 'User', test: 1)),
|
17
|
+
Scimitar::Resources::Group.resource_type(scim_resource_type_url(name: 'Group', test: 1))
|
18
|
+
]
|
19
|
+
}.to_json
|
15
20
|
|
16
|
-
response_hash = JSON.parse(response.body)
|
17
21
|
expect(response_hash).to eql(JSON.parse(expected_response))
|
18
22
|
end
|
19
23
|
|
@@ -78,26 +78,26 @@ RSpec.describe Scimitar::Engine do
|
|
78
78
|
end
|
79
79
|
|
80
80
|
it 'notes changes to defaults' do
|
81
|
-
Scimitar::Engine
|
81
|
+
Scimitar::Engine.set_default_resources([Scimitar::Resources::User])
|
82
82
|
expect(Scimitar::Engine.resources()).to match_array([Scimitar::Resources::User])
|
83
83
|
end
|
84
84
|
|
85
85
|
it 'notes changes to defaults with custom resources added' do
|
86
|
-
Scimitar::Engine
|
86
|
+
Scimitar::Engine.set_default_resources([Scimitar::Resources::User])
|
87
87
|
Scimitar::Engine.add_custom_resource(@license_resource)
|
88
88
|
expect(Scimitar::Engine.resources()).to match_array([Scimitar::Resources::User, @license_resource])
|
89
89
|
end
|
90
90
|
|
91
91
|
it 'rejects bad defaults' do
|
92
92
|
expect {
|
93
|
-
Scimitar::Engine
|
94
|
-
}.to raise_error('Scimitar::Engine
|
93
|
+
Scimitar::Engine.set_default_resources([@license_resource])
|
94
|
+
}.to raise_error('Scimitar::Engine.set_default_resources: Only Scimitar::Resources::User, Scimitar::Resources::Group are supported')
|
95
95
|
end
|
96
96
|
|
97
97
|
it 'rejects empty defaults' do
|
98
98
|
expect {
|
99
|
-
Scimitar::Engine
|
100
|
-
}.to raise_error('Scimitar::Engine
|
99
|
+
Scimitar::Engine.set_default_resources([])
|
100
|
+
}.to raise_error('Scimitar::Engine.set_default_resources: At least one resource must be given')
|
101
101
|
end
|
102
102
|
end # "context '::resources, :add_custom_resource, ::set_default_resources' do"
|
103
103
|
|
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: 1.
|
4
|
+
version: 1.11.0
|
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: 2024-
|
12
|
+
date: 2024-10-22 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: rails
|
@@ -267,7 +267,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
267
267
|
- !ruby/object:Gem::Version
|
268
268
|
version: '0'
|
269
269
|
requirements: []
|
270
|
-
rubygems_version: 3.5.
|
270
|
+
rubygems_version: 3.5.16
|
271
271
|
signing_key:
|
272
272
|
specification_version: 4
|
273
273
|
summary: SCIM v2 for Rails
|