kcv 0.2.4 → 0.3.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/kcv.gemspec +1 -2
- data/lib/kcv/agent_resolver.rb +10 -13
- data/lib/kcv/version.rb +1 -1
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 0bb0cf6de7e99620e2302ad946da2041b1400ed2432e562bb0400b55cbd356ce
|
4
|
+
data.tar.gz: cc766a663d2bdd9d8388a56dfefac506cf6f9d69d21a4f8f1657b7d4cb471ae5
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 920af9395cf8dbf8b7b59104e3f944e536f3233722aa2abca86ea0fb70a3bc5d8fb3d11d07e250ea00b5e41bfe93369a2613ef5b2863183672fedde71190de83
|
7
|
+
data.tar.gz: 3bab72f6a0e8c741ec9d473b99d3d23a125df6b7702e951a5bdf9e7811f559f68a022dbd15c5201f678ab94fd696711779f3692c50ec4cec9d24864e383168c5
|
data/kcv.gemspec
CHANGED
@@ -1,4 +1,3 @@
|
|
1
|
-
|
2
1
|
# frozen_string_literal: true
|
3
2
|
|
4
3
|
lib = File.expand_path('lib', __dir__)
|
@@ -26,7 +25,7 @@ Gem::Specification.new do |spec|
|
|
26
25
|
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
|
27
26
|
spec.require_paths = ["lib"]
|
28
27
|
|
29
|
-
spec.add_dependency "checkpoint", "~> 1.0
|
28
|
+
spec.add_dependency "checkpoint", "~> 1.1.0"
|
30
29
|
spec.add_dependency "keycard", "~> 0.2.4"
|
31
30
|
spec.add_dependency "vizier", "~> 0.1.0"
|
32
31
|
|
data/lib/kcv/agent_resolver.rb
CHANGED
@@ -1,7 +1,6 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
3
|
require 'checkpoint/agent'
|
4
|
-
require 'ostruct'
|
5
4
|
|
6
5
|
module KCV
|
7
6
|
# Base AgentResolver to integrate Keycard and Checkpoint.
|
@@ -10,22 +9,20 @@ module KCV
|
|
10
9
|
# which all attributes are extracted and delivered as agents, as converted
|
11
10
|
# by the `agent_factory`.
|
12
11
|
class AgentResolver < Checkpoint::Agent::Resolver
|
13
|
-
|
14
|
-
@agent_factory = agent_factory
|
15
|
-
end
|
16
|
-
|
17
|
-
def resolve(actor)
|
18
|
-
super + actor.identity.map { |k, v| agents_for(k, v) }.flatten
|
19
|
-
end
|
12
|
+
IdentityAttribute = Struct.new(:agent_type, :agent_id)
|
20
13
|
|
21
|
-
def
|
22
|
-
[
|
23
|
-
agent_factory.from(OpenStruct.new(agent_type: attribute, agent_id: value))
|
24
|
-
end
|
14
|
+
def expand(actor)
|
15
|
+
[convert(actor)] + identity_agents(actor)
|
25
16
|
end
|
26
17
|
|
27
18
|
private
|
28
19
|
|
29
|
-
|
20
|
+
def identity_agents(actor)
|
21
|
+
actor.identity.flat_map do |attr, values|
|
22
|
+
[values].flatten.map do |value|
|
23
|
+
convert IdentityAttribute.new(attr, value)
|
24
|
+
end
|
25
|
+
end
|
26
|
+
end
|
30
27
|
end
|
31
28
|
end
|
data/lib/kcv/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: kcv
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.3.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Noah Botimer
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-
|
11
|
+
date: 2018-11-20 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: checkpoint
|
@@ -16,14 +16,14 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - "~>"
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: 1.0
|
19
|
+
version: 1.1.0
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
24
|
- - "~>"
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version: 1.0
|
26
|
+
version: 1.1.0
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: keycard
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|