google-cloud-secret_manager 0.2.1 → 0.3.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/AUTHENTICATION.md +12 -15
- data/README.md +2 -2
- data/lib/google-cloud-secret_manager.rb +3 -4
- data/lib/google/cloud/secret_manager.rb +3 -3
- data/lib/google/cloud/secret_manager/version.rb +1 -1
- metadata +18 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 89c334a550c2f79f95d092e6251c806173e344c9da179c32028e24a41e8c3886
|
4
|
+
data.tar.gz: 0665ef978668208dd5d5d392ff534630083243456542cc4ca3db5626521072dc
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 24f6510566d3d0eafca0c814f680bbe41d5c1d42d97e8bc241f9bf6fa96934d18a15ea5d3cab39e4560a84f02f2f02e5d4f7ae239e237f14b82f95242977eeaa
|
7
|
+
data.tar.gz: 31bf99f6778a6468f752f4841190918cbe1078109d9bccde43c1d4403754bbdf4755a1d8ac0d536511fa38b9f9caf26e776e3d5e0dd8c384696fb9b669ae7383
|
data/AUTHENTICATION.md
CHANGED
@@ -26,7 +26,7 @@ export SECRET_MANAGER_CREDENTIALS=path/to/keyfile.json
|
|
26
26
|
```ruby
|
27
27
|
require "google/cloud/secret_manager"
|
28
28
|
|
29
|
-
client = Google::Cloud::SecretManager.
|
29
|
+
client = Google::Cloud::SecretManager.secret_manager_service
|
30
30
|
```
|
31
31
|
|
32
32
|
## Credential Lookup
|
@@ -49,7 +49,7 @@ code.
|
|
49
49
|
|
50
50
|
When running on Google Cloud Platform (GCP), including Google Compute Engine (GCE),
|
51
51
|
Google Kubernetes Engine (GKE), Google App Engine (GAE), Google Cloud Functions
|
52
|
-
(GCF) and Cloud Run, the **
|
52
|
+
(GCF) and Cloud Run, the **Credentials** are discovered
|
53
53
|
automatically. Code should be written as if already authenticated.
|
54
54
|
|
55
55
|
### Environment Variables
|
@@ -63,7 +63,8 @@ environment variable, or the **Credentials JSON** itself can be stored for
|
|
63
63
|
environments such as Docker containers where writing files is difficult or not
|
64
64
|
encouraged.
|
65
65
|
|
66
|
-
The environment variables that google-cloud-secret_manager checks for
|
66
|
+
The environment variables that google-cloud-secret_manager checks for
|
67
|
+
credentials are configured on `Google::Cloud::SecretManager::V1::SecretManagerService::Credentials`:
|
67
68
|
|
68
69
|
1. `SECRET_MANAGER_CREDENTIALS` - Path to JSON file, or JSON contents
|
69
70
|
2. `SECRET_MANAGER_KEYFILE` - Path to JSON file, or JSON contents
|
@@ -76,17 +77,18 @@ require "google/cloud/secret_manager"
|
|
76
77
|
|
77
78
|
ENV["SECRET_MANAGER_CREDENTIALS"] = "path/to/keyfile.json"
|
78
79
|
|
79
|
-
client = Google::Cloud::SecretManager.
|
80
|
+
client = Google::Cloud::SecretManager.secret_manager_service
|
80
81
|
```
|
81
82
|
|
82
83
|
### Configuration
|
83
84
|
|
84
|
-
The **Credentials JSON** can be configured instead of placing them in
|
85
|
+
The **Credentials JSON** can be configured instead of placing them in
|
86
|
+
environment variables. Either on an individual client initialization:
|
85
87
|
|
86
88
|
```ruby
|
87
89
|
require "google/cloud/secret_manager"
|
88
90
|
|
89
|
-
client = Google::Cloud::SecretManager.
|
91
|
+
client = Google::Cloud::SecretManager.secret_manager_service do |config|
|
90
92
|
config.credentials = "path/to/keyfile.json"
|
91
93
|
end
|
92
94
|
```
|
@@ -100,7 +102,7 @@ Google::Cloud::SecretManager.configure do |config|
|
|
100
102
|
config.credentials = "path/to/keyfile.json"
|
101
103
|
end
|
102
104
|
|
103
|
-
client = Google::Cloud::SecretManager.
|
105
|
+
client = Google::Cloud::SecretManager.secret_manager_service
|
104
106
|
```
|
105
107
|
|
106
108
|
### Cloud SDK
|
@@ -138,15 +140,15 @@ environments](#google-cloud-platform-environments), you need a Google
|
|
138
140
|
Developers service account.
|
139
141
|
|
140
142
|
1. Visit the [Google Developers Console][dev-console].
|
141
|
-
|
142
|
-
|
143
|
+
2. Create a new project or click on an existing project.
|
144
|
+
3. Activate the slide-out navigation tray and select **API Manager**. From
|
143
145
|
here, you will enable the APIs that your application requires.
|
144
146
|
|
145
147
|
![Enable the APIs that your application requires][enable-apis]
|
146
148
|
|
147
149
|
*Note: You may need to enable billing in order to use these services.*
|
148
150
|
|
149
|
-
|
151
|
+
4. Select **Credentials** from the side navigation.
|
150
152
|
|
151
153
|
You should see a screen like one of the following.
|
152
154
|
|
@@ -165,8 +167,3 @@ Developers service account.
|
|
165
167
|
|
166
168
|
The key file you download will be used by this library to authenticate API
|
167
169
|
requests and should be stored in a secure location.
|
168
|
-
|
169
|
-
## Troubleshooting
|
170
|
-
|
171
|
-
If you're having trouble authenticating you can ask for help by following the
|
172
|
-
{file:TROUBLESHOOTING.md Troubleshooting Guide}.
|
data/README.md
CHANGED
@@ -21,14 +21,14 @@ $ gem install google-cloud-secret_manager
|
|
21
21
|
|
22
22
|
### Next Steps
|
23
23
|
- Read the [Client Library Documentation][] for the Secret Manager API, and the underlying
|
24
|
-
[
|
24
|
+
[V1 Client Documentation][] to see other available methods on the client.
|
25
25
|
- Read the [Secret Manager API Product documentation][Product Documentation]
|
26
26
|
to learn more about the product and see How-to Guides.
|
27
27
|
- View this [repository's main README](https://github.com/googleapis/google-cloud-ruby/blob/master/README.md)
|
28
28
|
to see the full list of Cloud APIs that we cover.
|
29
29
|
|
30
30
|
[Client Library Documentation]: https://googleapis.dev/ruby/google-cloud-secret_manager/latest
|
31
|
-
[
|
31
|
+
[V1 Client Documentation]: https://googleapis.dev/ruby/google-cloud-secret_manager-v1/latest
|
32
32
|
[Product Documentation]: https://cloud.google.com/secret-manager
|
33
33
|
|
34
34
|
## Enabling Logging
|
@@ -14,9 +14,8 @@
|
|
14
14
|
|
15
15
|
|
16
16
|
##
|
17
|
-
# This file is here to be autorequired by bundler,
|
18
|
-
#
|
19
|
-
# won't be loaded until required and used.
|
17
|
+
# This file is here to be autorequired by bundler, but the library and all
|
18
|
+
# dependencies won't be loaded until required and used.
|
20
19
|
|
21
20
|
|
22
21
|
gem "google-cloud-core"
|
@@ -24,7 +23,7 @@ require "google/cloud" unless defined? Google::Cloud.new
|
|
24
23
|
require "google/cloud/config"
|
25
24
|
require "googleauth"
|
26
25
|
|
27
|
-
# Set the default
|
26
|
+
# Set the default configuration
|
28
27
|
Google::Cloud.configure.add_config! :secret_manager do |config|
|
29
28
|
config.add_field! :credentials, nil, match: [String, Hash, Google::Auth::Credentials]
|
30
29
|
config.add_field! :lib_name, nil, match: String
|
@@ -25,12 +25,12 @@ module Google
|
|
25
25
|
# Create a new `SecretManagerService::Client` object.
|
26
26
|
#
|
27
27
|
# @param version [String, Symbol] The API version to create the client instance. Optional. If not provided
|
28
|
-
# defaults to `:
|
29
|
-
# [Google::Cloud::SecretManager::
|
28
|
+
# defaults to `:v1`, which will return an instance of
|
29
|
+
# [Google::Cloud::SecretManager::V1::SecretManagerService::Client](https://googleapis.dev/ruby/google-cloud-secret_manager-v1/latest/Google/Cloud/SecretManager/V1/SecretManagerService/Client.html).
|
30
30
|
#
|
31
31
|
# @return [SecretManagerService::Client] A client object for the specified version.
|
32
32
|
#
|
33
|
-
def self.secret_manager_service version: :
|
33
|
+
def self.secret_manager_service version: :v1, &block
|
34
34
|
require "google/cloud/secret_manager/#{version.to_s.downcase}"
|
35
35
|
|
36
36
|
package_name = Google::Cloud::SecretManager
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: google-cloud-secret_manager
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.3.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Google LLC
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-
|
11
|
+
date: 2020-03-18 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: google-cloud-core
|
@@ -24,20 +24,34 @@ dependencies:
|
|
24
24
|
- - "~>"
|
25
25
|
- !ruby/object:Gem::Version
|
26
26
|
version: '1.5'
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: google-cloud-secret_manager-v1
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - "~>"
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '0.1'
|
34
|
+
type: :runtime
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - "~>"
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: '0.1'
|
27
41
|
- !ruby/object:Gem::Dependency
|
28
42
|
name: google-cloud-secret_manager-v1beta1
|
29
43
|
requirement: !ruby/object:Gem::Requirement
|
30
44
|
requirements:
|
31
45
|
- - "~>"
|
32
46
|
- !ruby/object:Gem::Version
|
33
|
-
version: '0.
|
47
|
+
version: '0.3'
|
34
48
|
type: :runtime
|
35
49
|
prerelease: false
|
36
50
|
version_requirements: !ruby/object:Gem::Requirement
|
37
51
|
requirements:
|
38
52
|
- - "~>"
|
39
53
|
- !ruby/object:Gem::Version
|
40
|
-
version: '0.
|
54
|
+
version: '0.3'
|
41
55
|
- !ruby/object:Gem::Dependency
|
42
56
|
name: autotest-suffix
|
43
57
|
requirement: !ruby/object:Gem::Requirement
|