scimitar 1.2.0 → 1.2.1
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/app/controllers/scimitar/application_controller.rb +8 -3
- data/app/models/scimitar/resources/base.rb +1 -1
- data/lib/scimitar/version.rb +2 -2
- data/spec/requests/active_record_backed_resources_controller_spec.rb +1 -0
- data/spec/requests/application_controller_spec.rb +6 -3
- 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: 69cae1bb9cbd4ddcdf7914e35b4ac23ad7359c2d566d99071dfb346ae8b2f9d2
|
4
|
+
data.tar.gz: c1636e01e98e1938a1f62ffd27b8aa0c00a787860f93a95f445158cb8e7e6064
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 321cf5943bf587c925c827d909cb8dda138be977a03e211b1a7496e0c608da1055a0e4fb9aaa1d8f9877d5631a34dbba5f16c00b50098ca08b5bdfa6fed2cff2
|
7
|
+
data.tar.gz: 910f2e4f85c7722f71229cdbd680af6af64aa7d1186e8464ad6050b338f97bf6849042407b241acfc409a63ce8fe48023f1f251d3712d1ec8298cb91d911ce0f
|
@@ -82,12 +82,17 @@ module Scimitar
|
|
82
82
|
# request and subclass processing.
|
83
83
|
#
|
84
84
|
def require_scim
|
85
|
-
|
85
|
+
scim_mime_type = Mime::Type.lookup_by_extension(:scim).to_s
|
86
|
+
|
87
|
+
if request.content_type.nil?
|
88
|
+
request.format = :scim
|
89
|
+
request.headers['CONTENT_TYPE'] = scim_mime_type
|
90
|
+
elsif request.content_type&.downcase == scim_mime_type
|
86
91
|
request.format = :scim
|
87
92
|
elsif request.format == :scim
|
88
|
-
request.headers['CONTENT_TYPE'] =
|
93
|
+
request.headers['CONTENT_TYPE'] = scim_mime_type
|
89
94
|
else
|
90
|
-
handle_scim_error(ErrorResponse.new(status: 406, detail: "Only #{
|
95
|
+
handle_scim_error(ErrorResponse.new(status: 406, detail: "Only #{scim_mime_type} type is accepted."))
|
91
96
|
end
|
92
97
|
end
|
93
98
|
|
@@ -138,7 +138,7 @@ module Scimitar
|
|
138
138
|
end
|
139
139
|
|
140
140
|
def as_json(options = {})
|
141
|
-
self.meta = Meta.new unless self.meta
|
141
|
+
self.meta = Meta.new unless self.meta && self.meta.is_a?(Meta)
|
142
142
|
meta.resourceType = self.class.resource_type_id
|
143
143
|
original_hash = super(options).except('errors')
|
144
144
|
original_hash.merge!('schemas' => self.class.schemas.map(&:id))
|
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.2.
|
6
|
+
VERSION = '1.2.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 = '
|
11
|
+
DATE = '2022-06-15'
|
12
12
|
|
13
13
|
end
|
@@ -11,11 +11,14 @@ RSpec.describe Scimitar::ApplicationController do
|
|
11
11
|
end
|
12
12
|
|
13
13
|
context 'format handling' do
|
14
|
-
it 'renders "
|
14
|
+
it 'renders "OK" if the request does not provide any Content-Type value' do
|
15
15
|
get '/CustomRequestVerifiers', params: { format: :html }
|
16
16
|
|
17
|
-
expect(response).to have_http_status(:
|
18
|
-
|
17
|
+
expect(response).to have_http_status(:ok)
|
18
|
+
parsed_body = JSON.parse(response.body)
|
19
|
+
expect(parsed_body['request']['is_scim' ]).to eql(true)
|
20
|
+
expect(parsed_body['request']['format' ]).to eql('application/scim+json')
|
21
|
+
expect(parsed_body['request']['content_type']).to eql('application/scim+json')
|
19
22
|
end
|
20
23
|
|
21
24
|
it 'renders 400 if given bad JSON' do
|
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.2.
|
4
|
+
version: 1.2.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:
|
12
|
+
date: 2022-06-15 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.
|
263
|
+
rubygems_version: 3.1.6
|
264
264
|
signing_key:
|
265
265
|
specification_version: 4
|
266
266
|
summary: SCIM v2 for Rails
|