Skip to content

Commit f8900f4

Browse files
feat: [google-cloud-confidentialcomputing] Add a token_type options proto to allow for customization of specific token types (googleapis#13299)
BEGIN_COMMIT_OVERRIDE feat: Add a token_type options proto to allow for customization of specific token types feat: Added the first token type option to hold principal tag token options END_COMMIT_OVERRIDE - [ ] Regenerate this pull request now. PiperOrigin-RevId: 700050491 Source-Link: googleapis/googleapis@5afbbeb Source-Link: https://github.com/googleapis/googleapis-gen/commit/856d7aed3fc290457da157473e91946e682ced7a Copy-Tag: eyJwIjoicGFja2FnZXMvZ29vZ2xlLWNsb3VkLWNvbmZpZGVudGlhbGNvbXB1dGluZy8uT3dsQm90LnlhbWwiLCJoIjoiODU2ZDdhZWQzZmMyOTA0NTdkYTE1NzQ3M2U5MTk0NmU2ODJjZWQ3YSJ9 --------- Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com>
1 parent 0dab0e7 commit f8900f4

File tree

4 files changed

+70
-3
lines changed

4 files changed

+70
-3
lines changed

packages/google-cloud-confidentialcomputing/google/cloud/confidentialcomputing/gapic_version.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,4 +13,4 @@
1313
# See the License for the specific language governing permissions and
1414
# limitations under the License.
1515
#
16-
__version__ = "0.4.13" # {x-release-please-version}
16+
__version__ = "0.0.0" # {x-release-please-version}

packages/google-cloud-confidentialcomputing/google/cloud/confidentialcomputing_v1/gapic_version.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,4 +13,4 @@
1313
# See the License for the specific language governing permissions and
1414
# limitations under the License.
1515
#
16-
__version__ = "0.4.13" # {x-release-please-version}
16+
__version__ = "0.0.0" # {x-release-please-version}

packages/google-cloud-confidentialcomputing/google/cloud/confidentialcomputing_v1/types/service.py

Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,11 +76,14 @@ class TokenType(proto.Enum):
7676
Public Key Infrastructure (PKI) token type
7777
TOKEN_TYPE_LIMITED_AWS (3):
7878
Limited claim token type for AWS integration
79+
TOKEN_TYPE_AWS_PRINCIPALTAGS (4):
80+
Principal-tag-based token for AWS integration
7981
"""
8082
TOKEN_TYPE_UNSPECIFIED = 0
8183
TOKEN_TYPE_OIDC = 1
8284
TOKEN_TYPE_PKI = 2
8385
TOKEN_TYPE_LIMITED_AWS = 3
86+
TOKEN_TYPE_AWS_PRINCIPALTAGS = 4
8487

8588

8689
class Challenge(proto.Message):
@@ -347,7 +350,15 @@ class TokenOptions(proto.Message):
347350
r"""Options to modify claims in the token to generate
348351
custom-purpose tokens.
349352
353+
354+
.. _oneof: https://proto-plus-python.readthedocs.io/en/stable/fields.html#oneofs-mutually-exclusive-fields
355+
350356
Attributes:
357+
aws_principal_tags_options (google.cloud.confidentialcomputing_v1.types.TokenOptions.AwsPrincipalTagsOptions):
358+
Optional. Options for the Limited AWS token
359+
type.
360+
361+
This field is a member of `oneof`_ ``token_type_options``.
351362
audience (str):
352363
Optional. Optional string to issue the token
353364
with a custom audience claim. Required if one or
@@ -362,6 +373,62 @@ class TokenOptions(proto.Message):
362373
type of token to return.
363374
"""
364375

376+
class AwsPrincipalTagsOptions(proto.Message):
377+
r"""Token options that only apply to the AWS Principal Tags token
378+
type.
379+
380+
Attributes:
381+
allowed_principal_tags (google.cloud.confidentialcomputing_v1.types.TokenOptions.AwsPrincipalTagsOptions.AllowedPrincipalTags):
382+
Optional. Principal tags to allow in the
383+
token.
384+
"""
385+
386+
class AllowedPrincipalTags(proto.Message):
387+
r"""Allowed principal tags is used to define what principal tags
388+
will be placed in the token.
389+
390+
Attributes:
391+
container_image_signatures (google.cloud.confidentialcomputing_v1.types.TokenOptions.AwsPrincipalTagsOptions.AllowedPrincipalTags.ContainerImageSignatures):
392+
Optional. Container image signatures allowed
393+
in the token.
394+
"""
395+
396+
class ContainerImageSignatures(proto.Message):
397+
r"""Allowed Container Image Signatures. Key IDs are required to
398+
allow this claim to fit within the narrow AWS IAM restrictions.
399+
400+
Attributes:
401+
key_ids (MutableSequence[str]):
402+
Optional. List of key ids to filter into the
403+
Principal tags. Only keys that have been
404+
validated and added to the token will be
405+
filtered into principal tags. Unrecognized key
406+
ids will be ignored.
407+
"""
408+
409+
key_ids: MutableSequence[str] = proto.RepeatedField(
410+
proto.STRING,
411+
number=1,
412+
)
413+
414+
container_image_signatures: "TokenOptions.AwsPrincipalTagsOptions.AllowedPrincipalTags.ContainerImageSignatures" = proto.Field(
415+
proto.MESSAGE,
416+
number=1,
417+
message="TokenOptions.AwsPrincipalTagsOptions.AllowedPrincipalTags.ContainerImageSignatures",
418+
)
419+
420+
allowed_principal_tags: "TokenOptions.AwsPrincipalTagsOptions.AllowedPrincipalTags" = proto.Field(
421+
proto.MESSAGE,
422+
number=1,
423+
message="TokenOptions.AwsPrincipalTagsOptions.AllowedPrincipalTags",
424+
)
425+
426+
aws_principal_tags_options: AwsPrincipalTagsOptions = proto.Field(
427+
proto.MESSAGE,
428+
number=4,
429+
oneof="token_type_options",
430+
message=AwsPrincipalTagsOptions,
431+
)
365432
audience: str = proto.Field(
366433
proto.STRING,
367434
number=1,

packages/google-cloud-confidentialcomputing/samples/generated_samples/snippet_metadata_google.cloud.confidentialcomputing.v1.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
],
99
"language": "PYTHON",
1010
"name": "google-cloud-confidentialcomputing",
11-
"version": "0.4.13"
11+
"version": "0.1.0"
1212
},
1313
"snippets": [
1414
{

0 commit comments

Comments
 (0)