gapic-generator-cloud 0.1.3 → 0.1.4
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/CHANGELOG.md +4 -0
- data/lib/gapic/generator/cloud/version.rb +1 -1
- data/templates/cloud/gem/authentication.erb +30 -27
- data/templates/cloud/gem/gitignore.erb +2 -0
- 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: a252fcd2176cfa70f9f5a723de32f89a071c3a385867688bde7316a6ce2a55c3
|
|
4
|
+
data.tar.gz: e461c3abd3ca2d5d60ff1c5d9419cecb467e00f33ef23674ade95cff229114de
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 135ddb83ecffcfb83e09f01c544b1088b9b3266c0e2cfa54b73b16d6feb4de31f050865f16c9d595696962366cffe77e2103d2dca1d461cbbc7e5d2b3a96fd8a
|
|
7
|
+
data.tar.gz: bf334cab3f55ee23a632ee96ee1c20a82508b668d4aac4dc5bddf611c497d0fc8371679efb3d9dc860d2fe47dbe8259beec33f485bbeada12e11cbaad93f0d41
|
data/CHANGELOG.md
CHANGED
|
@@ -3,17 +3,18 @@
|
|
|
3
3
|
<%- assert_locals service -%>
|
|
4
4
|
# Authentication
|
|
5
5
|
|
|
6
|
-
In general, the <%= gem.name %> library uses
|
|
7
|
-
Account](https://cloud.google.com/iam/docs/creating-managing-service-accounts)
|
|
8
|
-
credentials to connect to Google Cloud services. When running within
|
|
9
|
-
Cloud Platform environments](#google-cloud-platform-environments)
|
|
10
|
-
|
|
6
|
+
In general, the <%= gem.name %> library uses
|
|
7
|
+
[Service Account](https://cloud.google.com/iam/docs/creating-managing-service-accounts)
|
|
8
|
+
credentials to connect to Google Cloud services. When running within
|
|
9
|
+
[Google Cloud Platform environments](#google-cloud-platform-environments) the
|
|
10
|
+
credentials will be discovered automatically. When running on other
|
|
11
11
|
environments, the Service Account credentials can be specified by providing the
|
|
12
|
-
path to the
|
|
13
|
-
keyfile](https://cloud.google.com/iam/docs/managing-service-account-keys)
|
|
14
|
-
the account (or the JSON itself) in
|
|
15
|
-
variables](#environment-variables). Additionally, Cloud SDK
|
|
16
|
-
be discovered automatically, but this is only recommended
|
|
12
|
+
path to the
|
|
13
|
+
[JSON keyfile](https://cloud.google.com/iam/docs/managing-service-account-keys)
|
|
14
|
+
for the account (or the JSON itself) in
|
|
15
|
+
[environment variables](#environment-variables). Additionally, Cloud SDK
|
|
16
|
+
credentials can also be discovered automatically, but this is only recommended
|
|
17
|
+
during development.
|
|
17
18
|
|
|
18
19
|
## Quickstart
|
|
19
20
|
|
|
@@ -49,23 +50,24 @@ without **Service Account Credentials** directly in code.
|
|
|
49
50
|
|
|
50
51
|
### Google Cloud Platform environments
|
|
51
52
|
|
|
52
|
-
When running on Google Cloud Platform (GCP), including Google Compute Engine
|
|
53
|
-
Google Kubernetes Engine (GKE), Google App Engine (GAE), Google Cloud
|
|
54
|
-
(GCF) and Cloud Run, **Credentials**
|
|
55
|
-
|
|
53
|
+
When running on Google Cloud Platform (GCP), including Google Compute Engine
|
|
54
|
+
(GCE), Google Kubernetes Engine (GKE), Google App Engine (GAE), Google Cloud
|
|
55
|
+
Functions (GCF) and Cloud Run, **Credentials** are discovered automatically.
|
|
56
|
+
Code should be written as if already authenticated.
|
|
56
57
|
|
|
57
58
|
### Environment Variables
|
|
58
59
|
|
|
59
|
-
The **Credentials JSON** can be placed in environment
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
encouraged.
|
|
60
|
+
The **Credentials JSON** can be placed in environment variables instead of
|
|
61
|
+
declaring them directly in code. Each service has its own environment variable,
|
|
62
|
+
allowing for different service accounts to be used for different services. (See
|
|
63
|
+
the READMEs for the individual service gems for details.) The path to the
|
|
64
|
+
**Credentials JSON** file can be stored in the environment variable, or the
|
|
65
|
+
**Credentials JSON** itself can be stored for environments such as Docker
|
|
66
|
+
containers where writing files is difficult or not encouraged.
|
|
67
67
|
|
|
68
|
-
The environment variables that <%= gem.name %>
|
|
68
|
+
The environment variables that <%= gem.name %>
|
|
69
|
+
checks for credentials are configured on the service Credentials class (such as
|
|
70
|
+
{<%= service.credentials_name_full %>}):
|
|
69
71
|
|
|
70
72
|
1. `<%= gem.env_prefix %>_CREDENTIALS` - Path to JSON file, or JSON contents
|
|
71
73
|
2. `<%= gem.env_prefix %>_KEYFILE` - Path to JSON file, or JSON contents
|
|
@@ -83,7 +85,8 @@ client = <%= service.client_name_full %>.new
|
|
|
83
85
|
|
|
84
86
|
### Configuration
|
|
85
87
|
|
|
86
|
-
The **Credentials JSON** can be configured instead of placing them in
|
|
88
|
+
The **Credentials JSON** can be configured instead of placing them in
|
|
89
|
+
environment variables. Either on an individual client initialization:
|
|
87
90
|
|
|
88
91
|
```ruby
|
|
89
92
|
require "<%= service.package.package_require %>"
|
|
@@ -140,15 +143,15 @@ environments](#google-cloud-platform-environments), you need a Google
|
|
|
140
143
|
Developers service account.
|
|
141
144
|
|
|
142
145
|
1. Visit the [Google Developers Console][dev-console].
|
|
143
|
-
|
|
144
|
-
|
|
146
|
+
2. Create a new project or click on an existing project.
|
|
147
|
+
3. Activate the slide-out navigation tray and select **API Manager**. From
|
|
145
148
|
here, you will enable the APIs that your application requires.
|
|
146
149
|
|
|
147
150
|
![Enable the APIs that your application requires][enable-apis]
|
|
148
151
|
|
|
149
152
|
*Note: You may need to enable billing in order to use these services.*
|
|
150
153
|
|
|
151
|
-
|
|
154
|
+
4. Select **Credentials** from the side navigation.
|
|
152
155
|
|
|
153
156
|
You should see a screen like one of the following.
|
|
154
157
|
|
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: gapic-generator-cloud
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.1.
|
|
4
|
+
version: 0.1.4
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Ernest Landrito
|
|
@@ -10,7 +10,7 @@ authors:
|
|
|
10
10
|
autorequire:
|
|
11
11
|
bindir: bin
|
|
12
12
|
cert_chain: []
|
|
13
|
-
date: 2020-03-
|
|
13
|
+
date: 2020-03-12 00:00:00.000000000 Z
|
|
14
14
|
dependencies:
|
|
15
15
|
- !ruby/object:Gem::Dependency
|
|
16
16
|
name: actionpack
|