scimitar 2.4.1 → 2.4.3
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/engine_configuration.rb +9 -5
- data/app/models/scimitar/service_provider_configuration.rb +14 -3
- data/lib/scimitar/version.rb +2 -2
- data/lib/scimitar.rb +6 -2
- data/spec/requests/application_controller_spec.rb +10 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 243c45d533641c64634fc4c1aac05455c27e92aff2169ed313ba07aacc803bb2
|
4
|
+
data.tar.gz: b9930256cc4681b7025e2c1a6791588ae4a5cef7f574e6ed311f1cf0cdae6791
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: bffee2a6076dac93761cbd10e6f72d2fddd6f1504c6d305869d260df964175ae960a900bbb19d081f88962235885cd47953f04348f749860d028ccdcfe67e74c
|
7
|
+
data.tar.gz: 3f85427568803c6e5f4ebf00bf5759acf85be72b8e38eb26010e93a54afd48879f7dd106e11683c05ddcdb9d89411d674a55ca581be8a91dca6a7c882629a937
|
@@ -98,10 +98,10 @@ module Scimitar
|
|
98
98
|
def require_scim
|
99
99
|
scim_mime_type = Mime::Type.lookup_by_extension(:scim).to_s
|
100
100
|
|
101
|
-
if request.
|
101
|
+
if request.media_type.nil? || request.media_type.empty?
|
102
102
|
request.format = :scim
|
103
103
|
request.headers['CONTENT_TYPE'] = scim_mime_type
|
104
|
-
elsif request.
|
104
|
+
elsif request.media_type.downcase == scim_mime_type
|
105
105
|
request.format = :scim
|
106
106
|
elsif request.format == :scim
|
107
107
|
request.headers['CONTENT_TYPE'] = scim_mime_type
|
@@ -7,13 +7,17 @@ module Scimitar
|
|
7
7
|
class EngineConfiguration
|
8
8
|
include ActiveModel::Model
|
9
9
|
|
10
|
-
attr_accessor
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
10
|
+
attr_accessor(
|
11
|
+
:uses_defaults,
|
12
|
+
:basic_authenticator,
|
13
|
+
:token_authenticator,
|
14
|
+
:application_controller_mixin,
|
15
|
+
:exception_reporter,
|
16
|
+
:optional_value_fields_required,
|
17
|
+
)
|
15
18
|
|
16
19
|
def initialize(attributes = {})
|
20
|
+
@uses_defaults = attributes.empty?
|
17
21
|
|
18
22
|
# Set defaults that may be overridden by the initializer.
|
19
23
|
#
|
@@ -9,11 +9,22 @@ module Scimitar
|
|
9
9
|
class ServiceProviderConfiguration
|
10
10
|
include ActiveModel::Model
|
11
11
|
|
12
|
-
attr_accessor
|
13
|
-
:
|
14
|
-
:
|
12
|
+
attr_accessor(
|
13
|
+
:uses_defaults,
|
14
|
+
:patch,
|
15
|
+
:bulk,
|
16
|
+
:filter,
|
17
|
+
:changePassword,
|
18
|
+
:sort,
|
19
|
+
:etag,
|
20
|
+
:authenticationSchemes,
|
21
|
+
:schemas,
|
22
|
+
:meta,
|
23
|
+
)
|
15
24
|
|
16
25
|
def initialize(attributes = {})
|
26
|
+
@uses_defaults = attributes.empty?
|
27
|
+
|
17
28
|
defaults = {
|
18
29
|
bulk: Supportable.unsupported,
|
19
30
|
changePassword: Supportable.unsupported,
|
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.4.
|
6
|
+
VERSION = '2.4.3'
|
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 = '2023-
|
11
|
+
DATE = '2023-09-16'
|
12
12
|
|
13
13
|
end
|
data/lib/scimitar.rb
CHANGED
@@ -4,7 +4,9 @@ require 'scimitar/engine'
|
|
4
4
|
|
5
5
|
module Scimitar
|
6
6
|
def self.service_provider_configuration=(custom_configuration)
|
7
|
-
@service_provider_configuration
|
7
|
+
if @service_provider_configuration.nil? || ! custom_configuration.uses_defaults
|
8
|
+
@service_provider_configuration = custom_configuration
|
9
|
+
end
|
8
10
|
end
|
9
11
|
|
10
12
|
def self.service_provider_configuration(location:)
|
@@ -14,7 +16,9 @@ module Scimitar
|
|
14
16
|
end
|
15
17
|
|
16
18
|
def self.engine_configuration=(custom_configuration)
|
17
|
-
@engine_configuration
|
19
|
+
if @engine_configuration.nil? || ! custom_configuration.uses_defaults
|
20
|
+
@engine_configuration = custom_configuration
|
21
|
+
end
|
18
22
|
end
|
19
23
|
|
20
24
|
def self.engine_configuration
|
@@ -38,6 +38,16 @@ RSpec.describe Scimitar::ApplicationController do
|
|
38
38
|
expect(parsed_body['request']['content_type']).to eql('application/scim+json')
|
39
39
|
end
|
40
40
|
|
41
|
+
it 'translates Content-Type with charset to Rails request format' do
|
42
|
+
get '/CustomRequestVerifiers', headers: { 'CONTENT_TYPE' => 'application/scim+json; charset=utf-8' }
|
43
|
+
|
44
|
+
expect(response).to have_http_status(:ok)
|
45
|
+
parsed_body = JSON.parse(response.body)
|
46
|
+
expect(parsed_body['request']['is_scim' ]).to eql(true)
|
47
|
+
expect(parsed_body['request']['format' ]).to eql('application/scim+json')
|
48
|
+
expect(parsed_body['request']['content_type']).to eql('application/scim+json; charset=utf-8')
|
49
|
+
end
|
50
|
+
|
41
51
|
it 'translates Rails request format to header' do
|
42
52
|
get '/CustomRequestVerifiers', params: { format: :scim }
|
43
53
|
|
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.4.
|
4
|
+
version: 2.4.3
|
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: 2023-
|
12
|
+
date: 2023-09-16 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: rails
|