From e8c974b8781c12ac67d7e878cd869324086e75c0 Mon Sep 17 00:00:00 2001
From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com>
Date: Thu, 16 Nov 2023 19:02:21 +0000
Subject: [PATCH] feat: [confidentialcomputing] Add a new field `token_type` to
`TokenOptions` message proto (#10051)
- [ ] Regenerate this pull request now.
chore: remove backend configuration from the service config
PiperOrigin-RevId: 581042395
Source-Link: https://togithub.com/googleapis/googleapis/commit/2a4cbb9766ba13cd435d47ac91af4138d4821d22
Source-Link: https://togithub.com/googleapis/googleapis-gen/commit/a8d92b254cf89d1c310ae58167fdd1fd3d1d4d03
Copy-Tag: eyJwIjoiamF2YS1jb25maWRlbnRpYWxjb21wdXRpbmcvLk93bEJvdC55YW1sIiwiaCI6ImE4ZDkyYjI1NGNmODlkMWMzMTBhZTU4MTY3ZmRkMWZkM2QxZDRkMDMifQ==
---
java-confidentialcomputing/README.md | 4 +-
.../reflect-config.json | 9 +
.../v1/ServiceProto.java | 101 ++++++-----
.../v1/TokenOptions.java | 168 ++++++++++++++++++
.../v1/TokenOptionsOrBuilder.java | 29 +++
.../confidentialcomputing/v1/TokenType.java | 157 ++++++++++++++++
.../confidentialcomputing/v1/service.proto | 13 ++
7 files changed, 430 insertions(+), 51 deletions(-)
create mode 100644 java-confidentialcomputing/proto-google-cloud-confidentialcomputing-v1/src/main/java/com/google/cloud/confidentialcomputing/v1/TokenType.java
diff --git a/java-confidentialcomputing/README.md b/java-confidentialcomputing/README.md
index b62025beb38d..57f7ccc6df1b 100644
--- a/java-confidentialcomputing/README.md
+++ b/java-confidentialcomputing/README.md
@@ -23,7 +23,7 @@ If you are using Maven with [BOM][libraries-bom], add this to your pom.xml file:
+ * Optional. Optional token type to select what type of token to return. + *+ * + *
+ * .google.cloud.confidentialcomputing.v1.TokenType token_type = 3 [(.google.api.field_behavior) = OPTIONAL];
+ *
+ *
+ * @return The enum numeric value on the wire for tokenType.
+ */
+ @java.lang.Override
+ public int getTokenTypeValue() {
+ return tokenType_;
+ }
+ /**
+ *
+ *
+ * + * Optional. Optional token type to select what type of token to return. + *+ * + *
+ * .google.cloud.confidentialcomputing.v1.TokenType token_type = 3 [(.google.api.field_behavior) = OPTIONAL];
+ *
+ *
+ * @return The tokenType.
+ */
+ @java.lang.Override
+ public com.google.cloud.confidentialcomputing.v1.TokenType getTokenType() {
+ com.google.cloud.confidentialcomputing.v1.TokenType result =
+ com.google.cloud.confidentialcomputing.v1.TokenType.forNumber(tokenType_);
+ return result == null
+ ? com.google.cloud.confidentialcomputing.v1.TokenType.UNRECOGNIZED
+ : result;
+ }
+
private byte memoizedIsInitialized = -1;
@java.lang.Override
@@ -208,6 +250,10 @@ public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io
for (int i = 0; i < nonce_.size(); i++) {
com.google.protobuf.GeneratedMessageV3.writeString(output, 2, nonce_.getRaw(i));
}
+ if (tokenType_
+ != com.google.cloud.confidentialcomputing.v1.TokenType.TOKEN_TYPE_UNSPECIFIED.getNumber()) {
+ output.writeEnum(3, tokenType_);
+ }
getUnknownFields().writeTo(output);
}
@@ -228,6 +274,10 @@ public int getSerializedSize() {
size += dataSize;
size += 1 * getNonceList().size();
}
+ if (tokenType_
+ != com.google.cloud.confidentialcomputing.v1.TokenType.TOKEN_TYPE_UNSPECIFIED.getNumber()) {
+ size += com.google.protobuf.CodedOutputStream.computeEnumSize(3, tokenType_);
+ }
size += getUnknownFields().getSerializedSize();
memoizedSize = size;
return size;
@@ -246,6 +296,7 @@ public boolean equals(final java.lang.Object obj) {
if (!getAudience().equals(other.getAudience())) return false;
if (!getNonceList().equals(other.getNonceList())) return false;
+ if (tokenType_ != other.tokenType_) return false;
if (!getUnknownFields().equals(other.getUnknownFields())) return false;
return true;
}
@@ -263,6 +314,8 @@ public int hashCode() {
hash = (37 * hash) + NONCE_FIELD_NUMBER;
hash = (53 * hash) + getNonceList().hashCode();
}
+ hash = (37 * hash) + TOKEN_TYPE_FIELD_NUMBER;
+ hash = (53 * hash) + tokenType_;
hash = (29 * hash) + getUnknownFields().hashCode();
memoizedHashCode = hash;
return hash;
@@ -405,6 +458,7 @@ public Builder clear() {
bitField0_ = 0;
audience_ = "";
nonce_ = com.google.protobuf.LazyStringArrayList.emptyList();
+ tokenType_ = 0;
return this;
}
@@ -448,6 +502,9 @@ private void buildPartial0(com.google.cloud.confidentialcomputing.v1.TokenOption
nonce_.makeImmutable();
result.nonce_ = nonce_;
}
+ if (((from_bitField0_ & 0x00000004) != 0)) {
+ result.tokenType_ = tokenType_;
+ }
}
@java.lang.Override
@@ -511,6 +568,9 @@ public Builder mergeFrom(com.google.cloud.confidentialcomputing.v1.TokenOptions
}
onChanged();
}
+ if (other.tokenType_ != 0) {
+ setTokenTypeValue(other.getTokenTypeValue());
+ }
this.mergeUnknownFields(other.getUnknownFields());
onChanged();
return this;
@@ -550,6 +610,12 @@ public Builder mergeFrom(
nonce_.add(s);
break;
} // case 18
+ case 24:
+ {
+ tokenType_ = input.readEnum();
+ bitField0_ |= 0x00000004;
+ break;
+ } // case 24
default:
{
if (!super.parseUnknownField(input, extensionRegistry, tag)) {
@@ -872,6 +938,108 @@ public Builder addNonceBytes(com.google.protobuf.ByteString value) {
return this;
}
+ private int tokenType_ = 0;
+ /**
+ *
+ *
+ * + * Optional. Optional token type to select what type of token to return. + *+ * + *
+ * .google.cloud.confidentialcomputing.v1.TokenType token_type = 3 [(.google.api.field_behavior) = OPTIONAL];
+ *
+ *
+ * @return The enum numeric value on the wire for tokenType.
+ */
+ @java.lang.Override
+ public int getTokenTypeValue() {
+ return tokenType_;
+ }
+ /**
+ *
+ *
+ * + * Optional. Optional token type to select what type of token to return. + *+ * + *
+ * .google.cloud.confidentialcomputing.v1.TokenType token_type = 3 [(.google.api.field_behavior) = OPTIONAL];
+ *
+ *
+ * @param value The enum numeric value on the wire for tokenType to set.
+ * @return This builder for chaining.
+ */
+ public Builder setTokenTypeValue(int value) {
+ tokenType_ = value;
+ bitField0_ |= 0x00000004;
+ onChanged();
+ return this;
+ }
+ /**
+ *
+ *
+ * + * Optional. Optional token type to select what type of token to return. + *+ * + *
+ * .google.cloud.confidentialcomputing.v1.TokenType token_type = 3 [(.google.api.field_behavior) = OPTIONAL];
+ *
+ *
+ * @return The tokenType.
+ */
+ @java.lang.Override
+ public com.google.cloud.confidentialcomputing.v1.TokenType getTokenType() {
+ com.google.cloud.confidentialcomputing.v1.TokenType result =
+ com.google.cloud.confidentialcomputing.v1.TokenType.forNumber(tokenType_);
+ return result == null
+ ? com.google.cloud.confidentialcomputing.v1.TokenType.UNRECOGNIZED
+ : result;
+ }
+ /**
+ *
+ *
+ * + * Optional. Optional token type to select what type of token to return. + *+ * + *
+ * .google.cloud.confidentialcomputing.v1.TokenType token_type = 3 [(.google.api.field_behavior) = OPTIONAL];
+ *
+ *
+ * @param value The tokenType to set.
+ * @return This builder for chaining.
+ */
+ public Builder setTokenType(com.google.cloud.confidentialcomputing.v1.TokenType value) {
+ if (value == null) {
+ throw new NullPointerException();
+ }
+ bitField0_ |= 0x00000004;
+ tokenType_ = value.getNumber();
+ onChanged();
+ return this;
+ }
+ /**
+ *
+ *
+ * + * Optional. Optional token type to select what type of token to return. + *+ * + *
+ * .google.cloud.confidentialcomputing.v1.TokenType token_type = 3 [(.google.api.field_behavior) = OPTIONAL];
+ *
+ *
+ * @return This builder for chaining.
+ */
+ public Builder clearTokenType() {
+ bitField0_ = (bitField0_ & ~0x00000004);
+ tokenType_ = 0;
+ onChanged();
+ return this;
+ }
+
@java.lang.Override
public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) {
return super.setUnknownFields(unknownFields);
diff --git a/java-confidentialcomputing/proto-google-cloud-confidentialcomputing-v1/src/main/java/com/google/cloud/confidentialcomputing/v1/TokenOptionsOrBuilder.java b/java-confidentialcomputing/proto-google-cloud-confidentialcomputing-v1/src/main/java/com/google/cloud/confidentialcomputing/v1/TokenOptionsOrBuilder.java
index f20c180eb0de..6af65341261d 100644
--- a/java-confidentialcomputing/proto-google-cloud-confidentialcomputing-v1/src/main/java/com/google/cloud/confidentialcomputing/v1/TokenOptionsOrBuilder.java
+++ b/java-confidentialcomputing/proto-google-cloud-confidentialcomputing-v1/src/main/java/com/google/cloud/confidentialcomputing/v1/TokenOptionsOrBuilder.java
@@ -108,4 +108,33 @@ public interface TokenOptionsOrBuilder
* @return The bytes of the nonce at the given index.
*/
com.google.protobuf.ByteString getNonceBytes(int index);
+
+ /**
+ *
+ *
+ * + * Optional. Optional token type to select what type of token to return. + *+ * + *
+ * .google.cloud.confidentialcomputing.v1.TokenType token_type = 3 [(.google.api.field_behavior) = OPTIONAL];
+ *
+ *
+ * @return The enum numeric value on the wire for tokenType.
+ */
+ int getTokenTypeValue();
+ /**
+ *
+ *
+ * + * Optional. Optional token type to select what type of token to return. + *+ * + *
+ * .google.cloud.confidentialcomputing.v1.TokenType token_type = 3 [(.google.api.field_behavior) = OPTIONAL];
+ *
+ *
+ * @return The tokenType.
+ */
+ com.google.cloud.confidentialcomputing.v1.TokenType getTokenType();
}
diff --git a/java-confidentialcomputing/proto-google-cloud-confidentialcomputing-v1/src/main/java/com/google/cloud/confidentialcomputing/v1/TokenType.java b/java-confidentialcomputing/proto-google-cloud-confidentialcomputing-v1/src/main/java/com/google/cloud/confidentialcomputing/v1/TokenType.java
new file mode 100644
index 000000000000..3aaa550c3f33
--- /dev/null
+++ b/java-confidentialcomputing/proto-google-cloud-confidentialcomputing-v1/src/main/java/com/google/cloud/confidentialcomputing/v1/TokenType.java
@@ -0,0 +1,157 @@
+/*
+ * Copyright 2023 Google LLC
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+// Generated by the protocol buffer compiler. DO NOT EDIT!
+// source: google/cloud/confidentialcomputing/v1/service.proto
+
+package com.google.cloud.confidentialcomputing.v1;
+
+/**
+ *
+ *
+ * + * Token type enum contains the different types of token responses Confidential + * Space supports + *+ * + * Protobuf enum {@code google.cloud.confidentialcomputing.v1.TokenType} + */ +public enum TokenType implements com.google.protobuf.ProtocolMessageEnum { + /** + * + * + *
+ * Unspecified token type + *+ * + *
TOKEN_TYPE_UNSPECIFIED = 0;
+ */
+ TOKEN_TYPE_UNSPECIFIED(0),
+ /**
+ *
+ *
+ * + * OpenID Connect (OIDC) token type + *+ * + *
TOKEN_TYPE_OIDC = 1;
+ */
+ TOKEN_TYPE_OIDC(1),
+ UNRECOGNIZED(-1),
+ ;
+
+ /**
+ *
+ *
+ * + * Unspecified token type + *+ * + *
TOKEN_TYPE_UNSPECIFIED = 0;
+ */
+ public static final int TOKEN_TYPE_UNSPECIFIED_VALUE = 0;
+ /**
+ *
+ *
+ * + * OpenID Connect (OIDC) token type + *+ * + *
TOKEN_TYPE_OIDC = 1;
+ */
+ public static final int TOKEN_TYPE_OIDC_VALUE = 1;
+
+ public final int getNumber() {
+ if (this == UNRECOGNIZED) {
+ throw new java.lang.IllegalArgumentException(
+ "Can't get the number of an unknown enum value.");
+ }
+ return value;
+ }
+
+ /**
+ * @param value The numeric wire value of the corresponding enum entry.
+ * @return The enum associated with the given numeric wire value.
+ * @deprecated Use {@link #forNumber(int)} instead.
+ */
+ @java.lang.Deprecated
+ public static TokenType valueOf(int value) {
+ return forNumber(value);
+ }
+
+ /**
+ * @param value The numeric wire value of the corresponding enum entry.
+ * @return The enum associated with the given numeric wire value.
+ */
+ public static TokenType forNumber(int value) {
+ switch (value) {
+ case 0:
+ return TOKEN_TYPE_UNSPECIFIED;
+ case 1:
+ return TOKEN_TYPE_OIDC;
+ default:
+ return null;
+ }
+ }
+
+ public static com.google.protobuf.Internal.EnumLiteMap