scim-kit 0.2.13 → 0.2.14
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/scim/kit/templatable.rb +4 -0
- data/lib/scim/kit/template.rb +1 -5
- data/lib/scim/kit/v2.rb +1 -0
- data/lib/scim/kit/v2/error.rb +41 -0
- data/lib/scim/kit/v2/resource.rb +2 -0
- data/lib/scim/kit/v2/schema.rb +2 -1
- data/lib/scim/kit/version.rb +1 -1
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: dbc81233afe702bcd1a1288da763ff6427ecd3f43960d7f929b608434f617a1f
|
4
|
+
data.tar.gz: 7973302adf611f0bde1ecbb4a47f7d9214763f6c7ee15e6c23af697fc27dfe02
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 72fd293f278e2d2c8ffbcdb63f871d27d47e919df333abab4db973ce8a350c7cfb600f505cfb25a56185485406ad11b605e5e53dc80b53eed49b26b754a7b5eb
|
7
|
+
data.tar.gz: 16c34302e8ff58c54d4fc22043bad37aea6f8f050d75f1c2c7ac7165f8f51bd84aa89472c4e55cded70a4beebebaf239661b8e1e87c3f3799d0b8808b3a9b069
|
data/lib/scim/kit/templatable.rb
CHANGED
data/lib/scim/kit/template.rb
CHANGED
@@ -19,11 +19,7 @@ module Scim
|
|
19
19
|
private
|
20
20
|
|
21
21
|
def template_path
|
22
|
-
TEMPLATES_DIR.join(template_name)
|
23
|
-
end
|
24
|
-
|
25
|
-
def template_name
|
26
|
-
"#{target.class.name.split('::').last.underscore}.json.jbuilder"
|
22
|
+
TEMPLATES_DIR.join(target.template_name)
|
27
23
|
end
|
28
24
|
|
29
25
|
def template
|
data/lib/scim/kit/v2.rb
CHANGED
@@ -9,6 +9,7 @@ require 'scim/kit/v2/messages'
|
|
9
9
|
require 'scim/kit/v2/meta'
|
10
10
|
require 'scim/kit/v2/mutability'
|
11
11
|
require 'scim/kit/v2/resource'
|
12
|
+
require 'scim/kit/v2/error'
|
12
13
|
require 'scim/kit/v2/resource_type'
|
13
14
|
require 'scim/kit/v2/returned'
|
14
15
|
require 'scim/kit/v2/schema'
|
@@ -0,0 +1,41 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Scim
|
4
|
+
module Kit
|
5
|
+
module V2
|
6
|
+
# Represents a SCIM Error
|
7
|
+
class Error < Resource
|
8
|
+
SCIM_TYPES = %w[
|
9
|
+
invalidPath
|
10
|
+
invalidSyntax
|
11
|
+
invalidSyntax
|
12
|
+
invalidValue
|
13
|
+
invalidVers
|
14
|
+
mutability
|
15
|
+
noTarget
|
16
|
+
sensitive
|
17
|
+
tooMany
|
18
|
+
uniqueness
|
19
|
+
].freeze
|
20
|
+
|
21
|
+
def initialize(schemas: [self.class.default_schema])
|
22
|
+
super(schemas: schemas)
|
23
|
+
end
|
24
|
+
|
25
|
+
def template_name
|
26
|
+
'resource.json.jbuilder'
|
27
|
+
end
|
28
|
+
|
29
|
+
def self.default_schema
|
30
|
+
Schema.new(id: Messages::ERROR, name: 'Error', location: nil) do |x|
|
31
|
+
x.add_attribute(name: :scim_type) do |attribute|
|
32
|
+
attribute.canonical_values = SCIM_TYPES
|
33
|
+
end
|
34
|
+
x.add_attribute(name: :detail)
|
35
|
+
x.add_attribute(name: :status, type: :integer)
|
36
|
+
end
|
37
|
+
end
|
38
|
+
end
|
39
|
+
end
|
40
|
+
end
|
41
|
+
end
|
data/lib/scim/kit/v2/resource.rb
CHANGED
@@ -12,6 +12,7 @@ module Scim
|
|
12
12
|
attr_accessor :id, :external_id
|
13
13
|
attr_reader :meta
|
14
14
|
attr_reader :schemas
|
15
|
+
attr_reader :raw_attributes
|
15
16
|
|
16
17
|
validate :schema_validations
|
17
18
|
|
@@ -19,6 +20,7 @@ module Scim
|
|
19
20
|
@meta = Meta.new(schemas[0].name, location)
|
20
21
|
@meta.disable_timestamps
|
21
22
|
@schemas = schemas
|
23
|
+
@raw_attributes = attributes
|
22
24
|
schemas.each do |schema|
|
23
25
|
define_attributes_for(self, schema.attributes)
|
24
26
|
end
|
data/lib/scim/kit/v2/schema.rb
CHANGED
@@ -17,6 +17,7 @@ module Scim
|
|
17
17
|
@meta = Meta.new('Schema', location)
|
18
18
|
@meta.created = @meta.last_modified = @meta.version = nil
|
19
19
|
@attributes = []
|
20
|
+
yield self if block_given?
|
20
21
|
end
|
21
22
|
|
22
23
|
def add_attribute(name:, type: :string)
|
@@ -26,7 +27,7 @@ module Scim
|
|
26
27
|
end
|
27
28
|
|
28
29
|
def core?
|
29
|
-
id.include?(Schemas::CORE)
|
30
|
+
id.include?(Schemas::CORE) || id.include?(Messages::CORE)
|
30
31
|
end
|
31
32
|
|
32
33
|
def self.build(*args)
|
data/lib/scim/kit/version.rb
CHANGED
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.2.
|
4
|
+
version: 0.2.14
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- mo
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-01-
|
11
|
+
date: 2019-01-18 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activemodel
|
@@ -198,6 +198,7 @@ files:
|
|
198
198
|
- lib/scim/kit/v2/attribute_type.rb
|
199
199
|
- lib/scim/kit/v2/authentication_scheme.rb
|
200
200
|
- lib/scim/kit/v2/configuration.rb
|
201
|
+
- lib/scim/kit/v2/error.rb
|
201
202
|
- lib/scim/kit/v2/messages.rb
|
202
203
|
- lib/scim/kit/v2/meta.rb
|
203
204
|
- lib/scim/kit/v2/mutability.rb
|