Skip to content
This repository was archived by the owner on Oct 31, 2023. It is now read-only.

Commit 27c4e7c

Browse files
docs: Add documentation for enums (#198)
* docs: Add documentation for enums fix: Add context manager return types chore: Update gapic-generator-python to v1.8.1 PiperOrigin-RevId: 503210727 Source-Link: googleapis/googleapis@a391fd1 Source-Link: https://github.com/googleapis/googleapis-gen/commit/0080f830dec37c3384157082bce279e37079ea58 Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiMDA4MGY4MzBkZWMzN2MzMzg0MTU3MDgyYmNlMjc5ZTM3MDc5ZWE1OCJ9 * 🦉 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 55dbc3b commit 27c4e7c

File tree

11 files changed

+184
-14
lines changed

11 files changed

+184
-14
lines changed

google/cloud/binaryauthorization_v1/services/binauthz_management_service_v1/client.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1277,7 +1277,7 @@ def sample_delete_attestor():
12771277
metadata=metadata,
12781278
)
12791279

1280-
def __enter__(self):
1280+
def __enter__(self) -> "BinauthzManagementServiceV1Client":
12811281
return self
12821282

12831283
def __exit__(self, type, value, traceback):

google/cloud/binaryauthorization_v1/services/system_policy_v1/client.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -539,7 +539,7 @@ def sample_get_system_policy():
539539
# Done; return the response.
540540
return response
541541

542-
def __enter__(self):
542+
def __enter__(self) -> "SystemPolicyV1Client":
543543
return self
544544

545545
def __exit__(self, type, value, traceback):

google/cloud/binaryauthorization_v1/services/validation_helper_v1/client.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -506,7 +506,7 @@ def sample_validate_attestation_occurrence():
506506
# Done; return the response.
507507
return response
508508

509-
def __enter__(self):
509+
def __enter__(self) -> "ValidationHelperV1Client":
510510
return self
511511

512512
def __exit__(self, type, value, traceback):

google/cloud/binaryauthorization_v1/types/resources.py

+73-2
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,16 @@ class Policy(proto.Message):
8989
"""
9090

9191
class GlobalPolicyEvaluationMode(proto.Enum):
92-
r""""""
92+
r"""
93+
94+
Values:
95+
GLOBAL_POLICY_EVALUATION_MODE_UNSPECIFIED (0):
96+
Not specified: DISABLE is assumed.
97+
ENABLE (1):
98+
Enables system policy evaluation.
99+
DISABLE (2):
100+
Disables system policy evaluation.
101+
"""
93102
GLOBAL_POLICY_EVALUATION_MODE_UNSPECIFIED = 0
94103
ENABLE = 1
95104
DISABLE = 2
@@ -212,7 +221,20 @@ class AdmissionRule(proto.Message):
212221
"""
213222

