Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit3d32990

Browse files
authored
chore(docs): add Authorization section to Java README template (#1161)
as a part of the PR 582 for java-logging an authorization section is added to the Java README template.Fixinggoogleapis/java-logging#570.
1 parentdd05f9d commit3d32990

File tree

1 file changed

+16
-0
lines changed
  • synthtool/gcp/templates/java_library

1 file changed

+16
-0
lines changed

‎synthtool/gcp/templates/java_library/README.md‎

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
{% set group_id = metadata['repo']['distribution_name'].split(':')|first -%}
22
{% set artifact_id = metadata['repo']['distribution_name'].split(':')|last -%}
33
{% set repo_short = metadata['repo']['repo'].split('/')|last -%}
4+
45
#Google {{ metadata['repo']['name_pretty'] }} Client for Java
56

67
Java idiomatic client for[{{metadata['repo']['name_pretty']}}][product-docs].
@@ -16,10 +17,12 @@ Java idiomatic client for [{{metadata['repo']['name_pretty']}}][product-docs].
1617
>Note: This client is a work-in-progress, and may occasionally
1718
>make backwards-incompatible changes.
1819
{% endif %}
20+
1921
##Quickstart
2022

2123
{% if 'snippets' in metadata and metadata['snippets'][metadata['repo']['name'] + '_install_with_bom'] -%}
2224
If you are using Maven with[BOM][libraries-bom], add this to your pom.xml file
25+
2326
```xml
2427
{{ metadata['snippets'][metadata['repo']['name'] + '_install_with_bom'] }}
2528
```
@@ -28,6 +31,7 @@ If you are using Maven without BOM, add this to your dependencies:
2831
{% else %}
2932
If you are using Maven, add this to your pom.xml file:
3033
{% endif %}
34+
3135
```xml
3236
{% if 'snippets' in metadata and metadata['snippets'][metadata['repo']['name'] + '_install_without_bom'] -%}
3337
{{ metadata['snippets'][metadata['repo']['name'] + '_install_without_bom'] }}
@@ -42,6 +46,7 @@ If you are using Maven, add this to your pom.xml file:
4246

4347
{% if 'snippets' in metadata and metadata['snippets'][metadata['repo']['name'] + '_install_with_bom'] -%}
4448
If you are using Gradle 5.x or later, add this to your dependencies
49+
4550
```Groovy
4651
implementation platform('com.google.cloud:libraries-bom:{{metadata['latest_bom_version']}}')
4752
@@ -50,11 +55,13 @@ compile '{{ group_id }}:{{ artifact_id }}'
5055
{% endif -%}
5156

5257
If you are using Gradle without BOM, add this to your dependencies
58+
5359
```Groovy
5460
compile '{{ group_id }}:{{ artifact_id }}:{{ metadata['latest_version'] }}'
5561
```
5662

5763
If you are using SBT, add this to your dependencies
64+
5865
```Scala
5966
libraryDependencies+="{{ group_id }}"%"{{ artifact_id }}"%"{{ metadata['latest_version'] }}"
6067
```
@@ -63,6 +70,10 @@ libraryDependencies += "{{ group_id }}" % "{{ artifact_id }}" % "{{ metadata['la
6370

6471
See the[Authentication][authentication] section in the base directory's README.
6572

73+
##Authorization
74+
75+
The client application making API calls must be granted[authorization scopes][auth-scopes] required for the desired {{metadata['repo']['name_pretty']}} APIs, and the authenticated principal must have the[IAM role(s)][predefined-iam-roles] required to access GCP resources using the {{metadata['repo']['name_pretty']}} API calls.
76+
6677
##Getting Started
6778

6879
###Prerequisites
@@ -175,6 +186,7 @@ This library follows [Semantic Versioning](http://semver.org/).
175186
It is currently in major version zero (``0.y.z``), which means that anything may change at any time
176187
and the public API should not be considered stable.
177188
{% endif %}{% endif %}
189+
178190
##Contributing
179191

180192
{% if 'partials' in metadata and metadata['partials']['contributing'] -%}
@@ -188,6 +200,7 @@ Please note that this project is released with a Contributor Code of Conduct. By
188200
this project you agree to abide by its terms. See[Code of Conduct][code-of-conduct] for more
189201
information.
190202
{% endif %}
203+
191204
##License
192205

193206
Apache 2.0 - See[LICENSE][license] for more information.
@@ -220,6 +233,9 @@ Java is a registered trademark of Oracle and/or its affiliates.
220233
[maven-version-image]:https://img.shields.io/maven-central/v/{{ group_id }}/{{ artifact_id }}.svg
221234
[maven-version-link]:https://search.maven.org/search?q=g:{{ group_id }}%20AND%20a:{{ artifact_id }}&core=gav
222235
[authentication]:https://github.com/googleapis/google-cloud-java#authentication
236+
[auth-scopes]:https://developers.google.com/identity/protocols/oauth2/scopes
237+
[predefined-iam-roles]:https://cloud.google.com/iam/docs/understanding-roles#predefined_roles
238+
[iam-policy]:https://cloud.google.com/iam/docs/overview#cloud-iam-policy
223239
[developer-console]:https://console.developers.google.com/
224240
[create-project]:https://cloud.google.com/resource-manager/docs/creating-managing-projects
225241
[cloud-sdk]:https://cloud.google.com/sdk/

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp