Skip to content

Commit bc8bbd0

Browse files
feat: [alloydb] Add new field in GenerateClientCertificate v1 API to allow AlloyDB connectors request client certs with metadata exchange support (#10024)
* feat: Add new field in `GenerateClientCertificate` v1 API to allow AlloyDB connectors request client certs with metadata exchange support docs: Clarify that `readPoolConfig` is required under certain circumstances, and fix doc formatting on `allocatedIpRange`. PiperOrigin-RevId: 578577028 Source-Link: googleapis/googleapis@c0a2b54 Source-Link: https://github.com/googleapis/googleapis-gen/commit/4791ced8186e658805f2f75243da29c5dabb1f76 Copy-Tag: eyJwIjoiamF2YS1hbGxveWRiLy5Pd2xCb3QueWFtbCIsImgiOiI0NzkxY2VkODE4NmU2NTg4MDVmMmY3NTI0M2RhMjljNWRhYmIxZjc2In0= * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md --------- Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com>
1 parent 9c2647b commit bc8bbd0

File tree

12 files changed

+384
-242
lines changed

12 files changed

+384
-242
lines changed

java-alloydb/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ If you are using Maven with [BOM][libraries-bom], add this to your pom.xml file:
2323
<dependency>
2424
<groupId>com.google.cloud</groupId>
2525
<artifactId>libraries-bom</artifactId>
26-
<version>26.23.0</version>
26+
<version>26.26.0</version>
2727
<type>pom</type>
2828
<scope>import</scope>
2929
</dependency>
@@ -201,7 +201,7 @@ Java is a registered trademark of Oracle and/or its affiliates.
201201
[kokoro-badge-link-5]: http://storage.googleapis.com/cloud-devrel-public/java/badges/java-alloydb/java11.html
202202
[stability-image]: https://img.shields.io/badge/stability-preview-yellow
203203
[maven-version-image]: https://img.shields.io/maven-central/v/com.google.cloud/google-cloud-alloydb.svg
204-
[maven-version-link]: https://central.sonatype.com/artifact/com.google.cloud/google-cloud-alloydb/0.13.0
204+
[maven-version-link]: https://central.sonatype.com/artifact/com.google.cloud/google-cloud-alloydb/0.18.0
205205
[authentication]: https://github.com/googleapis/google-cloud-java#authentication
206206
[auth-scopes]: https://developers.google.com/identity/protocols/oauth2/scopes
207207
[predefined-iam-roles]: https://cloud.google.com/iam/docs/understanding-roles#predefined_roles

java-alloydb/google-cloud-alloydb/src/main/java/com/google/cloud/alloydb/v1/AlloyDBAdminClient.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3872,6 +3872,7 @@ public final GenerateClientCertificateResponse generateClientCertificate(String
38723872
* .setRequestId("requestId693933066")
38733873
* .setCertDuration(Duration.newBuilder().build())
38743874
* .setPublicKey("publicKey1446899510")
3875+
* .setUseMetadataExchange(true)
38753876
* .build();
38763877
* GenerateClientCertificateResponse response =
38773878
* alloyDBAdminClient.generateClientCertificate(request);
@@ -3908,6 +3909,7 @@ public final GenerateClientCertificateResponse generateClientCertificate(
39083909
* .setRequestId("requestId693933066")
39093910
* .setCertDuration(Duration.newBuilder().build())
39103911
* .setPublicKey("publicKey1446899510")
3912+
* .setUseMetadataExchange(true)
39113913
* .build();
39123914
* ApiFuture<GenerateClientCertificateResponse> future =
39133915
* alloyDBAdminClient.generateClientCertificateCallable().futureCall(request);

java-alloydb/proto-google-cloud-alloydb-v1/src/main/java/com/google/cloud/alloydb/v1/Cluster.java

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -623,8 +623,8 @@ public interface NetworkConfigOrBuilder
623623
* instance IPs for this cluster will be created in the allocated range. The
624624
* range name must comply with RFC 1035. Specifically, the name must be 1-63
625625
* characters long and match the regular expression
626-
* [a-z]([-a-z0-9]*[a-z0-9])?.
627-
* Field name is intended to be consistent with CloudSQL.
626+
* `[a-z]([-a-z0-9]*[a-z0-9])?`.
627+
* Field name is intended to be consistent with Cloud SQL.
628628
* </pre>
629629
*
630630
* <code>string allocated_ip_range = 2 [(.google.api.field_behavior) = OPTIONAL];</code>
@@ -641,8 +641,8 @@ public interface NetworkConfigOrBuilder
641641
* instance IPs for this cluster will be created in the allocated range. The
642642
* range name must comply with RFC 1035. Specifically, the name must be 1-63
643643
* characters long and match the regular expression
644-
* [a-z]([-a-z0-9]*[a-z0-9])?.
645-
* Field name is intended to be consistent with CloudSQL.
644+
* `[a-z]([-a-z0-9]*[a-z0-9])?`.
645+
* Field name is intended to be consistent with Cloud SQL.
646646
* </pre>
647647
*
648648
* <code>string allocated_ip_range = 2 [(.google.api.field_behavior) = OPTIONAL];</code>
@@ -774,8 +774,8 @@ public com.google.protobuf.ByteString getNetworkBytes() {
774774
* instance IPs for this cluster will be created in the allocated range. The
775775
* range name must comply with RFC 1035. Specifically, the name must be 1-63
776776
* characters long and match the regular expression
777-
* [a-z]([-a-z0-9]*[a-z0-9])?.
778-
* Field name is intended to be consistent with CloudSQL.
777+
* `[a-z]([-a-z0-9]*[a-z0-9])?`.
778+
* Field name is intended to be consistent with Cloud SQL.
779779
* </pre>
780780
*
781781
* <code>string allocated_ip_range = 2 [(.google.api.field_behavior) = OPTIONAL];</code>
@@ -803,8 +803,8 @@ public java.lang.String getAllocatedIpRange() {
803803
* instance IPs for this cluster will be created in the allocated range. The
804804
* range name must comply with RFC 1035. Specifically, the name must be 1-63
805805
* characters long and match the regular expression
806-
* [a-z]([-a-z0-9]*[a-z0-9])?.
807-
* Field name is intended to be consistent with CloudSQL.
806+
* `[a-z]([-a-z0-9]*[a-z0-9])?`.
807+
* Field name is intended to be consistent with Cloud SQL.
808808
* </pre>
809809
*
810810
* <code>string allocated_ip_range = 2 [(.google.api.field_behavior) = OPTIONAL];</code>
@@ -1345,8 +1345,8 @@ public Builder setNetworkBytes(com.google.protobuf.ByteString value) {
13451345
* instance IPs for this cluster will be created in the allocated range. The
13461346
* range name must comply with RFC 1035. Specifically, the name must be 1-63
13471347
* characters long and match the regular expression
1348-
* [a-z]([-a-z0-9]*[a-z0-9])?.
1349-
* Field name is intended to be consistent with CloudSQL.
1348+
* `[a-z]([-a-z0-9]*[a-z0-9])?`.
1349+
* Field name is intended to be consistent with Cloud SQL.
13501350
* </pre>
13511351
*
13521352
* <code>string allocated_ip_range = 2 [(.google.api.field_behavior) = OPTIONAL];</code>
@@ -1373,8 +1373,8 @@ public java.lang.String getAllocatedIpRange() {
13731373
* instance IPs for this cluster will be created in the allocated range. The
13741374
* range name must comply with RFC 1035. Specifically, the name must be 1-63
13751375
* characters long and match the regular expression
1376-
* [a-z]([-a-z0-9]*[a-z0-9])?.
1377-
* Field name is intended to be consistent with CloudSQL.
1376+
* `[a-z]([-a-z0-9]*[a-z0-9])?`.
1377+
* Field name is intended to be consistent with Cloud SQL.
13781378
* </pre>
13791379
*
13801380
* <code>string allocated_ip_range = 2 [(.google.api.field_behavior) = OPTIONAL];</code>
@@ -1401,8 +1401,8 @@ public com.google.protobuf.ByteString getAllocatedIpRangeBytes() {
14011401
* instance IPs for this cluster will be created in the allocated range. The
14021402
* range name must comply with RFC 1035. Specifically, the name must be 1-63
14031403
* characters long and match the regular expression
1404-
* [a-z]([-a-z0-9]*[a-z0-9])?.
1405-
* Field name is intended to be consistent with CloudSQL.
1404+
* `[a-z]([-a-z0-9]*[a-z0-9])?`.
1405+
* Field name is intended to be consistent with Cloud SQL.
14061406
* </pre>
14071407
*
14081408
* <code>string allocated_ip_range = 2 [(.google.api.field_behavior) = OPTIONAL];</code>
@@ -1428,8 +1428,8 @@ public Builder setAllocatedIpRange(java.lang.String value) {
14281428
* instance IPs for this cluster will be created in the allocated range. The
14291429
* range name must comply with RFC 1035. Specifically, the name must be 1-63
14301430
* characters long and match the regular expression
1431-
* [a-z]([-a-z0-9]*[a-z0-9])?.
1432-
* Field name is intended to be consistent with CloudSQL.
1431+
* `[a-z]([-a-z0-9]*[a-z0-9])?`.
1432+
* Field name is intended to be consistent with Cloud SQL.
14331433
* </pre>
14341434
*
14351435
* <code>string allocated_ip_range = 2 [(.google.api.field_behavior) = OPTIONAL];</code>
@@ -1451,8 +1451,8 @@ public Builder clearAllocatedIpRange() {
14511451
* instance IPs for this cluster will be created in the allocated range. The
14521452
* range name must comply with RFC 1035. Specifically, the name must be 1-63
14531453
* characters long and match the regular expression
1454-
* [a-z]([-a-z0-9]*[a-z0-9])?.
1455-
* Field name is intended to be consistent with CloudSQL.
1454+
* `[a-z]([-a-z0-9]*[a-z0-9])?`.
1455+
* Field name is intended to be consistent with Cloud SQL.
14561456
* </pre>
14571457
*
14581458
* <code>string allocated_ip_range = 2 [(.google.api.field_behavior) = OPTIONAL];</code>

java-alloydb/proto-google-cloud-alloydb-v1/src/main/java/com/google/cloud/alloydb/v1/GenerateClientCertificateRequest.java

Lines changed: 101 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -314,6 +314,26 @@ public com.google.protobuf.ByteString getPublicKeyBytes() {
314314
}
315315
}
316316

317+
public static final int USE_METADATA_EXCHANGE_FIELD_NUMBER = 6;
318+
private boolean useMetadataExchange_ = false;
319+
/**
320+
*
321+
*
322+
* <pre>
323+
* Optional. An optional hint to the endpoint to generate a client
324+
* ceritificate that can be used by AlloyDB connectors to exchange additional
325+
* metadata with the server after TLS handshake.
326+
* </pre>
327+
*
328+
* <code>bool use_metadata_exchange = 6 [(.google.api.field_behavior) = OPTIONAL];</code>
329+
*
330+
* @return The useMetadataExchange.
331+
*/
332+
@java.lang.Override
333+
public boolean getUseMetadataExchange() {
334+
return useMetadataExchange_;
335+
}
336+
317337
private byte memoizedIsInitialized = -1;
318338

319339
@java.lang.Override
@@ -340,6 +360,9 @@ public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io
340360
if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(publicKey_)) {
341361
com.google.protobuf.GeneratedMessageV3.writeString(output, 5, publicKey_);
342362
}
363+
if (useMetadataExchange_ != false) {
364+
output.writeBool(6, useMetadataExchange_);
365+
}
343366
getUnknownFields().writeTo(output);
344367
}
345368

@@ -361,6 +384,9 @@ public int getSerializedSize() {
361384
if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(publicKey_)) {
362385
size += com.google.protobuf.GeneratedMessageV3.computeStringSize(5, publicKey_);
363386
}
387+
if (useMetadataExchange_ != false) {
388+
size += com.google.protobuf.CodedOutputStream.computeBoolSize(6, useMetadataExchange_);
389+
}
364390
size += getUnknownFields().getSerializedSize();
365391
memoizedSize = size;
366392
return size;
@@ -384,6 +410,7 @@ public boolean equals(final java.lang.Object obj) {
384410
if (!getCertDuration().equals(other.getCertDuration())) return false;
385411
}
386412
if (!getPublicKey().equals(other.getPublicKey())) return false;
413+
if (getUseMetadataExchange() != other.getUseMetadataExchange()) return false;
387414
if (!getUnknownFields().equals(other.getUnknownFields())) return false;
388415
return true;
389416
}
@@ -405,6 +432,8 @@ public int hashCode() {
405432
}
406433
hash = (37 * hash) + PUBLIC_KEY_FIELD_NUMBER;
407434
hash = (53 * hash) + getPublicKey().hashCode();
435+
hash = (37 * hash) + USE_METADATA_EXCHANGE_FIELD_NUMBER;
436+
hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getUseMetadataExchange());
408437
hash = (29 * hash) + getUnknownFields().hashCode();
409438
memoizedHashCode = hash;
410439
return hash;
@@ -554,6 +583,7 @@ public Builder clear() {
554583
certDurationBuilder_ = null;
555584
}
556585
publicKey_ = "";
586+
useMetadataExchange_ = false;
557587
return this;
558588
}
559589

@@ -605,6 +635,9 @@ private void buildPartial0(
605635
if (((from_bitField0_ & 0x00000008) != 0)) {
606636
result.publicKey_ = publicKey_;
607637
}
638+
if (((from_bitField0_ & 0x00000010) != 0)) {
639+
result.useMetadataExchange_ = useMetadataExchange_;
640+
}
608641
}
609642

610643
@java.lang.Override
@@ -672,6 +705,9 @@ public Builder mergeFrom(com.google.cloud.alloydb.v1.GenerateClientCertificateRe
672705
bitField0_ |= 0x00000008;
673706
onChanged();
674707
}
708+
if (other.getUseMetadataExchange() != false) {
709+
setUseMetadataExchange(other.getUseMetadataExchange());
710+
}
675711
this.mergeUnknownFields(other.getUnknownFields());
676712
onChanged();
677713
return this;
@@ -722,6 +758,12 @@ public Builder mergeFrom(
722758
bitField0_ |= 0x00000008;
723759
break;
724760
} // case 42
761+
case 48:
762+
{
763+
useMetadataExchange_ = input.readBool();
764+
bitField0_ |= 0x00000010;
765+
break;
766+
} // case 48
725767
default:
726768
{
727769
if (!super.parseUnknownField(input, extensionRegistry, tag)) {
@@ -1362,6 +1404,65 @@ public Builder setPublicKeyBytes(com.google.protobuf.ByteString value) {
13621404
return this;
13631405
}
13641406

1407+
private boolean useMetadataExchange_;
1408+
/**
1409+
*
1410+
*
1411+
* <pre>
1412+
* Optional. An optional hint to the endpoint to generate a client
1413+
* ceritificate that can be used by AlloyDB connectors to exchange additional
1414+
* metadata with the server after TLS handshake.
1415+
* </pre>
1416+
*
1417+
* <code>bool use_metadata_exchange = 6 [(.google.api.field_behavior) = OPTIONAL];</code>
1418+
*
1419+
* @return The useMetadataExchange.
1420+
*/
1421+
@java.lang.Override
1422+
public boolean getUseMetadataExchange() {
1423+
return useMetadataExchange_;
1424+
}
1425+
/**
1426+
*
1427+
*
1428+
* <pre>
1429+
* Optional. An optional hint to the endpoint to generate a client
1430+
* ceritificate that can be used by AlloyDB connectors to exchange additional
1431+
* metadata with the server after TLS handshake.
1432+
* </pre>
1433+
*
1434+
* <code>bool use_metadata_exchange = 6 [(.google.api.field_behavior) = OPTIONAL];</code>
1435+
*
1436+
* @param value The useMetadataExchange to set.
1437+
* @return This builder for chaining.
1438+
*/
1439+
public Builder setUseMetadataExchange(boolean value) {
1440+
1441+
useMetadataExchange_ = value;
1442+
bitField0_ |= 0x00000010;
1443+
onChanged();
1444+
return this;
1445+
}
1446+
/**
1447+
*
1448+
*
1449+
* <pre>
1450+
* Optional. An optional hint to the endpoint to generate a client
1451+
* ceritificate that can be used by AlloyDB connectors to exchange additional
1452+
* metadata with the server after TLS handshake.
1453+
* </pre>
1454+
*
1455+
* <code>bool use_metadata_exchange = 6 [(.google.api.field_behavior) = OPTIONAL];</code>
1456+
*
1457+
* @return This builder for chaining.
1458+
*/
1459+
public Builder clearUseMetadataExchange() {
1460+
bitField0_ = (bitField0_ & ~0x00000010);
1461+
useMetadataExchange_ = false;
1462+
onChanged();
1463+
return this;
1464+
}
1465+
13651466
@java.lang.Override
13661467
public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) {
13671468
return super.setUnknownFields(unknownFields);

java-alloydb/proto-google-cloud-alloydb-v1/src/main/java/com/google/cloud/alloydb/v1/GenerateClientCertificateRequestOrBuilder.java

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -177,4 +177,19 @@ public interface GenerateClientCertificateRequestOrBuilder
177177
* @return The bytes for publicKey.
178178
*/
179179
com.google.protobuf.ByteString getPublicKeyBytes();
180+
181+
/**
182+
*
183+
*
184+
* <pre>
185+
* Optional. An optional hint to the endpoint to generate a client
186+
* ceritificate that can be used by AlloyDB connectors to exchange additional
187+
* metadata with the server after TLS handshake.
188+
* </pre>
189+
*
190+
* <code>bool use_metadata_exchange = 6 [(.google.api.field_behavior) = OPTIONAL];</code>
191+
*
192+
* @return The useMetadataExchange.
193+
*/
194+
boolean getUseMetadataExchange();
180195
}

0 commit comments

Comments
 (0)