Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: [secretmanager] update public API to include annotation support #8921

Merged
merged 2 commits into from
Dec 20, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions java-secretmanager/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,20 +19,20 @@ If you are using Maven, add this to your pom.xml file:
<dependency>
<groupId>com.google.cloud</groupId>
<artifactId>google-cloud-secretmanager</artifactId>
<version>2.6.0</version>
<version>2.7.0</version>
</dependency>
```

If you are using Gradle without BOM, add this to your dependencies:

```Groovy
implementation 'com.google.cloud:google-cloud-secretmanager:2.6.0'
implementation 'com.google.cloud:google-cloud-secretmanager:2.7.0'
```

If you are using SBT, add this to your dependencies:

```Scala
libraryDependencies += "com.google.cloud" % "google-cloud-secretmanager" % "2.6.0"
libraryDependencies += "com.google.cloud" % "google-cloud-secretmanager" % "2.7.0"
```

## Authentication
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -202,6 +202,7 @@ public void createSecretTest() throws Exception {
.setEtag("etag3123477")
.setRotation(Rotation.newBuilder().build())
.putAllVersionAliases(new HashMap<String, Long>())
.putAllAnnotations(new HashMap<String, String>())
.build();
mockService.addResponse(expectedResponse);

Expand Down Expand Up @@ -257,6 +258,7 @@ public void createSecretTest2() throws Exception {
.setEtag("etag3123477")
.setRotation(Rotation.newBuilder().build())
.putAllVersionAliases(new HashMap<String, Long>())
.putAllAnnotations(new HashMap<String, String>())
.build();
mockService.addResponse(expectedResponse);

Expand Down Expand Up @@ -414,6 +416,7 @@ public void getSecretTest() throws Exception {
.setEtag("etag3123477")
.setRotation(Rotation.newBuilder().build())
.putAllVersionAliases(new HashMap<String, Long>())
.putAllAnnotations(new HashMap<String, String>())
.build();
mockService.addResponse(expectedResponse);

Expand Down Expand Up @@ -465,6 +468,7 @@ public void getSecretTest2() throws Exception {
.setEtag("etag3123477")
.setRotation(Rotation.newBuilder().build())
.putAllVersionAliases(new HashMap<String, Long>())
.putAllAnnotations(new HashMap<String, String>())
.build();
mockService.addResponse(expectedResponse);

Expand Down Expand Up @@ -516,6 +520,7 @@ public void updateSecretTest() throws Exception {
.setEtag("etag3123477")
.setRotation(Rotation.newBuilder().build())
.putAllVersionAliases(new HashMap<String, Long>())
.putAllAnnotations(new HashMap<String, String>())
.build();
mockService.addResponse(expectedResponse);

Expand All @@ -529,6 +534,7 @@ public void updateSecretTest() throws Exception {
.setEtag("etag3123477")
.setRotation(Rotation.newBuilder().build())
.putAllVersionAliases(new HashMap<String, Long>())
.putAllAnnotations(new HashMap<String, String>())
.build();
FieldMask updateMask = FieldMask.newBuilder().build();

Expand Down Expand Up @@ -568,6 +574,7 @@ public void updateSecretExceptionTest() throws Exception {
.setEtag("etag3123477")
.setRotation(Rotation.newBuilder().build())
.putAllVersionAliases(new HashMap<String, Long>())
.putAllAnnotations(new HashMap<String, String>())
.build();
FieldMask updateMask = FieldMask.newBuilder().build();
client.updateSecret(secret, updateMask);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -193,6 +193,7 @@ public void createSecretTest() throws Exception {
.setEtag("etag3123477")
.setRotation(Rotation.newBuilder().build())
.putAllVersionAliases(new HashMap<String, Long>())
.putAllAnnotations(new HashMap<String, String>())
.build();
mockSecretManagerService.addResponse(expectedResponse);

Expand Down Expand Up @@ -244,6 +245,7 @@ public void createSecretTest2() throws Exception {
.setEtag("etag3123477")
.setRotation(Rotation.newBuilder().build())
.putAllVersionAliases(new HashMap<String, Long>())
.putAllAnnotations(new HashMap<String, String>())
.build();
mockSecretManagerService.addResponse(expectedResponse);

Expand Down Expand Up @@ -387,6 +389,7 @@ public void getSecretTest() throws Exception {
.setEtag("etag3123477")
.setRotation(Rotation.newBuilder().build())
.putAllVersionAliases(new HashMap<String, Long>())
.putAllAnnotations(new HashMap<String, String>())
.build();
mockSecretManagerService.addResponse(expectedResponse);

Expand Down Expand Up @@ -432,6 +435,7 @@ public void getSecretTest2() throws Exception {
.setEtag("etag3123477")
.setRotation(Rotation.newBuilder().build())
.putAllVersionAliases(new HashMap<String, Long>())
.putAllAnnotations(new HashMap<String, String>())
.build();
mockSecretManagerService.addResponse(expectedResponse);

Expand Down Expand Up @@ -477,6 +481,7 @@ public void updateSecretTest() throws Exception {
.setEtag("etag3123477")
.setRotation(Rotation.newBuilder().build())
.putAllVersionAliases(new HashMap<String, Long>())
.putAllAnnotations(new HashMap<String, String>())
.build();
mockSecretManagerService.addResponse(expectedResponse);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,13 +74,15 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() {
*
*
* <pre>
* Required. The resource name of the Cloud KMS CryptoKey used to encrypt secret
* payloads.
* For secrets using the [UserManaged][google.cloud.secretmanager.v1.Replication.UserManaged] replication
* policy type, Cloud KMS CryptoKeys must reside in the same location as the
* [replica location][Secret.UserManaged.Replica.location].
* For secrets using the [Automatic][google.cloud.secretmanager.v1.Replication.Automatic] replication policy
* type, Cloud KMS CryptoKeys must reside in `global`.
* Required. The resource name of the Cloud KMS CryptoKey used to encrypt
* secret payloads.
* For secrets using the
* [UserManaged][google.cloud.secretmanager.v1.Replication.UserManaged]
* replication policy type, Cloud KMS CryptoKeys must reside in the same
* location as the [replica location][Secret.UserManaged.Replica.location].
* For secrets using the
* [Automatic][google.cloud.secretmanager.v1.Replication.Automatic]
* replication policy type, Cloud KMS CryptoKeys must reside in `global`.
* The expected format is `projects/&#42;&#47;locations/&#42;&#47;keyRings/&#42;&#47;cryptoKeys/&#42;`.
* </pre>
*
Expand All @@ -104,13 +106,15 @@ public java.lang.String getKmsKeyName() {
*
*
* <pre>
* Required. The resource name of the Cloud KMS CryptoKey used to encrypt secret
* payloads.
* For secrets using the [UserManaged][google.cloud.secretmanager.v1.Replication.UserManaged] replication
* policy type, Cloud KMS CryptoKeys must reside in the same location as the
* [replica location][Secret.UserManaged.Replica.location].
* For secrets using the [Automatic][google.cloud.secretmanager.v1.Replication.Automatic] replication policy
* type, Cloud KMS CryptoKeys must reside in `global`.
* Required. The resource name of the Cloud KMS CryptoKey used to encrypt
* secret payloads.
* For secrets using the
* [UserManaged][google.cloud.secretmanager.v1.Replication.UserManaged]
* replication policy type, Cloud KMS CryptoKeys must reside in the same
* location as the [replica location][Secret.UserManaged.Replica.location].
* For secrets using the
* [Automatic][google.cloud.secretmanager.v1.Replication.Automatic]
* replication policy type, Cloud KMS CryptoKeys must reside in `global`.
* The expected format is `projects/&#42;&#47;locations/&#42;&#47;keyRings/&#42;&#47;cryptoKeys/&#42;`.
* </pre>
*
Expand Down Expand Up @@ -468,13 +472,15 @@ public Builder mergeFrom(
*
*
* <pre>
* Required. The resource name of the Cloud KMS CryptoKey used to encrypt secret
* payloads.
* For secrets using the [UserManaged][google.cloud.secretmanager.v1.Replication.UserManaged] replication
* policy type, Cloud KMS CryptoKeys must reside in the same location as the
* [replica location][Secret.UserManaged.Replica.location].
* For secrets using the [Automatic][google.cloud.secretmanager.v1.Replication.Automatic] replication policy
* type, Cloud KMS CryptoKeys must reside in `global`.
* Required. The resource name of the Cloud KMS CryptoKey used to encrypt
* secret payloads.
* For secrets using the
* [UserManaged][google.cloud.secretmanager.v1.Replication.UserManaged]
* replication policy type, Cloud KMS CryptoKeys must reside in the same
* location as the [replica location][Secret.UserManaged.Replica.location].
* For secrets using the
* [Automatic][google.cloud.secretmanager.v1.Replication.Automatic]
* replication policy type, Cloud KMS CryptoKeys must reside in `global`.
* The expected format is `projects/&#42;&#47;locations/&#42;&#47;keyRings/&#42;&#47;cryptoKeys/&#42;`.
* </pre>
*
Expand All @@ -497,13 +503,15 @@ public java.lang.String getKmsKeyName() {
*
*
* <pre>
* Required. The resource name of the Cloud KMS CryptoKey used to encrypt secret
* payloads.
* For secrets using the [UserManaged][google.cloud.secretmanager.v1.Replication.UserManaged] replication
* policy type, Cloud KMS CryptoKeys must reside in the same location as the
* [replica location][Secret.UserManaged.Replica.location].
* For secrets using the [Automatic][google.cloud.secretmanager.v1.Replication.Automatic] replication policy
* type, Cloud KMS CryptoKeys must reside in `global`.
* Required. The resource name of the Cloud KMS CryptoKey used to encrypt
* secret payloads.
* For secrets using the
* [UserManaged][google.cloud.secretmanager.v1.Replication.UserManaged]
* replication policy type, Cloud KMS CryptoKeys must reside in the same
* location as the [replica location][Secret.UserManaged.Replica.location].
* For secrets using the
* [Automatic][google.cloud.secretmanager.v1.Replication.Automatic]
* replication policy type, Cloud KMS CryptoKeys must reside in `global`.
* The expected format is `projects/&#42;&#47;locations/&#42;&#47;keyRings/&#42;&#47;cryptoKeys/&#42;`.
* </pre>
*
Expand All @@ -526,13 +534,15 @@ public com.google.protobuf.ByteString getKmsKeyNameBytes() {
*
*
* <pre>
* Required. The resource name of the Cloud KMS CryptoKey used to encrypt secret
* payloads.
* For secrets using the [UserManaged][google.cloud.secretmanager.v1.Replication.UserManaged] replication
* policy type, Cloud KMS CryptoKeys must reside in the same location as the
* [replica location][Secret.UserManaged.Replica.location].
* For secrets using the [Automatic][google.cloud.secretmanager.v1.Replication.Automatic] replication policy
* type, Cloud KMS CryptoKeys must reside in `global`.
* Required. The resource name of the Cloud KMS CryptoKey used to encrypt
* secret payloads.
* For secrets using the
* [UserManaged][google.cloud.secretmanager.v1.Replication.UserManaged]
* replication policy type, Cloud KMS CryptoKeys must reside in the same
* location as the [replica location][Secret.UserManaged.Replica.location].
* For secrets using the
* [Automatic][google.cloud.secretmanager.v1.Replication.Automatic]
* replication policy type, Cloud KMS CryptoKeys must reside in `global`.
* The expected format is `projects/&#42;&#47;locations/&#42;&#47;keyRings/&#42;&#47;cryptoKeys/&#42;`.
* </pre>
*
Expand All @@ -554,13 +564,15 @@ public Builder setKmsKeyName(java.lang.String value) {
*
*
* <pre>
* Required. The resource name of the Cloud KMS CryptoKey used to encrypt secret
* payloads.
* For secrets using the [UserManaged][google.cloud.secretmanager.v1.Replication.UserManaged] replication
* policy type, Cloud KMS CryptoKeys must reside in the same location as the
* [replica location][Secret.UserManaged.Replica.location].
* For secrets using the [Automatic][google.cloud.secretmanager.v1.Replication.Automatic] replication policy
* type, Cloud KMS CryptoKeys must reside in `global`.
* Required. The resource name of the Cloud KMS CryptoKey used to encrypt
* secret payloads.
* For secrets using the
* [UserManaged][google.cloud.secretmanager.v1.Replication.UserManaged]
* replication policy type, Cloud KMS CryptoKeys must reside in the same
* location as the [replica location][Secret.UserManaged.Replica.location].
* For secrets using the
* [Automatic][google.cloud.secretmanager.v1.Replication.Automatic]
* replication policy type, Cloud KMS CryptoKeys must reside in `global`.
* The expected format is `projects/&#42;&#47;locations/&#42;&#47;keyRings/&#42;&#47;cryptoKeys/&#42;`.
* </pre>
*
Expand All @@ -578,13 +590,15 @@ public Builder clearKmsKeyName() {
*
*
* <pre>
* Required. The resource name of the Cloud KMS CryptoKey used to encrypt secret
* payloads.
* For secrets using the [UserManaged][google.cloud.secretmanager.v1.Replication.UserManaged] replication
* policy type, Cloud KMS CryptoKeys must reside in the same location as the
* [replica location][Secret.UserManaged.Replica.location].
* For secrets using the [Automatic][google.cloud.secretmanager.v1.Replication.Automatic] replication policy
* type, Cloud KMS CryptoKeys must reside in `global`.
* Required. The resource name of the Cloud KMS CryptoKey used to encrypt
* secret payloads.
* For secrets using the
* [UserManaged][google.cloud.secretmanager.v1.Replication.UserManaged]
* replication policy type, Cloud KMS CryptoKeys must reside in the same
* location as the [replica location][Secret.UserManaged.Replica.location].
* For secrets using the
* [Automatic][google.cloud.secretmanager.v1.Replication.Automatic]
* replication policy type, Cloud KMS CryptoKeys must reside in `global`.
* The expected format is `projects/&#42;&#47;locations/&#42;&#47;keyRings/&#42;&#47;cryptoKeys/&#42;`.
* </pre>
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,13 +27,15 @@ public interface CustomerManagedEncryptionOrBuilder
*
*
* <pre>
* Required. The resource name of the Cloud KMS CryptoKey used to encrypt secret
* payloads.
* For secrets using the [UserManaged][google.cloud.secretmanager.v1.Replication.UserManaged] replication
* policy type, Cloud KMS CryptoKeys must reside in the same location as the
* [replica location][Secret.UserManaged.Replica.location].
* For secrets using the [Automatic][google.cloud.secretmanager.v1.Replication.Automatic] replication policy
* type, Cloud KMS CryptoKeys must reside in `global`.
* Required. The resource name of the Cloud KMS CryptoKey used to encrypt
* secret payloads.
* For secrets using the
* [UserManaged][google.cloud.secretmanager.v1.Replication.UserManaged]
* replication policy type, Cloud KMS CryptoKeys must reside in the same
* location as the [replica location][Secret.UserManaged.Replica.location].
* For secrets using the
* [Automatic][google.cloud.secretmanager.v1.Replication.Automatic]
* replication policy type, Cloud KMS CryptoKeys must reside in `global`.
* The expected format is `projects/&#42;&#47;locations/&#42;&#47;keyRings/&#42;&#47;cryptoKeys/&#42;`.
* </pre>
*
Expand All @@ -46,13 +48,15 @@ public interface CustomerManagedEncryptionOrBuilder
*
*
* <pre>
* Required. The resource name of the Cloud KMS CryptoKey used to encrypt secret
* payloads.
* For secrets using the [UserManaged][google.cloud.secretmanager.v1.Replication.UserManaged] replication
* policy type, Cloud KMS CryptoKeys must reside in the same location as the
* [replica location][Secret.UserManaged.Replica.location].
* For secrets using the [Automatic][google.cloud.secretmanager.v1.Replication.Automatic] replication policy
* type, Cloud KMS CryptoKeys must reside in `global`.
* Required. The resource name of the Cloud KMS CryptoKey used to encrypt
* secret payloads.
* For secrets using the
* [UserManaged][google.cloud.secretmanager.v1.Replication.UserManaged]
* replication policy type, Cloud KMS CryptoKeys must reside in the same
* location as the [replica location][Secret.UserManaged.Replica.location].
* For secrets using the
* [Automatic][google.cloud.secretmanager.v1.Replication.Automatic]
* replication policy type, Cloud KMS CryptoKeys must reside in `global`.
* The expected format is `projects/&#42;&#47;locations/&#42;&#47;keyRings/&#42;&#47;cryptoKeys/&#42;`.
* </pre>
*
Expand Down
Loading