214223
class EvaluationMode(proto.Enum):
215-
r""""""
224+
r"""
225+
226+
Values:
227+
EVALUATION_MODE_UNSPECIFIED (0):
228+
Do not use.
229+
ALWAYS_ALLOW (1):
230+
This rule allows all all pod creations.
231+
REQUIRE_ATTESTATION (2):
232+
This rule allows a pod creation if all the attestors listed
233+
in 'require_attestations_by' have valid attestations for all
234+
of the images in the pod spec.
235+
ALWAYS_DENY (3):
236+
This rule denies all pod creations.
237+
"""
216238
EVALUATION_MODE_UNSPECIFIED = 0
217239
ALWAYS_ALLOW = 1
218240
REQUIRE_ATTESTATION = 2
@@ -221,6 +243,17 @@ class EvaluationMode(proto.Enum):
221243
class EnforcementMode(proto.Enum):
222244
r"""Defines the possible actions when a pod creation is denied by
223245
an admission rule.
246+
247+
Values:
248+
ENFORCEMENT_MODE_UNSPECIFIED (0):
249+
Do not use.
250+
ENFORCED_BLOCK_AND_AUDIT_LOG (1):
251+
Enforce the admission rule by blocking the
252+
pod creation.
253+
DRYRUN_AUDIT_LOG_ONLY (2):
254+
Dryrun mode: Audit logging only. This will
255+
allow the pod creation as if the admission
256+
request had specified break-glass.
224257
"""
225258
ENFORCEMENT_MODE_UNSPECIFIED = 0
226259
ENFORCED_BLOCK_AND_AUDIT_LOG = 1
@@ -372,6 +405,44 @@ class SignatureAlgorithm(proto.Enum):
372405
algorithms. See https://cloud.google.com/kms/docs/algorithms. In
373406
the future, BinAuthz might support additional public key types
374407
independently of Tink and/or KMS.
408+
409+
Values:
410+
SIGNATURE_ALGORITHM_UNSPECIFIED (0):
411+
Not specified.
412+
RSA_PSS_2048_SHA256 (1):
413+
RSASSA-PSS 2048 bit key with a SHA256 digest.
414+
RSA_PSS_3072_SHA256 (2):
415+
RSASSA-PSS 3072 bit key with a SHA256 digest.
416+
RSA_PSS_4096_SHA256 (3):
417+
RSASSA-PSS 4096 bit key with a SHA256 digest.
418+
RSA_PSS_4096_SHA512 (4):
419+
RSASSA-PSS 4096 bit key with a SHA512 digest.
420+
RSA_SIGN_PKCS1_2048_SHA256 (5):
421+
RSASSA-PKCS1-v1_5 with a 2048 bit key and a SHA256 digest.
422+
RSA_SIGN_PKCS1_3072_SHA256 (6):
423+
RSASSA-PKCS1-v1_5 with a 3072 bit key and a SHA256 digest.
424+
RSA_SIGN_PKCS1_4096_SHA256 (7):
425+
RSASSA-PKCS1-v1_5 with a 4096 bit key and a SHA256 digest.
426+
RSA_SIGN_PKCS1_4096_SHA512 (8):
427+
RSASSA-PKCS1-v1_5 with a 4096 bit key and a SHA512 digest.
428+
ECDSA_P256_SHA256 (9):
429+
ECDSA on the NIST P-256 curve with a SHA256
430+
digest.
431+
EC_SIGN_P256_SHA256 (9):
432+
ECDSA on the NIST P-256 curve with a SHA256
433+
digest.
434+
ECDSA_P384_SHA384 (10):
435+
ECDSA on the NIST P-384 curve with a SHA384
436+
digest.
437+
EC_SIGN_P384_SHA384 (10):
438+
ECDSA on the NIST P-384 curve with a SHA384
439+
digest.
440+
ECDSA_P521_SHA512 (11):
441+
ECDSA on the NIST P-521 curve with a SHA512
442+
digest.
443+
EC_SIGN_P521_SHA512 (11):
444+
ECDSA on the NIST P-521 curve with a SHA512
445+
digest.
375446
"""
376447
_pb_options = {"allow_alias": True}
377448
SIGNATURE_ALGORITHM_UNSPECIFIED = 0

google/cloud/binaryauthorization_v1/types/service.py

+12-1
Original file line numberDiff line numberDiff line change
@@ -300,7 +300,18 @@ class ValidateAttestationOccurrenceResponse(proto.Message):
300300
"""
301301

302302
class Result(proto.Enum):
303-
r"""The enum returned in the "result" field."""
303+
r"""The enum returned in the "result" field.
304+
305+
Values:
306+
RESULT_UNSPECIFIED (0):
307+
Unspecified.
308+
VERIFIED (1):
309+
The Attestation was able to verified by the
310+
Attestor.
311+
ATTESTATION_NOT_VERIFIABLE (2):
312+
The Attestation was not able to verified by
313+
the Attestor.
314+
"""
304315
RESULT_UNSPECIFIED = 0
305316
VERIFIED = 1
306317
ATTESTATION_NOT_VERIFIABLE = 2

google/cloud/binaryauthorization_v1beta1/services/binauthz_management_service_v1_beta1/client.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1290,7 +1290,7 @@ def sample_delete_attestor():
12901290
metadata=metadata,
12911291
)
12921292

1293-
def __enter__(self):
1293+
def __enter__(self) -> "BinauthzManagementServiceV1Beta1Client":
12941294
return self
12951295

12961296
def __exit__(self, type, value, traceback):

google/cloud/binaryauthorization_v1beta1/services/system_policy_v1_beta1/client.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -540,7 +540,7 @@ def sample_get_system_policy():
540540
# Done; return the response.
541541
return response
542542

543-
def __enter__(self):
543+
def __enter__(self) -> "SystemPolicyV1Beta1Client":
544544
return self
545545

546546
def __exit__(self, type, value, traceback):

google/cloud/binaryauthorization_v1beta1/types/continuous_validation_logging.py

+19-2
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,15 @@ class ContinuousValidationPodEvent(proto.Message):
6767
"""
6868

6969
class PolicyConformanceVerdict(proto.Enum):
70-
r"""Audit time policy conformance verdict."""
70+
r"""Audit time policy conformance verdict.
71+
72+
Values:
73+
POLICY_CONFORMANCE_VERDICT_UNSPECIFIED (0):
74+
We should always have a verdict. This is an
75+
error.
76+
VIOLATES_POLICY (1):
77+
The pod violates the policy.
78+
"""
7179
POLICY_CONFORMANCE_VERDICT_UNSPECIFIED = 0
7280
VIOLATES_POLICY = 1
7381

@@ -84,7 +92,16 @@ class ImageDetails(proto.Message):
8492
"""
8593

8694
class AuditResult(proto.Enum):
87-
r"""Result of the audit."""
95+
r"""Result of the audit.
96+
97+
Values:
98+
AUDIT_RESULT_UNSPECIFIED (0):
99+
Unspecified result. This is an error.
100+
ALLOW (1):
101+
Image is allowed.
102+
DENY (2):
103+
Image is denied.
104+
"""
88105
AUDIT_RESULT_UNSPECIFIED = 0
89106
ALLOW = 1
90107
DENY = 2

google/cloud/binaryauthorization_v1beta1/types/resources.py

+73-2
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,16 @@ class Policy(proto.Message):
8888
"""
8989

9090
class GlobalPolicyEvaluationMode(proto.Enum):
91-
r""""""
91+
r"""
92+
93+
Values:
94+
GLOBAL_POLICY_EVALUATION_MODE_UNSPECIFIED (0):
95+
Not specified: DISABLE is assumed.
96+
ENABLE (1):
97+
Enables system policy evaluation.
98+
DISABLE (2):
99+
Disables system policy evaluation.
100+
"""
92101
GLOBAL_POLICY_EVALUATION_MODE_UNSPECIFIED = 0
93102
ENABLE = 1
94103
DISABLE = 2
@@ -214,7 +223,20 @@ class AdmissionRule(proto.Message):
214223
"""
215224

