soar-idr-configuration_service_manager 0.0.1 → 0.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/soar/idr/configuration_service_manager.rb +25 -0
- metadata +17 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a221c6c88ea5d832bbceeb8075a5e106ccf8220c
|
4
|
+
data.tar.gz: c021834942f9d7046d836fe4d3326e14319c4c49
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6f0f35d05db8a99a63b351444be33c9307946ffe54732e03a62d1729ee7aecd9c5341fe1d6e48a6d45e46bb1522071a93462e81ecf0b2f593725a32031bb5949
|
7
|
+
data.tar.gz: 6f423264b635fffd3281c87e77270e2df37d2f57bcd85532afb841fbfc0d98a8ba5dcad9d60317cf2ba2dd73e40b71b6adb5d12812159ccb6c0679aa8f23ab76
|
@@ -3,6 +3,8 @@ require 'json'
|
|
3
3
|
|
4
4
|
module Soar
|
5
5
|
module Idr
|
6
|
+
##
|
7
|
+
# Identity Registry used by {SoarSc::Authorization::Policy::ConfigurationServiceManager}[https://gitlab.host-h.net/policies/configuration_service_manager].
|
6
8
|
class ConfigurationServiceManager < SoarIdm::IdmApi
|
7
9
|
|
8
10
|
@@attributes = {
|
@@ -17,14 +19,24 @@ module Soar
|
|
17
19
|
|
18
20
|
@@roles = ['configuration_publisher', 'configuration_consumer']
|
19
21
|
|
22
|
+
##
|
23
|
+
# roles
|
24
|
+
# @return [Array] Accessor for roles class variable
|
20
25
|
def self.roles
|
21
26
|
@@roles
|
22
27
|
end
|
23
28
|
|
29
|
+
##
|
30
|
+
# attributes
|
31
|
+
# @return [Hash] Accessor for attributes class variable
|
24
32
|
def self.attributes
|
25
33
|
@@attributes
|
26
34
|
end
|
27
35
|
|
36
|
+
##
|
37
|
+
# calculate_roles
|
38
|
+
# @param identity [String]
|
39
|
+
# @return [Array] List of roles
|
28
40
|
def calculate_roles(identity)
|
29
41
|
if hetzner_email?(identity)
|
30
42
|
return [@@roles[0]] if publisher?(identity)
|
@@ -34,6 +46,11 @@ module Soar
|
|
34
46
|
[]
|
35
47
|
end
|
36
48
|
|
49
|
+
##
|
50
|
+
# calculate_attributes
|
51
|
+
# @param identity [String]
|
52
|
+
# @param role [String]
|
53
|
+
# @return [Hash] A hash of attributes
|
37
54
|
def calculate_attributes(identity, role)
|
38
55
|
return @@attributes[role]
|
39
56
|
#return {
|
@@ -41,6 +58,10 @@ module Soar
|
|
41
58
|
#}
|
42
59
|
end
|
43
60
|
|
61
|
+
##
|
62
|
+
# calculate_all_attributes
|
63
|
+
# @param identity [String]
|
64
|
+
# @return [Hash] Hash of attributes keyed by role
|
44
65
|
def calculate_all_attributes(identity)
|
45
66
|
attributes = {}
|
46
67
|
roles = calculate_roles(identity)
|
@@ -50,6 +71,10 @@ module Soar
|
|
50
71
|
attributes
|
51
72
|
end
|
52
73
|
|
74
|
+
##
|
75
|
+
# calculate_identities
|
76
|
+
# @param identity [String]
|
77
|
+
# @return [Array]
|
53
78
|
def calculate_identities(entity_identifier)
|
54
79
|
[entity_identifier]
|
55
80
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: soar-idr-configuration_service_manager
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Charles Mulder
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-
|
11
|
+
date: 2016-07-04 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: soar_idm
|
@@ -24,6 +24,20 @@ dependencies:
|
|
24
24
|
- - "~>"
|
25
25
|
- !ruby/object:Gem::Version
|
26
26
|
version: 0.0.2
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: rspec
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - "~>"
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '3.4'
|
34
|
+
type: :development
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - "~>"
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: '3.4'
|
27
41
|
description: Identity Registry for Configuration Service Manager
|
28
42
|
email: charles.mulder@hetzner.co.za
|
29
43
|
executables: []
|
@@ -56,3 +70,4 @@ signing_key:
|
|
56
70
|
specification_version: 4
|
57
71
|
summary: Identity Registry for Configuration Service Manager
|
58
72
|
test_files: []
|
73
|
+
has_rdoc:
|