scimaenaga 0.9.0 → 0.9.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/README.md +8 -8
- data/Rakefile +6 -8
- data/app/controllers/concerns/{scim_rails → scimaenaga}/exception_handler.rb +10 -10
- data/app/controllers/concerns/scimaenaga/response.rb +94 -0
- data/app/controllers/scimaenaga/application_controller.rb +72 -0
- data/app/controllers/{scim_rails → scimaenaga}/scim_groups_controller.rb +25 -25
- data/app/controllers/{scim_rails → scimaenaga}/scim_schemas_controller.rb +5 -5
- data/app/controllers/scimaenaga/scim_users_controller.rb +104 -0
- data/app/helpers/{scim_rails → scimaenaga}/application_helper.rb +1 -1
- data/app/libraries/scim_patch.rb +2 -2
- data/app/libraries/scim_patch_operation.rb +1 -1
- data/app/libraries/scim_patch_operation_group.rb +3 -3
- data/app/libraries/scim_patch_operation_user.rb +2 -2
- data/app/models/{scim_rails → scimaenaga}/application_record.rb +1 -1
- data/app/models/scimaenaga/authorize_api_request.rb +39 -0
- data/app/models/{scim_rails → scimaenaga}/scim_count.rb +8 -4
- data/app/models/scimaenaga/scim_query_parser.rb +49 -0
- data/config/routes.rb +1 -1
- data/lib/generators/scimaenaga/USAGE +8 -0
- data/lib/generators/scimaenaga/scimaenaga_generator.rb +7 -0
- data/lib/generators/{scim_rails → scimaenaga}/templates/initializer.rb +22 -22
- data/lib/{scim_rails → scimaenaga}/config.rb +2 -2
- data/lib/scimaenaga/encoder.rb +27 -0
- data/lib/scimaenaga/engine.rb +12 -0
- data/lib/scimaenaga/version.rb +5 -0
- data/lib/scimaenaga.rb +6 -0
- data/lib/tasks/{scim_rails_tasks.rake → scimaenaga_tasks.rake} +1 -1
- data/spec/controllers/{scim_rails → scimaenaga}/scim_groups_controller_spec.rb +8 -8
- data/spec/controllers/{scim_rails → scimaenaga}/scim_groups_request_spec.rb +18 -18
- data/spec/controllers/{scim_rails → scimaenaga}/scim_schemas_controller_spec.rb +7 -7
- data/spec/controllers/{scim_rails → scimaenaga}/scim_schemas_request_spec.rb +1 -1
- data/spec/controllers/{scim_rails → scimaenaga}/scim_users_controller_spec.rb +14 -15
- data/spec/controllers/{scim_rails → scimaenaga}/scim_users_request_spec.rb +20 -20
- data/spec/dummy/app/assets/config/manifest.js +1 -1
- data/spec/dummy/config/application.rb +1 -2
- data/spec/dummy/config/initializers/{scim_rails_config.rb → scimaenaga_config.rb} +1 -1
- data/spec/dummy/config/routes.rb +1 -1
- data/spec/factories/company.rb +3 -3
- data/spec/lib/scimaenaga/encoder_spec.rb +64 -0
- data/spec/libraries/scim_patch_operation_group_spec.rb +14 -14
- data/spec/libraries/scim_patch_operation_user_spec.rb +5 -5
- data/spec/libraries/scim_patch_spec.rb +2 -2
- data/spec/models/scim_query_parser_spec.rb +5 -6
- metadata +40 -39
- data/app/controllers/concerns/scim_rails/response.rb +0 -94
- data/app/controllers/scim_rails/application_controller.rb +0 -72
- data/app/controllers/scim_rails/scim_users_controller.rb +0 -104
- data/app/models/scim_rails/authorize_api_request.rb +0 -40
- data/app/models/scim_rails/scim_query_parser.rb +0 -49
- data/lib/generators/scim_rails/USAGE +0 -8
- data/lib/generators/scim_rails/scim_rails_generator.rb +0 -7
- data/lib/scim_rails/encoder.rb +0 -25
- data/lib/scim_rails/engine.rb +0 -12
- data/lib/scim_rails/version.rb +0 -5
- data/lib/scim_rails.rb +0 -6
- data/spec/lib/scim_rails/encoder_spec.rb +0 -62
@@ -2,10 +2,10 @@
|
|
2
2
|
|
3
3
|
require 'spec_helper'
|
4
4
|
|
5
|
-
RSpec.describe
|
5
|
+
RSpec.describe Scimaenaga::ScimUsersController, type: :controller do
|
6
6
|
include AuthHelper
|
7
7
|
|
8
|
-
routes {
|
8
|
+
routes { Scimaenaga::Engine.routes }
|
9
9
|
|
10
10
|
describe 'index' do
|
11
11
|
let(:company) { create(:company) }
|
@@ -85,7 +85,7 @@ RSpec.describe ScimRails::ScimUsersController, type: :controller do
|
|
85
85
|
end
|
86
86
|
|
87
87
|
it 'paginates results by configurable scim_users_list_order' do
|
88
|
-
allow(
|
88
|
+
allow(Scimaenaga.config).to receive(:scim_users_list_order).and_return({ created_at: :desc })
|
89
89
|
|
90
90
|
create_list(:user, 400, company: company)
|
91
91
|
expect(company.users.first.id).to eq 1
|
@@ -334,7 +334,7 @@ RSpec.describe ScimRails::ScimUsersController, type: :controller do
|
|
334
334
|
end
|
335
335
|
|
336
336
|
it 'returns 409 if user already exists and config.scim_user_prevent_update_on_create is set to true' do
|
337
|
-
allow(
|
337
|
+
allow(Scimaenaga.config).to receive(:scim_user_prevent_update_on_create).and_return(true)
|
338
338
|
create(:user, email: 'new@example.com', company: company)
|
339
339
|
|
340
340
|
post :create, params: {
|
@@ -755,23 +755,23 @@ RSpec.describe ScimRails::ScimUsersController, type: :controller do
|
|
755
755
|
describe 'destroy' do
|
756
756
|
let(:company) { create(:company) }
|
757
757
|
|
758
|
-
context
|
759
|
-
it
|
758
|
+
context 'when unauthorized' do
|
759
|
+
it 'returns scim+json content type' do
|
760
760
|
delete :destroy, params: { id: 1 }, as: :json
|
761
761
|
|
762
|
-
expect(response.media_type).to eq
|
762
|
+
expect(response.media_type).to eq 'application/scim+json'
|
763
763
|
end
|
764
764
|
|
765
|
-
it
|
765
|
+
it 'fails with no credentials' do
|
766
766
|
delete :destroy, params: { id: 1 }, as: :json
|
767
767
|
|
768
768
|
expect(response.status).to eq 401
|
769
769
|
end
|
770
770
|
|
771
|
-
it
|
772
|
-
request.env[
|
771
|
+
it 'fails with invalid credentials' do
|
772
|
+
request.env['HTTP_AUTHORIZATION'] =
|
773
773
|
ActionController::HttpAuthentication::Basic
|
774
|
-
.encode_credentials(
|
774
|
+
.encode_credentials('unauthorized', '123456')
|
775
775
|
|
776
776
|
delete :destroy, params: { id: 1 }, as: :json
|
777
777
|
|
@@ -787,7 +787,6 @@ RSpec.describe ScimRails::ScimUsersController, type: :controller do
|
|
787
787
|
end
|
788
788
|
|
789
789
|
context 'when User destroy method is configured' do
|
790
|
-
|
791
790
|
it 'is sucessful with valid credentials' do
|
792
791
|
delete :destroy, params: { id: 1 }, as: :json
|
793
792
|
|
@@ -811,7 +810,7 @@ RSpec.describe ScimRails::ScimUsersController, type: :controller do
|
|
811
810
|
|
812
811
|
context 'when User destroy method is not configured' do
|
813
812
|
it 'does not delete User' do
|
814
|
-
allow(
|
813
|
+
allow(Scimaenaga.config).to(
|
815
814
|
receive(:user_destroy_method).and_return(nil)
|
816
815
|
)
|
817
816
|
|
@@ -825,7 +824,7 @@ RSpec.describe ScimRails::ScimUsersController, type: :controller do
|
|
825
824
|
|
826
825
|
context 'when User destroy method is invalid' do
|
827
826
|
it 'does not delete User' do
|
828
|
-
allow(
|
827
|
+
allow(Scimaenaga.config).to(
|
829
828
|
receive(:user_destroy_method).and_return('destory!')
|
830
829
|
)
|
831
830
|
|
@@ -840,7 +839,7 @@ RSpec.describe ScimRails::ScimUsersController, type: :controller do
|
|
840
839
|
context 'when target User is not found' do
|
841
840
|
it 'return 404 not found' do
|
842
841
|
expect do
|
843
|
-
delete :destroy, params: { id:
|
842
|
+
delete :destroy, params: { id: 999_999 }, as: :json
|
844
843
|
end.not_to change { company.users.reload.count }.from(1)
|
845
844
|
|
846
845
|
expect(response.status).to eq 404
|
@@ -1,51 +1,51 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
require
|
3
|
+
require 'spec_helper'
|
4
4
|
|
5
|
-
RSpec.describe
|
5
|
+
RSpec.describe Scimaenaga::ScimUsersController, type: :request do
|
6
6
|
let(:company) { create(:company) }
|
7
7
|
let(:credentials) do
|
8
8
|
Base64.encode64("#{company.subdomain}:#{company.api_token}")
|
9
9
|
end
|
10
10
|
let(:authorization) { "Basic #{credentials}" }
|
11
11
|
|
12
|
-
def post_request(content_type =
|
12
|
+
def post_request(content_type = 'application/scim+json')
|
13
13
|
# params need to be transformed into a string to test if they are being parsed by Rack
|
14
14
|
|
15
|
-
post
|
15
|
+
post '/scim/v2/Users',
|
16
16
|
params: {
|
17
17
|
name: {
|
18
|
-
givenName:
|
19
|
-
familyName:
|
18
|
+
givenName: 'New',
|
19
|
+
familyName: 'User',
|
20
20
|
},
|
21
21
|
emails: [
|
22
22
|
{
|
23
|
-
value:
|
23
|
+
value: 'new@example.com',
|
24
24
|
}
|
25
|
-
]
|
25
|
+
],
|
26
26
|
}.to_json,
|
27
27
|
headers: {
|
28
28
|
Authorization: authorization,
|
29
|
-
'Content-Type': content_type
|
29
|
+
'Content-Type': content_type,
|
30
30
|
}
|
31
31
|
end
|
32
32
|
|
33
|
-
describe
|
34
|
-
it
|
33
|
+
describe 'Content-Type' do
|
34
|
+
it 'accepts scim+json' do
|
35
35
|
expect(company.users.count).to eq 0
|
36
36
|
|
37
|
-
post_request(
|
37
|
+
post_request('application/scim+json')
|
38
38
|
|
39
39
|
expect(request.params).to include :name
|
40
40
|
expect(response.status).to eq 201
|
41
|
-
expect(response.media_type).to eq
|
41
|
+
expect(response.media_type).to eq 'application/scim+json'
|
42
42
|
expect(company.users.count).to eq 1
|
43
43
|
end
|
44
44
|
|
45
|
-
it
|
45
|
+
it 'can not parse unfamiliar content types' do
|
46
46
|
expect(company.users.count).to eq 0
|
47
47
|
|
48
|
-
post_request(
|
48
|
+
post_request('text/csv')
|
49
49
|
|
50
50
|
expect(request.params).not_to include :name
|
51
51
|
expect(response.status).to eq 422
|
@@ -53,21 +53,21 @@ RSpec.describe ScimRails::ScimUsersController, type: :request do
|
|
53
53
|
end
|
54
54
|
end
|
55
55
|
|
56
|
-
context
|
57
|
-
context
|
56
|
+
context 'OAuth Bearer Authorization' do
|
57
|
+
context 'with valid token' do
|
58
58
|
let(:authorization) { "Bearer #{company.api_token}" }
|
59
59
|
|
60
|
-
it
|
60
|
+
it 'supports OAuth bearer authorization and succeeds' do
|
61
61
|
expect { post_request }.to change(company.users, :count).from(0).to(1)
|
62
62
|
|
63
63
|
expect(response.status).to eq 201
|
64
64
|
end
|
65
65
|
end
|
66
66
|
|
67
|
-
context
|
67
|
+
context 'with invalid token' do
|
68
68
|
let(:authorization) { "Bearer #{SecureRandom.hex}" }
|
69
69
|
|
70
|
-
it
|
70
|
+
it 'The request fails' do
|
71
71
|
expect { post_request }.not_to change(company.users, :count)
|
72
72
|
|
73
73
|
expect(response.status).to eq 401
|
@@ -3,7 +3,7 @@ require_relative 'boot'
|
|
3
3
|
require 'rails/all'
|
4
4
|
|
5
5
|
Bundler.require(*Rails.groups)
|
6
|
-
require
|
6
|
+
require 'scimaenaga'
|
7
7
|
|
8
8
|
module Dummy
|
9
9
|
class Application < Rails::Application
|
@@ -12,4 +12,3 @@ module Dummy
|
|
12
12
|
# -- all .rb files in that directory are automatically loaded.
|
13
13
|
end
|
14
14
|
end
|
15
|
-
|
data/spec/dummy/config/routes.rb
CHANGED
data/spec/factories/company.rb
CHANGED
@@ -1,10 +1,10 @@
|
|
1
1
|
FactoryBot.define do
|
2
2
|
factory :company do
|
3
|
-
name {
|
4
|
-
subdomain {
|
3
|
+
name { 'Test Company' }
|
4
|
+
subdomain { 'test' }
|
5
5
|
|
6
6
|
after(:build) do |company|
|
7
|
-
company.api_token =
|
7
|
+
company.api_token = Scimaenaga::Encoder.encode(company)
|
8
8
|
end
|
9
9
|
end
|
10
10
|
end
|
@@ -0,0 +1,64 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
describe Scimaenaga::Encoder do
|
4
|
+
let(:company) { Company.new(subdomain: 'test') }
|
5
|
+
|
6
|
+
describe '::encode' do
|
7
|
+
context 'with signing configuration' do
|
8
|
+
it 'generates a signed token with the company attribute' do
|
9
|
+
token = Scimaenaga::Encoder.encode(company)
|
10
|
+
payload = Scimaenaga::Encoder.decode(token)
|
11
|
+
|
12
|
+
expect(token).to match(/[a-z|A-Z0-9.]{16,}\.[a-z|A-Z0-9.]{16,}/)
|
13
|
+
expect(payload).to contain_exactly(['iat', Integer], %w[subdomain test])
|
14
|
+
end
|
15
|
+
end
|
16
|
+
|
17
|
+
context 'without signing configuration' do
|
18
|
+
before do
|
19
|
+
allow(Scimaenaga.config).to receive(:signing_secret).and_return(nil)
|
20
|
+
allow(Scimaenaga.config).to receive(:signing_algorithm).and_return(Scimaenaga::Config::ALGO_NONE)
|
21
|
+
end
|
22
|
+
|
23
|
+
it 'generates an unsigned token with the company attribute' do
|
24
|
+
token = Scimaenaga::Encoder.encode(company)
|
25
|
+
payload = Scimaenaga::Encoder.decode(token)
|
26
|
+
|
27
|
+
expect(token).to match(/[a-z|A-Z0-9.]{16,}/)
|
28
|
+
expect(payload).to contain_exactly(['iat', Integer], %w[subdomain test])
|
29
|
+
end
|
30
|
+
end
|
31
|
+
end
|
32
|
+
|
33
|
+
describe '::decode' do
|
34
|
+
let(:token) { Scimaenaga::Encoder.encode(company) }
|
35
|
+
|
36
|
+
it 'raises InvalidCredentials error for an invalid token' do
|
37
|
+
token = 'f487bf84bfub4f74fj4894fnh483f4h4u8f'
|
38
|
+
expect do
|
39
|
+
Scimaenaga::Encoder.decode(token)
|
40
|
+
end.to raise_error Scimaenaga::ExceptionHandler::InvalidCredentials
|
41
|
+
end
|
42
|
+
|
43
|
+
context 'with signing configuration' do
|
44
|
+
it 'decodes a signed token, returning the company attributes' do
|
45
|
+
payload = Scimaenaga::Encoder.decode(token)
|
46
|
+
|
47
|
+
expect(payload).to contain_exactly(['iat', Integer], %w[subdomain test])
|
48
|
+
end
|
49
|
+
end
|
50
|
+
|
51
|
+
context 'without signing configuration' do
|
52
|
+
before do
|
53
|
+
allow(Scimaenaga.config).to receive(:signing_secret).and_return(nil)
|
54
|
+
allow(Scimaenaga.config).to receive(:signing_algorithm).and_return(Scimaenaga::Config::ALGO_NONE)
|
55
|
+
end
|
56
|
+
|
57
|
+
it 'decodes an unsigned token, returning the company attributes' do
|
58
|
+
payload = Scimaenaga::Encoder.decode(token)
|
59
|
+
|
60
|
+
expect(payload).to contain_exactly(['iat', Integer], %w[subdomain test])
|
61
|
+
end
|
62
|
+
end
|
63
|
+
end
|
64
|
+
end
|
@@ -24,10 +24,10 @@ describe ScimPatchOperationGroup do
|
|
24
24
|
end
|
25
25
|
context 'replace displayName' do
|
26
26
|
it {
|
27
|
-
allow(
|
27
|
+
allow(Scimaenaga.config).to(
|
28
28
|
receive(:mutable_group_attributes_schema).and_return(mutable_attributes_schema)
|
29
29
|
)
|
30
|
-
allow(
|
30
|
+
allow(Scimaenaga.config).to(
|
31
31
|
receive(:group_member_relation_attribute).and_return(group_member_relation_attribute)
|
32
32
|
)
|
33
33
|
expect(operation.op).to eq 'replace'
|
@@ -43,10 +43,10 @@ describe ScimPatchOperationGroup do
|
|
43
43
|
context 'add displayName' do
|
44
44
|
let(:op) { 'add' }
|
45
45
|
it {
|
46
|
-
allow(
|
46
|
+
allow(Scimaenaga.config).to(
|
47
47
|
receive(:mutable_group_attributes_schema).and_return(mutable_attributes_schema)
|
48
48
|
)
|
49
|
-
allow(
|
49
|
+
allow(Scimaenaga.config).to(
|
50
50
|
receive(:group_member_relation_attribute).and_return(group_member_relation_attribute)
|
51
51
|
)
|
52
52
|
expect(operation.op).to eq 'add'
|
@@ -62,10 +62,10 @@ describe ScimPatchOperationGroup do
|
|
62
62
|
context 'remove displayName' do
|
63
63
|
let(:op) { 'remove' }
|
64
64
|
it {
|
65
|
-
allow(
|
65
|
+
allow(Scimaenaga.config).to(
|
66
66
|
receive(:mutable_group_attributes_schema).and_return(mutable_attributes_schema)
|
67
67
|
)
|
68
|
-
allow(
|
68
|
+
allow(Scimaenaga.config).to(
|
69
69
|
receive(:group_member_relation_attribute).and_return(group_member_relation_attribute)
|
70
70
|
)
|
71
71
|
expect(operation.op).to eq 'remove'
|
@@ -83,10 +83,10 @@ describe ScimPatchOperationGroup do
|
|
83
83
|
let(:path) { 'members' }
|
84
84
|
let(:value) { [{ 'value' => user3.id.to_s }, { 'value' => user4.id.to_s }] }
|
85
85
|
it {
|
86
|
-
allow(
|
86
|
+
allow(Scimaenaga.config).to(
|
87
87
|
receive(:mutable_group_attributes_schema).and_return(mutable_attributes_schema)
|
88
88
|
)
|
89
|
-
allow(
|
89
|
+
allow(Scimaenaga.config).to(
|
90
90
|
receive(:group_member_relation_attribute).and_return(group_member_relation_attribute)
|
91
91
|
)
|
92
92
|
expect(operation.op).to eq 'add'
|
@@ -104,10 +104,10 @@ describe ScimPatchOperationGroup do
|
|
104
104
|
let(:path) { 'members' }
|
105
105
|
let(:value) { [{ 'value' => user3.id.to_s }, { 'value' => user4.id.to_s }] }
|
106
106
|
it {
|
107
|
-
allow(
|
107
|
+
allow(Scimaenaga.config).to(
|
108
108
|
receive(:mutable_group_attributes_schema).and_return(mutable_attributes_schema)
|
109
109
|
)
|
110
|
-
allow(
|
110
|
+
allow(Scimaenaga.config).to(
|
111
111
|
receive(:group_member_relation_attribute).and_return(group_member_relation_attribute)
|
112
112
|
)
|
113
113
|
expect(operation.op).to eq 'replace'
|
@@ -125,10 +125,10 @@ describe ScimPatchOperationGroup do
|
|
125
125
|
let(:path) { 'members' }
|
126
126
|
let(:value) { [{ 'value' => user1.id.to_s }, { 'value' => user2.id.to_s }] }
|
127
127
|
it {
|
128
|
-
allow(
|
128
|
+
allow(Scimaenaga.config).to(
|
129
129
|
receive(:mutable_group_attributes_schema).and_return(mutable_attributes_schema)
|
130
130
|
)
|
131
|
-
allow(
|
131
|
+
allow(Scimaenaga.config).to(
|
132
132
|
receive(:group_member_relation_attribute).and_return(group_member_relation_attribute)
|
133
133
|
)
|
134
134
|
expect(operation.op).to eq 'remove'
|
@@ -146,10 +146,10 @@ describe ScimPatchOperationGroup do
|
|
146
146
|
let(:path) { "members[value eq \"#{user1.id}\"]" }
|
147
147
|
let(:value) { nil }
|
148
148
|
it {
|
149
|
-
allow(
|
149
|
+
allow(Scimaenaga.config).to(
|
150
150
|
receive(:mutable_group_attributes_schema).and_return(mutable_attributes_schema)
|
151
151
|
)
|
152
|
-
allow(
|
152
|
+
allow(Scimaenaga.config).to(
|
153
153
|
receive(:group_member_relation_attribute).and_return(group_member_relation_attribute)
|
154
154
|
)
|
155
155
|
expect(operation.op).to eq 'remove'
|
@@ -33,7 +33,7 @@ describe ScimPatchOperationUser do
|
|
33
33
|
describe '#initialize' do
|
34
34
|
context 'replace single attribute' do
|
35
35
|
it {
|
36
|
-
allow(
|
36
|
+
allow(Scimaenaga.config).to(
|
37
37
|
receive(:mutable_user_attributes_schema).and_return(mutable_attributes_schema)
|
38
38
|
)
|
39
39
|
expect(operation.op).to eq 'replace'
|
@@ -46,7 +46,7 @@ describe ScimPatchOperationUser do
|
|
46
46
|
context 'add single attribute' do
|
47
47
|
let(:op) { 'add' }
|
48
48
|
it {
|
49
|
-
allow(
|
49
|
+
allow(Scimaenaga.config).to(
|
50
50
|
receive(:mutable_user_attributes_schema).and_return(mutable_attributes_schema)
|
51
51
|
)
|
52
52
|
expect(operation.op).to eq 'add'
|
@@ -59,7 +59,7 @@ describe ScimPatchOperationUser do
|
|
59
59
|
context 'remove single attribute' do
|
60
60
|
let(:op) { 'remove' }
|
61
61
|
it {
|
62
|
-
allow(
|
62
|
+
allow(Scimaenaga.config).to(
|
63
63
|
receive(:mutable_user_attributes_schema).and_return(mutable_attributes_schema)
|
64
64
|
)
|
65
65
|
expect(operation.op).to eq 'remove'
|
@@ -73,7 +73,7 @@ describe ScimPatchOperationUser do
|
|
73
73
|
let(:path) { 'emails[type eq "work"].value' }
|
74
74
|
let(:value) { 'taro.suzuki@example.com' }
|
75
75
|
it {
|
76
|
-
allow(
|
76
|
+
allow(Scimaenaga.config).to(
|
77
77
|
receive(:mutable_user_attributes_schema).and_return(mutable_attributes_schema)
|
78
78
|
)
|
79
79
|
expect(operation.op).to eq 'replace'
|
@@ -88,7 +88,7 @@ describe ScimPatchOperationUser do
|
|
88
88
|
let(:path) { 'name.familyName' }
|
89
89
|
let(:value) { 'Suzuki' }
|
90
90
|
it {
|
91
|
-
allow(
|
91
|
+
allow(Scimaenaga.config).to(
|
92
92
|
receive(:mutable_user_attributes_schema).and_return(mutable_attributes_schema)
|
93
93
|
)
|
94
94
|
expect(operation.op).to eq 'replace'
|
@@ -6,7 +6,7 @@ describe ScimPatch do
|
|
6
6
|
shared_examples :user do
|
7
7
|
let(:patch) { ScimPatch.new(params, :user) }
|
8
8
|
it {
|
9
|
-
allow(
|
9
|
+
allow(Scimaenaga.config).to(
|
10
10
|
receive(:mutable_user_attributes_schema).and_return(mutable_user_attributes_schema)
|
11
11
|
)
|
12
12
|
|
@@ -142,7 +142,7 @@ describe ScimPatch do
|
|
142
142
|
end
|
143
143
|
let(:patch) { described_class.new(params, :group) }
|
144
144
|
it {
|
145
|
-
allow(
|
145
|
+
allow(Scimaenaga.config).to(
|
146
146
|
receive(:mutable_group_attributes_schema).and_return(mutable_group_attributes_schema)
|
147
147
|
)
|
148
148
|
|
@@ -2,19 +2,18 @@
|
|
2
2
|
|
3
3
|
require 'spec_helper'
|
4
4
|
|
5
|
-
describe
|
6
|
-
|
5
|
+
describe Scimaenaga::ScimQueryParser do
|
7
6
|
let(:query_string) { 'userName eq "taro"' }
|
8
|
-
let(:queryable_attributes)
|
7
|
+
let(:queryable_attributes) do
|
9
8
|
{
|
10
9
|
userName: :name,
|
11
10
|
emails: [
|
12
11
|
{
|
13
|
-
value: :email
|
12
|
+
value: :email,
|
14
13
|
}
|
15
|
-
]
|
14
|
+
],
|
16
15
|
}
|
17
|
-
|
16
|
+
end
|
18
17
|
let(:parser) { described_class.new(query_string, queryable_attributes) }
|
19
18
|
|
20
19
|
describe '#attribute' do
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: scimaenaga
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.9.
|
4
|
+
version: 0.9.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Studist Corporation
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2022-02-
|
11
|
+
date: 2022-02-25 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|
@@ -143,39 +143,39 @@ files:
|
|
143
143
|
- MIT-LICENSE
|
144
144
|
- README.md
|
145
145
|
- Rakefile
|
146
|
-
- app/controllers/concerns/
|
147
|
-
- app/controllers/concerns/
|
148
|
-
- app/controllers/
|
149
|
-
- app/controllers/
|
150
|
-
- app/controllers/
|
151
|
-
- app/controllers/
|
152
|
-
- app/helpers/
|
146
|
+
- app/controllers/concerns/scimaenaga/exception_handler.rb
|
147
|
+
- app/controllers/concerns/scimaenaga/response.rb
|
148
|
+
- app/controllers/scimaenaga/application_controller.rb
|
149
|
+
- app/controllers/scimaenaga/scim_groups_controller.rb
|
150
|
+
- app/controllers/scimaenaga/scim_schemas_controller.rb
|
151
|
+
- app/controllers/scimaenaga/scim_users_controller.rb
|
152
|
+
- app/helpers/scimaenaga/application_helper.rb
|
153
153
|
- app/libraries/scim_patch.rb
|
154
154
|
- app/libraries/scim_patch_operation.rb
|
155
155
|
- app/libraries/scim_patch_operation_converter.rb
|
156
156
|
- app/libraries/scim_patch_operation_group.rb
|
157
157
|
- app/libraries/scim_patch_operation_user.rb
|
158
|
-
- app/models/
|
159
|
-
- app/models/
|
160
|
-
- app/models/
|
161
|
-
- app/models/
|
158
|
+
- app/models/scimaenaga/application_record.rb
|
159
|
+
- app/models/scimaenaga/authorize_api_request.rb
|
160
|
+
- app/models/scimaenaga/scim_count.rb
|
161
|
+
- app/models/scimaenaga/scim_query_parser.rb
|
162
162
|
- config/initializers/mime_types.rb
|
163
163
|
- config/routes.rb
|
164
|
-
- lib/generators/
|
165
|
-
- lib/generators/
|
166
|
-
- lib/generators/
|
167
|
-
- lib/
|
168
|
-
- lib/
|
169
|
-
- lib/
|
170
|
-
- lib/
|
171
|
-
- lib/
|
172
|
-
- lib/tasks/
|
173
|
-
- spec/controllers/
|
174
|
-
- spec/controllers/
|
175
|
-
- spec/controllers/
|
176
|
-
- spec/controllers/
|
177
|
-
- spec/controllers/
|
178
|
-
- spec/controllers/
|
164
|
+
- lib/generators/scimaenaga/USAGE
|
165
|
+
- lib/generators/scimaenaga/scimaenaga_generator.rb
|
166
|
+
- lib/generators/scimaenaga/templates/initializer.rb
|
167
|
+
- lib/scimaenaga.rb
|
168
|
+
- lib/scimaenaga/config.rb
|
169
|
+
- lib/scimaenaga/encoder.rb
|
170
|
+
- lib/scimaenaga/engine.rb
|
171
|
+
- lib/scimaenaga/version.rb
|
172
|
+
- lib/tasks/scimaenaga_tasks.rake
|
173
|
+
- spec/controllers/scimaenaga/scim_groups_controller_spec.rb
|
174
|
+
- spec/controllers/scimaenaga/scim_groups_request_spec.rb
|
175
|
+
- spec/controllers/scimaenaga/scim_schemas_controller_spec.rb
|
176
|
+
- spec/controllers/scimaenaga/scim_schemas_request_spec.rb
|
177
|
+
- spec/controllers/scimaenaga/scim_users_controller_spec.rb
|
178
|
+
- spec/controllers/scimaenaga/scim_users_request_spec.rb
|
179
179
|
- spec/dummy/Rakefile
|
180
180
|
- spec/dummy/app/assets/config/manifest.js
|
181
181
|
- spec/dummy/app/assets/javascripts/application.js
|
@@ -217,7 +217,7 @@ files:
|
|
217
217
|
- spec/dummy/config/initializers/inflections.rb
|
218
218
|
- spec/dummy/config/initializers/mime_types.rb
|
219
219
|
- spec/dummy/config/initializers/new_framework_defaults.rb
|
220
|
-
- spec/dummy/config/initializers/
|
220
|
+
- spec/dummy/config/initializers/scimaenaga_config.rb
|
221
221
|
- spec/dummy/config/initializers/session_store.rb
|
222
222
|
- spec/dummy/config/initializers/wrap_parameters.rb
|
223
223
|
- spec/dummy/config/locales/en.yml
|
@@ -242,7 +242,7 @@ files:
|
|
242
242
|
- spec/factories/company.rb
|
243
243
|
- spec/factories/group.rb
|
244
244
|
- spec/factories/user.rb
|
245
|
-
- spec/lib/
|
245
|
+
- spec/lib/scimaenaga/encoder_spec.rb
|
246
246
|
- spec/libraries/scim_patch_operation_group_spec.rb
|
247
247
|
- spec/libraries/scim_patch_operation_user_spec.rb
|
248
248
|
- spec/libraries/scim_patch_spec.rb
|
@@ -253,7 +253,8 @@ files:
|
|
253
253
|
homepage: https://github.com/StudistCorporation/scimaenaga
|
254
254
|
licenses:
|
255
255
|
- MIT
|
256
|
-
metadata:
|
256
|
+
metadata:
|
257
|
+
rubygems_mfa_required: 'true'
|
257
258
|
post_install_message:
|
258
259
|
rdoc_options: []
|
259
260
|
require_paths:
|
@@ -300,8 +301,8 @@ test_files:
|
|
300
301
|
- spec/dummy/config/initializers/inflections.rb
|
301
302
|
- spec/dummy/config/initializers/new_framework_defaults.rb
|
302
303
|
- spec/dummy/config/initializers/filter_parameter_logging.rb
|
303
|
-
- spec/dummy/config/initializers/scim_rails_config.rb
|
304
304
|
- spec/dummy/config/initializers/session_store.rb
|
305
|
+
- spec/dummy/config/initializers/scimaenaga_config.rb
|
305
306
|
- spec/dummy/config/initializers/cookies_serializer.rb
|
306
307
|
- spec/dummy/config/initializers/application_controller_renderer.rb
|
307
308
|
- spec/dummy/config/boot.rb
|
@@ -342,13 +343,13 @@ test_files:
|
|
342
343
|
- spec/dummy/public/422.html
|
343
344
|
- spec/support/factory_bot.rb
|
344
345
|
- spec/support/auth_helper.rb
|
345
|
-
- spec/lib/
|
346
|
-
- spec/controllers/
|
347
|
-
- spec/controllers/
|
348
|
-
- spec/controllers/
|
349
|
-
- spec/controllers/
|
350
|
-
- spec/controllers/
|
351
|
-
- spec/controllers/
|
346
|
+
- spec/lib/scimaenaga/encoder_spec.rb
|
347
|
+
- spec/controllers/scimaenaga/scim_users_controller_spec.rb
|
348
|
+
- spec/controllers/scimaenaga/scim_schemas_request_spec.rb
|
349
|
+
- spec/controllers/scimaenaga/scim_users_request_spec.rb
|
350
|
+
- spec/controllers/scimaenaga/scim_schemas_controller_spec.rb
|
351
|
+
- spec/controllers/scimaenaga/scim_groups_request_spec.rb
|
352
|
+
- spec/controllers/scimaenaga/scim_groups_controller_spec.rb
|
352
353
|
- spec/libraries/scim_patch_operation_user_spec.rb
|
353
354
|
- spec/libraries/scim_patch_spec.rb
|
354
355
|
- spec/libraries/scim_patch_operation_group_spec.rb
|