Skip to content

Commit

Permalink
feat: [alloydb] Add new field in GenerateClientCertificate v1 API t…
Browse files Browse the repository at this point in the history
…o 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>
  • Loading branch information
gcf-owl-bot[bot] and gcf-owl-bot[bot] authored Nov 1, 2023
1 parent 9c2647b commit bc8bbd0
Show file tree
Hide file tree
Showing 12 changed files with 384 additions and 242 deletions.
4 changes: 2 additions & 2 deletions java-alloydb/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ If you are using Maven with [BOM][libraries-bom], add this to your pom.xml file:
<dependency>
<groupId>com.google.cloud</groupId>
<artifactId>libraries-bom</artifactId>
<version>26.23.0</version>
<version>26.26.0</version>
<type>pom</type>
<scope>import</scope>
</dependency>
Expand Down Expand Up @@ -201,7 +201,7 @@ Java is a registered trademark of Oracle and/or its affiliates.
[kokoro-badge-link-5]: http://storage.googleapis.com/cloud-devrel-public/java/badges/java-alloydb/java11.html
[stability-image]: https://img.shields.io/badge/stability-preview-yellow
[maven-version-image]: https://img.shields.io/maven-central/v/com.google.cloud/google-cloud-alloydb.svg
[maven-version-link]: https://central.sonatype.com/artifact/com.google.cloud/google-cloud-alloydb/0.13.0
[maven-version-link]: https://central.sonatype.com/artifact/com.google.cloud/google-cloud-alloydb/0.18.0
[authentication]: https://github.com/googleapis/google-cloud-java#authentication
[auth-scopes]: https://developers.google.com/identity/protocols/oauth2/scopes
[predefined-iam-roles]: https://cloud.google.com/iam/docs/understanding-roles#predefined_roles
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3872,6 +3872,7 @@ public final GenerateClientCertificateResponse generateClientCertificate(String
* .setRequestId("requestId693933066")
* .setCertDuration(Duration.newBuilder().build())
* .setPublicKey("publicKey1446899510")
* .setUseMetadataExchange(true)
* .build();
* GenerateClientCertificateResponse response =
* alloyDBAdminClient.generateClientCertificate(request);
Expand Down Expand Up @@ -3908,6 +3909,7 @@ public final GenerateClientCertificateResponse generateClientCertificate(
* .setRequestId("requestId693933066")
* .setCertDuration(Duration.newBuilder().build())
* .setPublicKey("publicKey1446899510")
* .setUseMetadataExchange(true)
* .build();
* ApiFuture<GenerateClientCertificateResponse> future =
* alloyDBAdminClient.generateClientCertificateCallable().futureCall(request);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -623,8 +623,8 @@ public interface NetworkConfigOrBuilder
* instance IPs for this cluster will be created in the allocated range. The
* range name must comply with RFC 1035. Specifically, the name must be 1-63
* characters long and match the regular expression
* [a-z]([-a-z0-9]*[a-z0-9])?.
* Field name is intended to be consistent with CloudSQL.
* `[a-z]([-a-z0-9]*[a-z0-9])?`.
* Field name is intended to be consistent with Cloud SQL.
* </pre>
*
* <code>string allocated_ip_range = 2 [(.google.api.field_behavior) = OPTIONAL];</code>
Expand All @@ -641,8 +641,8 @@ public interface NetworkConfigOrBuilder
* instance IPs for this cluster will be created in the allocated range. The
* range name must comply with RFC 1035. Specifically, the name must be 1-63
* characters long and match the regular expression
* [a-z]([-a-z0-9]*[a-z0-9])?.
* Field name is intended to be consistent with CloudSQL.
* `[a-z]([-a-z0-9]*[a-z0-9])?`.
* Field name is intended to be consistent with Cloud SQL.
* </pre>
*
* <code>string allocated_ip_range = 2 [(.google.api.field_behavior) = OPTIONAL];</code>
Expand Down Expand Up @@ -774,8 +774,8 @@ public com.google.protobuf.ByteString getNetworkBytes() {
* instance IPs for this cluster will be created in the allocated range. The
* range name must comply with RFC 1035. Specifically, the name must be 1-63
* characters long and match the regular expression
* [a-z]([-a-z0-9]*[a-z0-9])?.
* Field name is intended to be consistent with CloudSQL.
* `[a-z]([-a-z0-9]*[a-z0-9])?`.
* Field name is intended to be consistent with Cloud SQL.
* </pre>
*
* <code>string allocated_ip_range = 2 [(.google.api.field_behavior) = OPTIONAL];</code>
Expand Down Expand Up @@ -803,8 +803,8 @@ public java.lang.String getAllocatedIpRange() {
* instance IPs for this cluster will be created in the allocated range. The
* range name must comply with RFC 1035. Specifically, the name must be 1-63
* characters long and match the regular expression
* [a-z]([-a-z0-9]*[a-z0-9])?.
* Field name is intended to be consistent with CloudSQL.
* `[a-z]([-a-z0-9]*[a-z0-9])?`.
* Field name is intended to be consistent with Cloud SQL.
* </pre>
*
* <code>string allocated_ip_range = 2 [(.google.api.field_behavior) = OPTIONAL];</code>
Expand Down Expand Up @@ -1345,8 +1345,8 @@ public Builder setNetworkBytes(com.google.protobuf.ByteString value) {
* instance IPs for this cluster will be created in the allocated range. The
* range name must comply with RFC 1035. Specifically, the name must be 1-63
* characters long and match the regular expression
* [a-z]([-a-z0-9]*[a-z0-9])?.
* Field name is intended to be consistent with CloudSQL.
* `[a-z]([-a-z0-9]*[a-z0-9])?`.
* Field name is intended to be consistent with Cloud SQL.
* </pre>
*
* <code>string allocated_ip_range = 2 [(.google.api.field_behavior) = OPTIONAL];</code>
Expand All @@ -1373,8 +1373,8 @@ public java.lang.String getAllocatedIpRange() {
* instance IPs for this cluster will be created in the allocated range. The
* range name must comply with RFC 1035. Specifically, the name must be 1-63
* characters long and match the regular expression
* [a-z]([-a-z0-9]*[a-z0-9])?.
* Field name is intended to be consistent with CloudSQL.
* `[a-z]([-a-z0-9]*[a-z0-9])?`.
* Field name is intended to be consistent with Cloud SQL.
* </pre>
*
* <code>string allocated_ip_range = 2 [(.google.api.field_behavior) = OPTIONAL];</code>
Expand All @@ -1401,8 +1401,8 @@ public com.google.protobuf.ByteString getAllocatedIpRangeBytes() {
* instance IPs for this cluster will be created in the allocated range. The
* range name must comply with RFC 1035. Specifically, the name must be 1-63
* characters long and match the regular expression
* [a-z]([-a-z0-9]*[a-z0-9])?.
* Field name is intended to be consistent with CloudSQL.
* `[a-z]([-a-z0-9]*[a-z0-9])?`.
* Field name is intended to be consistent with Cloud SQL.
* </pre>
*
* <code>string allocated_ip_range = 2 [(.google.api.field_behavior) = OPTIONAL];</code>
Expand All @@ -1428,8 +1428,8 @@ public Builder setAllocatedIpRange(java.lang.String value) {
* instance IPs for this cluster will be created in the allocated range. The
* range name must comply with RFC 1035. Specifically, the name must be 1-63
* characters long and match the regular expression
* [a-z]([-a-z0-9]*[a-z0-9])?.
* Field name is intended to be consistent with CloudSQL.
* `[a-z]([-a-z0-9]*[a-z0-9])?`.
* Field name is intended to be consistent with Cloud SQL.
* </pre>
*
* <code>string allocated_ip_range = 2 [(.google.api.field_behavior) = OPTIONAL];</code>
Expand All @@ -1451,8 +1451,8 @@ public Builder clearAllocatedIpRange() {
* instance IPs for this cluster will be created in the allocated range. The
* range name must comply with RFC 1035. Specifically, the name must be 1-63
* characters long and match the regular expression
* [a-z]([-a-z0-9]*[a-z0-9])?.
* Field name is intended to be consistent with CloudSQL.
* `[a-z]([-a-z0-9]*[a-z0-9])?`.
* Field name is intended to be consistent with Cloud SQL.
* </pre>
*
* <code>string allocated_ip_range = 2 [(.google.api.field_behavior) = OPTIONAL];</code>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -314,6 +314,26 @@ public com.google.protobuf.ByteString getPublicKeyBytes() {
}
}

public static final int USE_METADATA_EXCHANGE_FIELD_NUMBER = 6;
private boolean useMetadataExchange_ = false;
/**
*
*
* <pre>
* Optional. An optional hint to the endpoint to generate a client
* ceritificate that can be used by AlloyDB connectors to exchange additional
* metadata with the server after TLS handshake.
* </pre>
*
* <code>bool use_metadata_exchange = 6 [(.google.api.field_behavior) = OPTIONAL];</code>
*
* @return The useMetadataExchange.
*/
@java.lang.Override
public boolean getUseMetadataExchange() {
return useMetadataExchange_;
}

private byte memoizedIsInitialized = -1;

@java.lang.Override
Expand All @@ -340,6 +360,9 @@ public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io
if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(publicKey_)) {
com.google.protobuf.GeneratedMessageV3.writeString(output, 5, publicKey_);
}
if (useMetadataExchange_ != false) {
output.writeBool(6, useMetadataExchange_);
}
getUnknownFields().writeTo(output);
}

Expand All @@ -361,6 +384,9 @@ public int getSerializedSize() {
if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(publicKey_)) {
size += com.google.protobuf.GeneratedMessageV3.computeStringSize(5, publicKey_);
}
if (useMetadataExchange_ != false) {
size += com.google.protobuf.CodedOutputStream.computeBoolSize(6, useMetadataExchange_);
}
size += getUnknownFields().getSerializedSize();
memoizedSize = size;
return size;
Expand All @@ -384,6 +410,7 @@ public boolean equals(final java.lang.Object obj) {
if (!getCertDuration().equals(other.getCertDuration())) return false;
}
if (!getPublicKey().equals(other.getPublicKey())) return false;
if (getUseMetadataExchange() != other.getUseMetadataExchange()) return false;
if (!getUnknownFields().equals(other.getUnknownFields())) return false;
return true;
}
Expand All @@ -405,6 +432,8 @@ public int hashCode() {
}
hash = (37 * hash) + PUBLIC_KEY_FIELD_NUMBER;
hash = (53 * hash) + getPublicKey().hashCode();
hash = (37 * hash) + USE_METADATA_EXCHANGE_FIELD_NUMBER;
hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getUseMetadataExchange());
hash = (29 * hash) + getUnknownFields().hashCode();
memoizedHashCode = hash;
return hash;
Expand Down Expand Up @@ -554,6 +583,7 @@ public Builder clear() {
certDurationBuilder_ = null;
}
publicKey_ = "";
useMetadataExchange_ = false;
return this;
}

Expand Down Expand Up @@ -605,6 +635,9 @@ private void buildPartial0(
if (((from_bitField0_ & 0x00000008) != 0)) {
result.publicKey_ = publicKey_;
}
if (((from_bitField0_ & 0x00000010) != 0)) {
result.useMetadataExchange_ = useMetadataExchange_;
}
}

@java.lang.Override
Expand Down Expand Up @@ -672,6 +705,9 @@ public Builder mergeFrom(com.google.cloud.alloydb.v1.GenerateClientCertificateRe
bitField0_ |= 0x00000008;
onChanged();
}
if (other.getUseMetadataExchange() != false) {
setUseMetadataExchange(other.getUseMetadataExchange());
}
this.mergeUnknownFields(other.getUnknownFields());
onChanged();
return this;
Expand Down Expand Up @@ -722,6 +758,12 @@ public Builder mergeFrom(
bitField0_ |= 0x00000008;
break;
} // case 42
case 48:
{
useMetadataExchange_ = input.readBool();
bitField0_ |= 0x00000010;
break;
} // case 48
default:
{
if (!super.parseUnknownField(input, extensionRegistry, tag)) {
Expand Down Expand Up @@ -1362,6 +1404,65 @@ public Builder setPublicKeyBytes(com.google.protobuf.ByteString value) {
return this;
}

private boolean useMetadataExchange_;
/**
*
*
* <pre>
* Optional. An optional hint to the endpoint to generate a client
* ceritificate that can be used by AlloyDB connectors to exchange additional
* metadata with the server after TLS handshake.
* </pre>
*
* <code>bool use_metadata_exchange = 6 [(.google.api.field_behavior) = OPTIONAL];</code>
*
* @return The useMetadataExchange.
*/
@java.lang.Override
public boolean getUseMetadataExchange() {
return useMetadataExchange_;
}
/**
*
*
* <pre>
* Optional. An optional hint to the endpoint to generate a client
* ceritificate that can be used by AlloyDB connectors to exchange additional
* metadata with the server after TLS handshake.
* </pre>
*
* <code>bool use_metadata_exchange = 6 [(.google.api.field_behavior) = OPTIONAL];</code>
*
* @param value The useMetadataExchange to set.
* @return This builder for chaining.
*/
public Builder setUseMetadataExchange(boolean value) {

useMetadataExchange_ = value;
bitField0_ |= 0x00000010;
onChanged();
return this;
}
/**
*
*
* <pre>
* Optional. An optional hint to the endpoint to generate a client
* ceritificate that can be used by AlloyDB connectors to exchange additional
* metadata with the server after TLS handshake.
* </pre>
*
* <code>bool use_metadata_exchange = 6 [(.google.api.field_behavior) = OPTIONAL];</code>
*
* @return This builder for chaining.
*/
public Builder clearUseMetadataExchange() {
bitField0_ = (bitField0_ & ~0x00000010);
useMetadataExchange_ = false;
onChanged();
return this;
}

@java.lang.Override
public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) {
return super.setUnknownFields(unknownFields);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -177,4 +177,19 @@ public interface GenerateClientCertificateRequestOrBuilder
* @return The bytes for publicKey.
*/
com.google.protobuf.ByteString getPublicKeyBytes();

/**
*
*
* <pre>
* Optional. An optional hint to the endpoint to generate a client
* ceritificate that can be used by AlloyDB connectors to exchange additional
* metadata with the server after TLS handshake.
* </pre>
*
* <code>bool use_metadata_exchange = 6 [(.google.api.field_behavior) = OPTIONAL];</code>
*
* @return The useMetadataExchange.
*/
boolean getUseMetadataExchange();
}
Loading

0 comments on commit bc8bbd0

Please sign in to comment.