Class: Conjur::Bootstrap::Command::Pubkeys
- Inherits:
-
Base
- Object
- Struct
- Base
- Conjur::Bootstrap::Command::Pubkeys
show all
- Defined in:
- lib/conjur/bootstrap.rb
Instance Attribute Summary
Attributes inherited from Base
#api, #listener
Instance Method Summary
collapse
Methods inherited from Base
#auditors, #echo, #find_or_create_record, #find_or_create_resource, #permit, #security_admin, #store_api_key
Instance Method Details
#key_managers ⇒ Object
109
110
111
|
# File 'lib/conjur/bootstrap.rb', line 109
def key_managers
api.group("pubkeys-1.0/key-managers")
end
|
85
86
87
88
89
90
91
92
93
94
95
|
# File 'lib/conjur/bootstrap.rb', line 85
def perform
find_or_create_record key_managers, security_admin
find_or_create_record pubkeys_layer, security_admin
find_or_create_record pubkeys_host, security_admin do |record, options|
api.create_host(id: record.id, ownerid: security_admin.roleid)
end
pubkeys_layer.add_host pubkeys_host unless pubkeys_layer.hosts.map(&:roleid).member?(pubkeys_host.roleid)
find_or_create_resource pubkeys_service, security_admin
permit pubkeys_service, 'update', key_managers
end
|
#pubkeys_host ⇒ Object
101
102
103
|
# File 'lib/conjur/bootstrap.rb', line 101
def pubkeys_host
api.host("conjur/pubkeys")
end
|
#pubkeys_layer ⇒ Object
97
98
99
|
# File 'lib/conjur/bootstrap.rb', line 97
def pubkeys_layer
api.layer("pubkeys-1.0/public-keys")
end
|
#pubkeys_service ⇒ Object
105
106
107
|
# File 'lib/conjur/bootstrap.rb', line 105
def pubkeys_service
api.resource("service:pubkeys-1.0/public-keys")
end
|