Skip to content

Commit 41c4694

Browse files
authored
feat(generator): scaffold supports auth samples (googleapis#10146)
The scaffold will include markers in `main.dox` to place the authentication samples.
1 parent aff49cf commit 41c4694

92 files changed

Lines changed: 1840 additions & 0 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

generator/internal/scaffold_generator.cc

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -597,6 +597,26 @@ library to change this default.
597597
<!-- inject-endpoint-snippet-start -->
598598
<!-- inject-endpoint-snippet-end -->
599599
600+
## Override the authentication configuration
601+
602+
Some applications cannot use the default authentication mechanism (known as
603+
[Application Default Credentials]). You can override this default using
604+
`google::cloud::UnifiedCredentialsOption`. The following example shows how
605+
to explicitly load a service account key file.
606+
607+
<!-- inject-service-account-snippet-start -->
608+
<!-- inject-service-account-snippet-end -->
609+
610+
Keep in mind that we chose this as an example because it is relatively easy to
611+
understand. Consult the [Best practices for managing service account keys]
612+
guide for more details.
613+
614+
@see @ref guac - for more information on the factory functions to create
615+
`google::cloud::Credentials` objects.
616+
617+
[Best practices for managing service account keys]: https://cloud.google.com/iam/docs/best-practices-for-managing-service-account-keys
618+
[Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
619+
600620
## Retry, Backoff, and Idempotency Policies.
601621
602622
The library automatically retries requests that fail with transient errors, and

google/cloud/accessapproval/doc/main.dox

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,26 @@ For example, this will override the default endpoint for `AccessApprovalClient`:
100100

101101
<!-- inject-endpoint-snippet-end -->
102102

103+
## Override the authentication configuration
104+
105+
Some applications cannot use the default authentication mechanism (known as
106+
[Application Default Credentials]). You can override this default using
107+
`google::cloud::UnifiedCredentialsOption`. The following example shows how
108+
to explicitly load a service account key file.
109+
110+
<!-- inject-service-account-snippet-start -->
111+
<!-- inject-service-account-snippet-end -->
112+
113+
Keep in mind that we chose this as an example because it is relatively easy to
114+
understand. Consult the [Best practices for managing service account keys]
115+
guide for more details.
116+
117+
@see @ref guac - for more information on the factory functions to create
118+
`google::cloud::Credentials` objects.
119+
120+
[Best practices for managing service account keys]: https://cloud.google.com/iam/docs/best-practices-for-managing-service-account-keys
121+
[Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
122+
103123
## Retry, Backoff, and Idempotency Policies.
104124

105125
The library automatically retries requests that fail with transient errors, and

google/cloud/accesscontextmanager/doc/main.dox

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,26 @@ For example, this will override the default endpoint for `AccessContextManagerCl
9999

100100
<!-- inject-endpoint-snippet-end -->
101101

102+
## Override the authentication configuration
103+
104+
Some applications cannot use the default authentication mechanism (known as
105+
[Application Default Credentials]). You can override this default using
106+
`google::cloud::UnifiedCredentialsOption`. The following example shows how
107+
to explicitly load a service account key file.
108+
109+
<!-- inject-service-account-snippet-start -->
110+
<!-- inject-service-account-snippet-end -->
111+
112+
Keep in mind that we chose this as an example because it is relatively easy to
113+
understand. Consult the [Best practices for managing service account keys]
114+
guide for more details.
115+
116+
@see @ref guac - for more information on the factory functions to create
117+
`google::cloud::Credentials` objects.
118+
119+
[Best practices for managing service account keys]: https://cloud.google.com/iam/docs/best-practices-for-managing-service-account-keys
120+
[Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
121+
102122
## Retry, Backoff, and Idempotency Policies.
103123

104124
The library automatically retries requests that fail with transient errors, and

google/cloud/apigateway/doc/main.dox

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,26 @@ For example, this will override the default endpoint for `ApiGatewayServiceClien
9898

9999
<!-- inject-endpoint-snippet-end -->
100100

101+
## Override the authentication configuration
102+
103+
Some applications cannot use the default authentication mechanism (known as
104+
[Application Default Credentials]). You can override this default using
105+
`google::cloud::UnifiedCredentialsOption`. The following example shows how
106+
to explicitly load a service account key file.
107+
108+
<!-- inject-service-account-snippet-start -->
109+
<!-- inject-service-account-snippet-end -->
110+
111+
Keep in mind that we chose this as an example because it is relatively easy to
112+
understand. Consult the [Best practices for managing service account keys]
113+
guide for more details.
114+
115+
@see @ref guac - for more information on the factory functions to create
116+
`google::cloud::Credentials` objects.
117+
118+
[Best practices for managing service account keys]: https://cloud.google.com/iam/docs/best-practices-for-managing-service-account-keys
119+
[Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
120+
101121
## Retry, Backoff, and Idempotency Policies.
102122

103123
The library automatically retries requests that fail with transient errors, and

google/cloud/apigeeconnect/doc/main.dox

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,26 @@ For example, this will override the default endpoint for `ConnectionServiceClien
102102

103103
<!-- inject-endpoint-snippet-end -->
104104

105+
## Override the authentication configuration
106+
107+
Some applications cannot use the default authentication mechanism (known as
108+
[Application Default Credentials]). You can override this default using
109+
`google::cloud::UnifiedCredentialsOption`. The following example shows how
110+
to explicitly load a service account key file.
111+
112+
<!-- inject-service-account-snippet-start -->
113+
<!-- inject-service-account-snippet-end -->
114+
115+
Keep in mind that we chose this as an example because it is relatively easy to
116+
understand. Consult the [Best practices for managing service account keys]
117+
guide for more details.
118+
119+
@see @ref guac - for more information on the factory functions to create
120+
`google::cloud::Credentials` objects.
121+
122+
[Best practices for managing service account keys]: https://cloud.google.com/iam/docs/best-practices-for-managing-service-account-keys
123+
[Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
124+
105125
## Retry, Backoff, and Idempotency Policies.
106126

107127
The library automatically retries requests that fail with transient errors, and

google/cloud/apikeys/doc/main.dox

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,26 @@ For example, this will override the default endpoint for `ApiKeysClient`:
9898

9999
<!-- inject-endpoint-snippet-end -->
100100

101+
## Override the authentication configuration
102+
103+
Some applications cannot use the default authentication mechanism (known as
104+
[Application Default Credentials]). You can override this default using
105+
`google::cloud::UnifiedCredentialsOption`. The following example shows how
106+
to explicitly load a service account key file.
107+
108+
<!-- inject-service-account-snippet-start -->
109+
<!-- inject-service-account-snippet-end -->
110+
111+
Keep in mind that we chose this as an example because it is relatively easy to
112+
understand. Consult the [Best practices for managing service account keys]
113+
guide for more details.
114+
115+
@see @ref guac - for more information on the factory functions to create
116+
`google::cloud::Credentials` objects.
117+
118+
[Best practices for managing service account keys]: https://cloud.google.com/iam/docs/best-practices-for-managing-service-account-keys
119+
[Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
120+
101121
## Retry, Backoff, and Idempotency Policies.
102122

103123
The library automatically retries requests that fail with transient errors, and

google/cloud/appengine/doc/main.dox

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -136,6 +136,26 @@ Follow these links to find examples for other \c *Client classes:
136136

137137
<!-- inject-endpoint-snippet-end -->
138138

139+
## Override the authentication configuration
140+
141+
Some applications cannot use the default authentication mechanism (known as
142+
[Application Default Credentials]). You can override this default using
143+
`google::cloud::UnifiedCredentialsOption`. The following example shows how
144+
to explicitly load a service account key file.
145+
146+
<!-- inject-service-account-snippet-start -->
147+
<!-- inject-service-account-snippet-end -->
148+
149+
Keep in mind that we chose this as an example because it is relatively easy to
150+
understand. Consult the [Best practices for managing service account keys]
151+
guide for more details.
152+
153+
@see @ref guac - for more information on the factory functions to create
154+
`google::cloud::Credentials` objects.
155+
156+
[Best practices for managing service account keys]: https://cloud.google.com/iam/docs/best-practices-for-managing-service-account-keys
157+
[Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
158+
139159
## Retry, Backoff, and Idempotency Policies.
140160

141161
The library automatically retries requests that fail with transient errors, and

google/cloud/artifactregistry/doc/main.dox

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,26 @@ For example, this will override the default endpoint for `ArtifactRegistryClient
9999

100100
<!-- inject-endpoint-snippet-end -->
101101

102+
## Override the authentication configuration
103+
104+
Some applications cannot use the default authentication mechanism (known as
105+
[Application Default Credentials]). You can override this default using
106+
`google::cloud::UnifiedCredentialsOption`. The following example shows how
107+
to explicitly load a service account key file.
108+
109+
<!-- inject-service-account-snippet-start -->
110+
<!-- inject-service-account-snippet-end -->
111+
112+
Keep in mind that we chose this as an example because it is relatively easy to
113+
understand. Consult the [Best practices for managing service account keys]
114+
guide for more details.
115+
116+
@see @ref guac - for more information on the factory functions to create
117+
`google::cloud::Credentials` objects.
118+
119+
[Best practices for managing service account keys]: https://cloud.google.com/iam/docs/best-practices-for-managing-service-account-keys
120+
[Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
121+
102122
## Retry, Backoff, and Idempotency Policies.
103123

104124
The library automatically retries requests that fail with transient errors, and

google/cloud/asset/doc/main.dox

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,26 @@ For example, this will override the default endpoint for `AssetServiceClient`:
9999

100100
<!-- inject-endpoint-snippet-end -->
101101

102+
## Override the authentication configuration
103+
104+
Some applications cannot use the default authentication mechanism (known as
105+
[Application Default Credentials]). You can override this default using
106+
`google::cloud::UnifiedCredentialsOption`. The following example shows how
107+
to explicitly load a service account key file.
108+
109+
<!-- inject-service-account-snippet-start -->
110+
<!-- inject-service-account-snippet-end -->
111+
112+
Keep in mind that we chose this as an example because it is relatively easy to
113+
understand. Consult the [Best practices for managing service account keys]
114+
guide for more details.
115+
116+
@see @ref guac - for more information on the factory functions to create
117+
`google::cloud::Credentials` objects.
118+
119+
[Best practices for managing service account keys]: https://cloud.google.com/iam/docs/best-practices-for-managing-service-account-keys
120+
[Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
121+
102122
## Retry, Backoff, and Idempotency Policies.
103123

104124
The library automatically retries requests that fail with transient errors, and

google/cloud/assuredworkloads/doc/main.dox

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,26 @@ For example, this will override the default endpoint for `AssuredWorkloadsServic
101101

102102
<!-- inject-endpoint-snippet-end -->
103103

104+
## Override the authentication configuration
105+
106+
Some applications cannot use the default authentication mechanism (known as
107+
[Application Default Credentials]). You can override this default using
108+
`google::cloud::UnifiedCredentialsOption`. The following example shows how
109+
to explicitly load a service account key file.
110+
111+
<!-- inject-service-account-snippet-start -->
112+
<!-- inject-service-account-snippet-end -->
113+
114+
Keep in mind that we chose this as an example because it is relatively easy to
115+
understand. Consult the [Best practices for managing service account keys]
116+
guide for more details.
117+
118+
@see @ref guac - for more information on the factory functions to create
119+
`google::cloud::Credentials` objects.
120+
121+
[Best practices for managing service account keys]: https://cloud.google.com/iam/docs/best-practices-for-managing-service-account-keys
122+
[Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
123+
104124
## Retry, Backoff, and Idempotency Policies.
105125

106126
The library automatically retries requests that fail with transient errors, and

0 commit comments

Comments
 (0)