scim-kit 0.6.0 → 0.7.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 6e14ef26f924df00f2d3dd988ee342657b41a9c7bfcbe3c9e2656c94730992b0
4
- data.tar.gz: a3bc4e23502d61e28fd0ef1f0242ca66de7ad06fa2caaa186fb8f5d88cc2703e
3
+ metadata.gz: 6c3387262115568567b66e8b8841b1ee4cc2b5b6ae9907a0fbe6ba8d6b370527
4
+ data.tar.gz: 7d68e2ee54e4ea77afbbd6917ff88465d1f1159a4c9875d3cfc646ded9b59fcb
5
5
  SHA512:
6
- metadata.gz: c6ec37af2f3bcb9a92b2603daa754d99ae5f235802514f820c241cf3ecbf75831a7ed43b6e4f8f2463eebec868622e966e6352ca051b2c34992e951eb13a50c4
7
- data.tar.gz: dd0392513f242aa4e55b55b87b29c24f32962737a3728022e1e87a68d0004985945be20e0508591a67205db0d058e15d9f99e29602db63f84a884c361b9ab781
6
+ metadata.gz: 04652d7191799e43a400626471672c39fd29939bd7c7b6b84bc756a77262de54e74d624064e2ada5afd8edb0ef4e1bc4eb1137b065d3f64c2f1db7669303d359
7
+ data.tar.gz: cfb017b66a7fb18a3f97bde84043efb158015e8d3bd0b266146e203e5335e4f6aba6bc3d6abb082d124aacf83cd3707e97125b831f39ed7f1c88b60f511c15db
data/CHANGELOG.md CHANGED
@@ -1,4 +1,4 @@
1
- Version 0.6.0
1
+ Version 0.7.1
2
2
 
3
3
  # Changelog
4
4
  All notable changes to this project will be documented in this file.
@@ -7,6 +7,18 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
7
7
  and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
8
8
 
9
9
  ## [Unreleased]
