constancy 0.2.0 → 0.2.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +4 -4
- data/lib/constancy/config.rb +5 -5
- data/lib/constancy/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d3e4e575fc5f80a0782fe1b893049209d976179f6d372f32511211d29f04c0fa
|
4
|
+
data.tar.gz: d516a0d7c2311358205415a811eea26212fba7e7ebc1f6c0e3f2f0ff9df8b193
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ba9ee9f9c89fcfe995ce3383d273fa08788284e1d064b4a00f994fdf6f8bfdbdefcbb1589f0af7be278e243d9c1e1457a8b03089b139040b9e3a1725da5cf28a
|
7
|
+
data.tar.gz: 32ba1fd6a825ba89989ca6128ad1a4fbbaa18f7a5603524de59f2c424bc1aac4d09ed6684a06af306bef8bb493727e4b6d7880de29e66d0f611b511124cde64d
|
data/README.md
CHANGED
@@ -123,17 +123,17 @@ required. An example `constancy.yml` is below including explanatory comments:
|
|
123
123
|
# The REST API endpoint of your Vault server
|
124
124
|
url: https://your.vault.example
|
125
125
|
|
126
|
-
#
|
126
|
+
# consul_token_path - the path to the endpoint from which to read the Consul token
|
127
127
|
# The Vault URI path to the Consul token - can be either the Consul
|
128
128
|
# dynamic backend or a KV endpoint with a static value. If the dynamic
|
129
129
|
# backend is used, the lease will be automatically revoked when
|
130
130
|
# constancy exits.
|
131
|
-
|
131
|
+
consul_token_path: consul/creds/my-role
|
132
132
|
|
133
|
-
#
|
133
|
+
# consul_token_field - name of the field in which the Consul token is stored
|
134
134
|
# Defaults to 'token' which is the field used by the dynamic backend
|
135
135
|
# but can be set to something else for static values.
|
136
|
-
|
136
|
+
consul_token_field: token
|
137
137
|
|
138
138
|
sync:
|
139
139
|
# sync is an array of hashes of sync target configurations
|
data/lib/constancy/config.rb
CHANGED
@@ -10,11 +10,11 @@ class Constancy
|
|
10
10
|
CONFIG_FILENAMES = %w( constancy.yml )
|
11
11
|
VALID_CONFIG_KEYS = %w( sync consul vault constancy )
|
12
12
|
VALID_CONSUL_CONFIG_KEYS = %w( url datacenter token_source )
|
13
|
-
VALID_VAULT_CONFIG_KEYS = %w( url
|
13
|
+
VALID_VAULT_CONFIG_KEYS = %w( url consul_token_path consul_token_field )
|
14
14
|
VALID_CONSTANCY_CONFIG_KEYS = %w( verbose chomp delete color )
|
15
15
|
DEFAULT_CONSUL_URL = "http://localhost:8500"
|
16
16
|
DEFAULT_CONSUL_TOKEN_SOURCE = "none"
|
17
|
-
|
17
|
+
DEFAULT_VAULT_CONSUL_TOKEN_FIELD = "token"
|
18
18
|
|
19
19
|
attr_accessor :config_file, :base_dir, :consul, :sync_targets, :target_whitelist
|
20
20
|
|
@@ -127,9 +127,9 @@ class Constancy
|
|
127
127
|
raise Constancy::ConfigFileInvalid.new("Only the following keys are valid in the vault config: #{Constancy::Config::VALID_VAULT_CONFIG_KEYS.join(", ")}")
|
128
128
|
end
|
129
129
|
|
130
|
-
vault_path = raw['vault']['
|
130
|
+
vault_path = raw['vault']['consul_token_path']
|
131
131
|
if vault_path.nil? or vault_path == ""
|
132
|
-
raise Constancy::ConfigFileInvalid.new("vault.
|
132
|
+
raise Constancy::ConfigFileInvalid.new("vault.consul_token_path must be specified to use vault as a token source")
|
133
133
|
end
|
134
134
|
|
135
135
|
# prioritize the config file over environment variables for vault address
|
@@ -148,7 +148,7 @@ class Constancy
|
|
148
148
|
end
|
149
149
|
end
|
150
150
|
|
151
|
-
vault_field = raw['vault']['
|
151
|
+
vault_field = raw['vault']['consul_token_field'] || Constancy::Config::DEFAULT_VAULT_CONSUL_TOKEN_FIELD
|
152
152
|
|
153
153
|
ENV['VAULT_ADDR'] = vault_addr
|
154
154
|
ENV['VAULT_TOKEN'] = vault_token
|
data/lib/constancy/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: constancy
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- David Adams
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-12-
|
11
|
+
date: 2018-12-25 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: imperium
|