soar-registry-identity 0.0.1 → 1.0.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
  SHA1:
3
- metadata.gz: 484df2d3ddb8d8e2b5438fbad4b64f5082cbdf2b
4
- data.tar.gz: 0115319b3e7636d6e5bd6cdf7eace3975dbadfdb
3
+ metadata.gz: 9437adb33b4379cc43f32fd3114f5747f232f6c8
4
+ data.tar.gz: 8da8b86504e04fe071dc025023ce0dd09df82a16
5
5
  SHA512:
6
- metadata.gz: 015afb53bd02703e74b64e9ae518f60267eefa7c3965b0ad6a37505767c1240d2ab18bb92726af2775fbad2053299944e6dcfc145d284604fc351bcae8ac883b
7
- data.tar.gz: 5ba3a6752b13b05e30888b6c3ef9967863e0c3db21f222a219924c9e433c64c6a6478e17bb4f6f503f3972eb2cdb4d899c84d1a4279a247dbb8f167061eee6af
6
+ metadata.gz: 3a8048aaeb8838dbe4addf80b864b2792790a7ad13ea432c8aa244feee4f807b409498cb859d8c3e206181643c2049b3d6402681f6ac7e81e1a0cdddcae19821
7
+ data.tar.gz: a35ba39309eee4ed3ded67690cca8090f52b09e906b17ab4bfb039eef8a98998948c42d442d87e94aad131a9690c26a5dd36ce6974a6c903f2586734b215b4b3
data/README.md CHANGED
@@ -2,44 +2,63 @@
2
2
 
3
3
  ## Quickstart
4
4
 
5
+ ### Example data
6
+ ```javascript
7
+ "identities" = [{
8
+ "uuid": "identity-62936e70-1815-439b-bf89-8492855a7e6b",
9
+ "entity_id": "entity-2d931510-d99f-494a-8c67-87feb05e1594",
10
+ "email": "test+publisher@hetzner.co.za",
11
+ "roles": {
12
+ "staff": {
13
+ "department": "technical"
14
+ },
15
+ "configuration_publisher": {
16
+ "configuration_identifiers": ["*"]
17
+ }
18
+ }
19
+ }]
20
+ ```
21
+
5
22
  ### Directory
6
23
  Create a directory provider
7
24
 
8
25
  ```ruby
9
26
  require 'soar/registry/directory'
10
- directory_provider = Soar::Registry::Directory::Provider::Stub.new
27
+ directory_provider = Soar::Registry::Directory::Provider::Stub.new(
28
+ table: "identities",
29
+ primary_key: "uuid",
30
+ index: ["uuid", "entity_id", "email"]
31
+ )
11
32
  ```
12
33
 
13
34
  Create a directory
14
35
  ```ruby
15
- directory = Soar::Registry::Directory.new({
16
- provider: directory_provider
17
- })
36
+ directory = Soar::Registry::Directory.new(directory_provider)
18
37
  ```
19
38
 
20
39
  ### Staff UUID IDR
21
40
  Search for staff by UUID.
22
41
 
23
- Create an identity provider. (Remember to pass in the directory)
42
+ Create an identity provider.
24
43
  ```ruby
25
44
  require 'soar/registry/identity'
26
- identity_provider = Soar::Registry::Identity::Provider::Staff::Id.new(directory)
45
+ identity_provider = Soar::Registry::Identity::Provider::Staff::Id.new(directory: directory)
27
46
  ```
28
47
 
29
48
  Create an IDR
30
49
  ```ruby
31
- @id_idr = Soar::Registry::Identity.new(provider: identity_provider)
50
+ @id_idr = Soar::Registry::Identity.new(identity_provider)
32
51
  ```
33
52
 
34
53
  ### Staff Email IDR
35
- Search for staff by email address. (Remember to pass in the directory)
54
+ Search for staff by email address.
36
55
  ```ruby
37
56
  require 'soar/registry/identity'
38
- identity_provider = Soar::Registry::Identity::Provider::Staff::Email.new(directory)
57
+ identity_provider = Soar::Registry::Identity::Provider::Staff::Email.new(directory: directory)
39
58
  ```
40
59
 
41
60
  ```ruby
42
- @email_idr = Soar::Registry::Identity.new(provider: identity_provider)
61
+ @email_idr = Soar::Registry::Identity.new(identity_provider)
43
62
  ```
44
63
 
45
64
  ### Getting a list of identifiers
@@ -3,8 +3,8 @@ require 'soar/registry/identity/model'
3
3
  module Soar
4
4
  module Registry
5
5
  module Identity
6
- def self.new(provider: nil)
7
- Soar::Registry::Identity::Model.new(provider: provider)
6
+ def self.new(provider)
7
+ Soar::Registry::Identity::Model.new(provider)
8
8
  end
9
9
  end
10
10
  end
@@ -5,7 +5,7 @@ module Soar
5
5
  module Registry
6
6
  module Identity
7
7
  class Model
8
- def initialize(provider: nil)
8
+ def initialize(provider)
9
9
  @provider = provider
10
10
  end
11
11
 
@@ -14,7 +14,7 @@ module Soar
14
14
  ##
15
15
  # @param [Hash] configuration
16
16
  ##
17
- def initialize(directory)
17
+ def initialize(directory: nil)
18
18
  @translator = Soar::Registry::Identity::Provider::Staff::Translator::Default.new
19
19
  @directory = directory
20
20
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: soar-registry-identity
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 1.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Charles Mulder
@@ -30,14 +30,14 @@ dependencies:
30
30
  requirements:
31
31
  - - "~>"
32
32
  - !ruby/object:Gem::Version
33
- version: 0.0.1
33
+ version: 1.0.0
34
34
  type: :runtime
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
38
  - - "~>"
39
39
  - !ruby/object:Gem::Version
40
- version: 0.0.1
40
+ version: 1.0.0
41
41
  description: Registry of identities
42
42
  email: charles.mulder@hetzner.co.za
43
43
  executables: []