kubes_google 0.3.1 → 0.3.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +3 -0
- data/lib/kubes_google/config.rb +4 -0
- data/lib/kubes_google/secrets/fetcher.rb +6 -2
- data/lib/kubes_google/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e286468a570668c5d92665f0966165c18f987de7bc09a27c0527d4e732ba3cc0
|
4
|
+
data.tar.gz: 5f36b3d707942e78160a677dcb3dd9b936bba513d43b61d20176486cacf201ba
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0c86e64af5fd59083820f5a34ae59ad3ee323ae038e5f99ecb63900ffe41701c5ae5e1b661117f210153eacc151cc01e44681e63292e9b059802ae1916aa9dcb
|
7
|
+
data.tar.gz: 572b87da4fc774078994cce80eea09a4a3ca74d445f605fb286958c1ecf0eb0ea4210d7ed30b713d160c46f06acecc6e757652d79e7e9d00d4d58afd00291922
|
data/CHANGELOG.md
CHANGED
@@ -3,6 +3,9 @@
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
4
4
|
This project *loosely tries* to adhere to [Semantic Versioning](http://semver.org/), even before v1.0.
|
5
5
|
|
6
|
+
## [0.3.2] - 2020-11-11
|
7
|
+
- [#5](https://github.com/boltops-tools/kubes_google/pull/5) config.base64 option
|
8
|
+
|
6
9
|
## [0.3.1] - 2020-11-11
|
7
10
|
- [#4](https://github.com/boltops-tools/kubes_google/pull/4) get_credentials hook
|
8
11
|
|
data/lib/kubes_google/config.rb
CHANGED
@@ -4,9 +4,13 @@ module KubesGoogle
|
|
4
4
|
|
5
5
|
def defaults
|
6
6
|
c = ActiveSupport::OrderedOptions.new
|
7
|
+
c.base64_secrets = true
|
7
8
|
c.gke = ActiveSupport::OrderedOptions.new
|
8
9
|
c.gke.cluster_name = nil
|
10
|
+
c.gke.enable_get_credentials = nil
|
9
11
|
c.gke.enable_hooks = nil # nil since need cluster_name also. setting to false will explicitly disable hooks
|
12
|
+
c.gke.google_project = nil
|
13
|
+
c.gke.google_region = nil
|
10
14
|
c.gke.whitelist_ip = nil # default will auto-detect IP
|
11
15
|
c
|
12
16
|
end
|
@@ -5,16 +5,20 @@ class KubesGoogle::Secrets
|
|
5
5
|
|
6
6
|
def initialize(options={})
|
7
7
|
@options = options
|
8
|
-
@base64 = options[:base64]
|
8
|
+
@base64 = options[:base64]
|
9
9
|
@project_id = ENV['GOOGLE_PROJECT'] || raise("GOOGLE_PROJECT env variable is not set. It's required.")
|
10
10
|
end
|
11
11
|
|
12
12
|
def fetch(short_name)
|
13
13
|
value = fetch_value(short_name)
|
14
|
-
value = Base64.strict_encode64(value).strip if
|
14
|
+
value = Base64.strict_encode64(value).strip if base64?
|
15
15
|
value
|
16
16
|
end
|
17
17
|
|
18
|
+
def base64?
|
19
|
+
@base64.nil? ? KubesGoogle.config.base64_secrets : @base64
|
20
|
+
end
|
21
|
+
|
18
22
|
def fetch_value(short_name)
|
19
23
|
name = "projects/#{project_number}/secrets/#{short_name}/versions/latest"
|
20
24
|
version = secret_manager_service.access_secret_version(name: name)
|
data/lib/kubes_google/version.rb
CHANGED