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: [google-cloud-confidentialcomputing] Add a new field token_type to TokenOptions message proto #12011

Merged
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
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
SignedEntity,
SigningAlgorithm,
TokenOptions,
TokenType,
TpmAttestation,
VerifyAttestationRequest,
VerifyAttestationResponse,
Expand All @@ -52,4 +53,5 @@
"VerifyAttestationRequest",
"VerifyAttestationResponse",
"SigningAlgorithm",
"TokenType",
)
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
SignedEntity,
SigningAlgorithm,
TokenOptions,
TokenType,
TpmAttestation,
VerifyAttestationRequest,
VerifyAttestationResponse,
Expand All @@ -47,6 +48,7 @@
"SignedEntity",
"SigningAlgorithm",
"TokenOptions",
"TokenType",
"TpmAttestation",
"VerifyAttestationRequest",
"VerifyAttestationResponse",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
SignedEntity,
SigningAlgorithm,
TokenOptions,
TokenType,
TpmAttestation,
VerifyAttestationRequest,
VerifyAttestationResponse,
Expand All @@ -39,4 +40,5 @@
"VerifyAttestationRequest",
"VerifyAttestationResponse",
"SigningAlgorithm",
"TokenType",
)
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
package="google.cloud.confidentialcomputing.v1",
manifest={
"SigningAlgorithm",
"TokenType",
"Challenge",
"CreateChallengeRequest",
"VerifyAttestationRequest",
Expand Down Expand Up @@ -60,6 +61,20 @@ class SigningAlgorithm(proto.Enum):
ECDSA_P256_SHA256 = 3


class TokenType(proto.Enum):
r"""Token type enum contains the different types of token
responses Confidential Space supports

Values:
TOKEN_TYPE_UNSPECIFIED (0):
Unspecified token type
TOKEN_TYPE_OIDC (1):
OpenID Connect (OIDC) token type
"""
TOKEN_TYPE_UNSPECIFIED = 0
TOKEN_TYPE_OIDC = 1


class Challenge(proto.Message):
r"""A Challenge from the server used to guarantee freshness of
attestations
Expand Down Expand Up @@ -240,6 +255,9 @@ class TokenOptions(proto.Message):
the eat_nonce claim in the output token. The minimum size
for JSON-encoded EATs is 10 bytes and the maximum size is 74
bytes.
token_type (google.cloud.confidentialcomputing_v1.types.TokenType):
Optional. Optional token type to select what
type of token to return.
"""

audience: str = proto.Field(
Expand All @@ -250,6 +268,11 @@ class TokenOptions(proto.Message):
proto.STRING,
number=2,
)
token_type: "TokenType" = proto.Field(
proto.ENUM,
number=3,
enum="TokenType",
)


class TpmAttestation(proto.Message):
Expand Down
3 changes: 3 additions & 0 deletions packages/google-cloud-confidentialcomputing/noxfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,10 @@

BLACK_VERSION = "black[jupyter]==23.7.0"
ISORT_VERSION = "isort==5.11.0"

LINT_PATHS = ["docs", "google", "tests", "noxfile.py", "setup.py"]


DEFAULT_PYTHON_VERSION = "3.10"

UNIT_TEST_PYTHON_VERSIONS: List[str] = ["3.7", "3.8", "3.9", "3.10", "3.11"]
Expand Down Expand Up @@ -89,6 +91,7 @@ def lint(session):
"--check",
*LINT_PATHS,
)

session.run("flake8", "google", "tests")


Expand Down
Loading