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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: cc2d2778d7eb364332815098ddf87195de980ce4fd85b791cfad86ba9373f296
4
- data.tar.gz: 35c2012f6205fbb8bfd017f2e8777c61accea4e17ed3790fa331bf6a4db64485
3
+ metadata.gz: 0bb0cf6de7e99620e2302ad946da2041b1400ed2432e562bb0400b55cbd356ce
4
+ data.tar.gz: cc766a663d2bdd9d8388a56dfefac506cf6f9d69d21a4f8f1657b7d4cb471ae5
5
5
  SHA512:
6
- metadata.gz: 9c66ea58454e2fbdaa8b8865f57d26b7ace988d2690f25ded932fb10351d1f03189d82349b32a40b64dff9d5add32c5b786812e4660ef9148ceccc671a14a0cf
7
- data.tar.gz: e7fb93dcbcc18a6758154c44a6e40944b4bf06352789403d847b183002b68cfb71705ac330559e38be090ec744d60b3a813094bda31aca0645ce4fefa4574844
6
+ metadata.gz: 920af9395cf8dbf8b7b59104e3f944e536f3233722aa2abca86ea0fb70a3bc5d8fb3d11d07e250ea00b5e41bfe93369a2613ef5b2863183672fedde71190de83
7
+ data.tar.gz: 3bab72f6a0e8c741ec9d473b99d3d23a125df6b7702e951a5bdf9e7811f559f68a022dbd15c5201f678ab94fd696711779f3692c50ec4cec9d24864e383168c5
@@ -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.3"
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
 
@@ -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
- def initialize(agent_factory: Checkpoint::Agent)
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 agents_for(attribute, values)
22
- [values].flatten.map do |value|
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
- attr_reader :agent_factory
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
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module KCV
4
- VERSION = "0.2.4"
4
+ VERSION = "0.3.0"
5
5
  end
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.2.4
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-07-20 00:00:00.000000000 Z
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.3
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.3
26
+ version: 1.1.0
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: keycard
29
29
  requirement: !ruby/object:Gem::Requirement