10
+
11
+ ## [0.7.1] - 2022-12-12
12
+ ### Fixed
13
+ - Add support for duplicate attribute names
14
+
15
+ ## [0.7.0] - 2022-09-28
16
+ ### Added
17
+ - Add constant for 'urn:ietf:params:scim:api:messages:2.0:BulkRequest' [RFC-7644](https://www.rfc-editor.org/rfc/rfc7644.html#section-3.7)
18
+ - Add constant for 'urn:ietf:params:scim:api:messages:2.0:BulkResponse' [RFC-7644](https://www.rfc-editor.org/rfc/rfc7644.html#section-3.7)
19
+ - Add constant for 'urn:ietf:params:scim:api:messages:2.0:PatchOp' [RFC-7644](https://www.rfc-editor.org/rfc/rfc7644.html#section-3.5.2)
20
+ - Add constant for 'urn:ietf:params:scim:schemas:core:2.0:Schema' [RFC-7643](https://www.rfc-editor.org/rfc/rfc7643.html#section-7)
21
+
10
22
  ## [0.6.0] - 2022-05-23
11
23
  ### Added
12
24
  - Add support for Ruby 3.1
@@ -73,7 +85,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
73
85
  - \_assign does not coerce values by default.
74
86
  - errors are merged together instead of overwritten during attribute validation.
75
87
 
76
- [Unreleased]: https://github.com/xlgmokha/scim-kit/compare/v0.6.0...HEAD
88
+ [Unreleased]: https://github.com/xlgmokha/scim-kit/compare/v0.7.1...HEAD
89
+ [0.7.1]: https://github.com/xlgmokha/scim-kit/compare/v0.7.0...v0.7.1
90
+ [0.7.0]: https://github.com/xlgmokha/scim-kit/compare/v0.6.0...v0.7.0
77
91
  [0.6.0]: https://github.com/xlgmokha/scim-kit/compare/v0.5.3...v0.6.0
78
92
  [0.5.3]: https://github.com/xlgmokha/scim-kit/compare/v0.5.2...v0.5.3
79
93
  [0.5.2]: https://github.com/xlgmokha/scim-kit/compare/v0.5.1...v0.5.2
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- scim-kit (0.6.0)
4
+ scim-kit (0.7.1)
5
5
  activemodel (>= 6.1, < 8.0)
6
6
  net-hippie (~> 1.0)
7
7
  parslet (~> 2.0)
@@ -11,21 +11,21 @@ PATH
11
11
  GEM
12
12
  remote: https://rubygems.org/
13
13
  specs:
14
- actionview (7.0.3)
15
- activesupport (= 7.0.3)
14
+ actionview (7.0.4)
15
+ activesupport (= 7.0.4)
16
16
  builder (~> 3.1)
17
17
  erubi (~> 1.4)
18
18
  rails-dom-testing (~> 2.0)
19
19
  rails-html-sanitizer (~> 1.1, >= 1.2.0)
20
- activemodel (7.0.3)
21
- activesupport (= 7.0.3)
22
- activesupport (7.0.3)
20
+ activemodel (7.0.4)
21
+ activesupport (= 7.0.4)
22
+ activesupport (7.0.4)
23
23
  concurrent-ruby (~> 1.0, >= 1.0.2)
24
24
  i18n (>= 1.6, < 2)
25
25
  minitest (>= 5.1)
26
26
  tzinfo (~> 2.0)
27
- addressable (2.8.0)
28
- public_suffix (>= 2.0.2, < 5.0)
27
+ addressable (2.8.1)
28
+ public_suffix (>= 2.0.2, < 6.0)
29
29
  ast (2.4.2)
30
30
  builder (3.2.4)
31
31
  bundler-audit (0.9.1)
@@ -36,10 +36,10 @@ GEM
36
36
  rexml
37
37
  crass (1.0.6)
38
38
  diff-lcs (1.5.0)
39
- erubi (1.10.0)
39
+ erubi (1.11.0)
40
40
  ffaker (2.21.0)
41
41
  hashdiff (1.0.1)
42
- i18n (1.10.0)
42
+ i18n (1.12.0)
43
43
  concurrent-ruby (~> 1.0)
44
44
  jbuilder (2.11.5)
45
45
  actionview (>= 5.0.0)
@@ -48,41 +48,41 @@ GEM
48
48
  crass (~> 1.0.2)
49
49
  nokogiri (>= 1.5.9)
50
50
  mini_portile2 (2.8.0)
51
- minitest (5.15.0)
51
+ minitest (5.16.3)
52
52
  net-hippie (1.1.1)
53
- nokogiri (1.13.6)
53
+ nokogiri (1.13.10)
54
54
  mini_portile2 (~> 2.8.0)
55
55
  racc (~> 1.4)
56
- nokogiri (1.13.6-x86_64-linux)
56
+ nokogiri (1.13.10-x86_64-linux)
57
57
  racc (~> 1.4)
58
58
  parallel (1.21.0)
59
59
  parser (3.1.0.0)
60
60
  ast (~> 2.4.1)
61
61
  parslet (2.0.0)
62
- public_suffix (4.0.6)
62
+ public_suffix (5.0.0)
63
63
  racc (1.6.0)
64
64
  rails-dom-testing (2.0.3)
65
65
  activesupport (>= 4.2.0)
66
66
  nokogiri (>= 1.6)
67
- rails-html-sanitizer (1.4.2)
67
+ rails-html-sanitizer (1.4.3)
68
68
  loofah (~> 2.3)
69
69
  rainbow (3.1.1)
70
70
  rake (13.0.6)
71
71
  regexp_parser (2.2.0)
72
72
  rexml (3.2.5)
73
- rspec (3.11.0)
74
- rspec-core (~> 3.11.0)
75
- rspec-expectations (~> 3.11.0)
76
- rspec-mocks (~> 3.11.0)
77
- rspec-core (3.11.0)
78
- rspec-support (~> 3.11.0)
79
- rspec-expectations (3.11.0)
73
+ rspec (3.12.0)
74
+ rspec-core (~> 3.12.0)
75
+ rspec-expectations (~> 3.12.0)
76
+ rspec-mocks (~> 3.12.0)
77
+ rspec-core (3.12.0)
78
+ rspec-support (~> 3.12.0)
79
+ rspec-expectations (3.12.0)
80
80
  diff-lcs (>= 1.2.0, < 2.0)
81
- rspec-support (~> 3.11.0)
82
- rspec-mocks (3.11.0)
81
+ rspec-support (~> 3.12.0)
82
+ rspec-mocks (3.12.0)
83
83
  diff-lcs (>= 1.2.0, < 2.0)
84
- rspec-support (~> 3.11.0)
85
- rspec-support (3.11.0)
84
+ rspec-support (~> 3.12.0)
85
+ rspec-support (3.12.0)
86
86
  rubocop (0.93.1)
87
87
  parallel (~> 1.10)
88
88
  parser (>= 2.7.1.5)
@@ -99,14 +99,14 @@ GEM
99
99
  rubocop-ast (>= 0.7.1)
100
100
  ruby-progressbar (1.11.0)
101
101
  thor (1.2.1)
102
- tilt (2.0.10)
102
+ tilt (2.0.11)
103
103
  tilt-jbuilder (0.7.1)
104
104
  jbuilder
105
105
  tilt (>= 1.3.0, < 3)
106
- tzinfo (2.0.4)
106
+ tzinfo (2.0.5)
107
107
  concurrent-ruby (~> 1.0)
108
108
  unicode-display_width (1.8.0)
109
- webmock (3.14.0)
109
+ webmock (3.18.1)
110
110
  addressable (>= 2.8.0)
111
111
  crack (>= 0.3.2)
112
112
  hashdiff (>= 0.4.0, < 2.0.0)
@@ -38,7 +38,9 @@ module Scim
38
38
  # @param name [String] the name of the attribute to return
39
39
  # @return [Scim::Kit::V2::Attribute] the attribute or {Scim::Kit::V2::UnknownAttribute}
40
40
  def attribute_for(name)
41
- dynamic_attributes[name.to_s.underscore] || UnknownAttribute.new(name)
41
+ dynamic_attributes[name.to_s.underscore] ||
42
+ dynamic_attributes[name] ||
43
+ UnknownAttribute.new(name)
42
44
  end
43
45
 
44
46
  # Returns the value associated with the attribute name
@@ -86,11 +88,10 @@ module Scim
86
88
  end
87
89
 
88
90
  def attribute(type, resource)
89
- dynamic_attributes[type.name] = Attribute.new(
90
- type: type,
91
- resource: resource
92
- )
93
- extend(create_module_for(type))
91
+ previously_defined = dynamic_attributes.key?(type.name)
92
+ dynamic_attributes[previously_defined ? type.fully_qualified_name : type.name] =
93
+ Attribute.new(type: type, resource: resource)
94
+ extend(create_module_for(type)) unless previously_defined
94
95
  end
95
96
  end
96
97
  end
@@ -8,16 +8,15 @@ module Scim
8
8
  include Templatable
9
9
  attr_accessor :canonical_values, :case_exact, :description
10
10
  attr_accessor :multi_valued, :required
11
- attr_reader :mutability, :name, :type, :attributes
11
+ attr_reader :mutability, :name, :fully_qualified_name, :type, :attributes
12
12
  attr_reader :reference_types, :returned, :uniqueness
13
13
 
14
- def initialize(name:, type: :string)
14
+ def initialize(name:, type: :string, schema: nil)
15
15
  @name = name.to_s.underscore
16
+ @fully_qualified_name = [schema&.id, @name].compact.join('#')
16
17
  @type = DATATYPES[type.to_sym] ? type.to_sym : (raise TYPE_ERROR)
17
18
  @description = name.to_s.camelize(:lower)
18
- @multi_valued = false
19
- @required = false
20
- @case_exact = false
19
+ @multi_valued = @required = @case_exact = false
21
20
  @mutability = Mutability::READ_WRITE
22
21
  @returned = Returned::DEFAULT
23
22
  @uniqueness = Uniqueness::NONE
@@ -5,9 +5,12 @@ module Scim
5
5
  module V2
6
6
  module Messages
7
7
  CORE = 'urn:ietf:params:scim:api:messages:2.0'
8
+ BULK_REQUEST = "#{CORE}:BulkRequest"
9
+ BULK_RESPONSE = "#{CORE}:BulkResponse"
10
+ ERROR = "#{CORE}:Error"
8
11
  LIST_RESPONSE = "#{CORE}:ListResponse"
12
+ PATCH_OP = "#{CORE}:PatchOp"
9
13
  SEARCH_REQUEST = "#{CORE}:SearchRequest"
10
- ERROR = "#{CORE}:Error"
11
14
  end
12
15
  end
13
16
  end
@@ -21,7 +21,7 @@ module Scim
21
21
  end
22
22
 
23
23
  def add_attribute(name:, type: :string)
24
- attribute = AttributeType.new(name: name, type: type)
24
+ attribute = AttributeType.new(name: name, type: type, schema: self)
25
25
  yield attribute if block_given?
26
26
  attributes << attribute
27
27
  end
@@ -11,6 +11,7 @@ module Scim
11
11
  ENTERPRISE_USER = "#{EXTENSION}:enterprise:2.0:User"
12
12
  GROUP = "#{CORE}:Group"
13
13
  RESOURCE_TYPE = "#{CORE}:ResourceType"
14
+ SCHEMA = "#{CORE}:Schema"
14
15
  SERVICE_PROVIDER_CONFIGURATION = "#{CORE}:ServiceProviderConfig"
15
16
  USER = "#{CORE}:User"
16
17
  end
@@ -18,7 +18,8 @@ schemas.each do |schema|
18
18
  else
19
19
  json.set! schema.id do
20
20
  schema.attributes.each do |type|
21
- attribute = dynamic_attributes[type.name]
21
+ attribute = dynamic_attributes[type.fully_qualified_name] ||
22
+ dynamic_attributes[type.name]
22
23
  render attribute, json: json
23
24
  end
24
25
  end
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Scim
4
4
  module Kit
5
- VERSION = '0.6.0'
5
+ VERSION = '0.7.1'
6
6
  end
7
7
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: scim-kit
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.6.0
4
+ version: 0.7.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - mo
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2022-05-23 00:00:00.000000000 Z
11
+ date: 2022-12-12 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activemodel
@@ -271,7 +271,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
271
271
  - !ruby/object:Gem::Version
272
272
  version: '0'
273
273
  requirements: []
274
- rubygems_version: 3.3.14
274
+ rubygems_version: 3.3.22
275
275
  signing_key:
276
276
  specification_version: 4
277
277
  summary: A simple toolkit for working with SCIM 2.0