216225
class EvaluationMode(proto.Enum):
217-
r""""""
226+
r"""
227+
228+
Values:
229+
EVALUATION_MODE_UNSPECIFIED (0):
230+
Do not use.
231+
ALWAYS_ALLOW (1):
232+
This rule allows all all pod creations.
233+
REQUIRE_ATTESTATION (2):
234+
This rule allows a pod creation if all the attestors listed
235+
in ``require_attestations_by`` have valid attestations for
236+
all of the images in the pod spec.
237+
ALWAYS_DENY (3):
238+
This rule denies all pod creations.
239+
"""
218240
EVALUATION_MODE_UNSPECIFIED = 0
219241
ALWAYS_ALLOW = 1
220242
REQUIRE_ATTESTATION = 2
@@ -223,6 +245,17 @@ class EvaluationMode(proto.Enum):
223245
class EnforcementMode(proto.Enum):
224246
r"""Defines the possible actions when a pod creation is denied by
225247
an admission rule.
248+
249+
Values:
250+
ENFORCEMENT_MODE_UNSPECIFIED (0):
251+
Do not use.
252+
ENFORCED_BLOCK_AND_AUDIT_LOG (1):
253+
Enforce the admission rule by blocking the
254+
pod creation.
255+
DRYRUN_AUDIT_LOG_ONLY (2):
256+
Dryrun mode: Audit logging only. This will
257+
allow the pod creation as if the admission
258+
request had specified break-glass.
226259
"""
227260
ENFORCEMENT_MODE_UNSPECIFIED = 0
228261
ENFORCED_BLOCK_AND_AUDIT_LOG = 1
@@ -372,6 +405,44 @@ class SignatureAlgorithm(proto.Enum):
372405
algorithms. See https://cloud.google.com/kms/docs/algorithms. In
373406
the future, BinAuthz might support additional public key types
374407
independently of Tink and/or KMS.
408+
409+
Values:
410+
SIGNATURE_ALGORITHM_UNSPECIFIED (0):
411+
Not specified.
412+
RSA_PSS_2048_SHA256 (1):
413+
RSASSA-PSS 2048 bit key with a SHA256 digest.
414+
RSA_PSS_3072_SHA256 (2):
415+
RSASSA-PSS 3072 bit key with a SHA256 digest.
416+
RSA_PSS_4096_SHA256 (3):
417+
RSASSA-PSS 4096 bit key with a SHA256 digest.
418+
RSA_PSS_4096_SHA512 (4):
419+
RSASSA-PSS 4096 bit key with a SHA512 digest.
420+
RSA_SIGN_PKCS1_2048_SHA256 (5):
421+
RSASSA-PKCS1-v1_5 with a 2048 bit key and a SHA256 digest.
422+
RSA_SIGN_PKCS1_3072_SHA256 (6):
423+
RSASSA-PKCS1-v1_5 with a 3072 bit key and a SHA256 digest.
424+
RSA_SIGN_PKCS1_4096_SHA256 (7):
425+
RSASSA-PKCS1-v1_5 with a 4096 bit key and a SHA256 digest.
426+
RSA_SIGN_PKCS1_4096_SHA512 (8):
427+
RSASSA-PKCS1-v1_5 with a 4096 bit key and a SHA512 digest.
428+
ECDSA_P256_SHA256 (9):
429+
ECDSA on the NIST P-256 curve with a SHA256
430+
digest.
431+
EC_SIGN_P256_SHA256 (9):
432+
ECDSA on the NIST P-256 curve with a SHA256
433+
digest.
434+
ECDSA_P384_SHA384 (10):
435+
ECDSA on the NIST P-384 curve with a SHA384
436+
digest.
437+
EC_SIGN_P384_SHA384 (10):
438+
ECDSA on the NIST P-384 curve with a SHA384
439+
digest.
440+
ECDSA_P521_SHA512 (11):
441+
ECDSA on the NIST P-521 curve with a SHA512
442+
digest.
443+
EC_SIGN_P521_SHA512 (11):
444+
ECDSA on the NIST P-521 curve with a SHA512
445+
digest.
375446
"""
376447
_pb_options = {"allow_alias": True}
377448
SIGNATURE_ALGORITHM_UNSPECIFIED = 0

samples/generated_samples/snippet_metadata_google.cloud.binaryauthorization.v1.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
],
99
"language": "PYTHON",
1010
"name": "google-cloud-binary-authorization",
11-
"version": "1.5.0"
11+
"version": "0.1.0"
1212
},
1313
"snippets": [
1414
{

samples/generated_samples/snippet_metadata_google.cloud.binaryauthorization.v1beta1.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
],
99
"language": "PYTHON",
1010
"name": "google-cloud-binary-authorization",
11-
"version": "1.5.0"
11+
"version": "0.1.0"
1212
},
1313
"snippets": [
1414
{

0 commit comments

Comments
 (0)