Skip to content
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 @@ -18,6 +18,7 @@
# source: google/identity/accesscontextmanager/type/device_resources.proto
# Protobuf Python Version: 4.25.3
"""Generated protocol buffer code."""

from google.protobuf import descriptor as _descriptor
from google.protobuf import descriptor_pool as _descriptor_pool
from google.protobuf import symbol_database as _symbol_database
Expand Down

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,13 @@ from google.api import field_behavior_pb2 as _field_behavior_pb2
from google.api import resource_pb2 as _resource_pb2
from google.iam.v1 import iam_policy_pb2 as _iam_policy_pb2
from google.iam.v1 import policy_pb2 as _policy_pb2
from google.longrunning import operations_pb2 as _operations_pb2
from google.protobuf import descriptor as _descriptor
from google.protobuf import field_mask_pb2 as _field_mask_pb2
from google.protobuf import message as _message
from google.protobuf.internal import containers as _containers
from google.protobuf.internal import enum_type_wrapper as _enum_type_wrapper

from google.identity.accesscontextmanager.v1 import (
access_level_pb2 as _access_level_pb2,
)
Expand All @@ -36,12 +43,6 @@ from google.identity.accesscontextmanager.v1 import (
from google.identity.accesscontextmanager.v1 import (
service_perimeter_pb2 as _service_perimeter_pb2,
)
from google.longrunning import operations_pb2 as _operations_pb2
from google.protobuf import descriptor as _descriptor
from google.protobuf import field_mask_pb2 as _field_mask_pb2
from google.protobuf import message as _message
from google.protobuf.internal import containers as _containers
from google.protobuf.internal import enum_type_wrapper as _enum_type_wrapper

DESCRIPTOR: _descriptor.FileDescriptor

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
# source: google/identity/accesscontextmanager/v1/access_level.proto
# Protobuf Python Version: 4.25.3
"""Generated protocol buffer code."""

from google.protobuf import descriptor as _descriptor
from google.protobuf import descriptor_pool as _descriptor_pool
from google.protobuf import symbol_database as _symbol_database
Expand All @@ -29,11 +30,12 @@


from google.api import resource_pb2 as google_dot_api_dot_resource__pb2
from google.protobuf import timestamp_pb2 as google_dot_protobuf_dot_timestamp__pb2
from google.type import expr_pb2 as google_dot_type_dot_expr__pb2

from google.identity.accesscontextmanager.type import (
device_resources_pb2 as google_dot_identity_dot_accesscontextmanager_dot_type_dot_device__resources__pb2,
)
from google.protobuf import timestamp_pb2 as google_dot_protobuf_dot_timestamp__pb2
from google.type import expr_pb2 as google_dot_type_dot_expr__pb2

DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(
b'\n:google/identity/accesscontextmanager/v1/access_level.proto\x12\'google.identity.accesscontextmanager.v1\x1a\x19google/api/resource.proto\x1a@google/identity/accesscontextmanager/type/device_resources.proto\x1a\x1fgoogle/protobuf/timestamp.proto\x1a\x16google/type/expr.proto"\xaa\x03\n\x0b\x41\x63\x63\x65ssLevel\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\r\n\x05title\x18\x02 \x01(\t\x12\x13\n\x0b\x64\x65scription\x18\x03 \x01(\t\x12\x44\n\x05\x62\x61sic\x18\x04 \x01(\x0b\x32\x33.google.identity.accesscontextmanager.v1.BasicLevelH\x00\x12\x46\n\x06\x63ustom\x18\x05 \x01(\x0b\x32\x34.google.identity.accesscontextmanager.v1.CustomLevelH\x00\x12/\n\x0b\x63reate_time\x18\x06 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12/\n\x0bupdate_time\x18\x07 \x01(\x0b\x32\x1a.google.protobuf.Timestamp:p\xea\x41m\n/accesscontextmanager.googleapis.com/AccessLevel\x12:accessPolicies/{access_policy}/accessLevels/{access_level}B\x07\n\x05level"\xef\x01\n\nBasicLevel\x12\x46\n\nconditions\x18\x01 \x03(\x0b\x32\x32.google.identity.accesscontextmanager.v1.Condition\x12j\n\x12\x63ombining_function\x18\x02 \x01(\x0e\x32N.google.identity.accesscontextmanager.v1.BasicLevel.ConditionCombiningFunction"-\n\x1a\x43onditionCombiningFunction\x12\x07\n\x03\x41ND\x10\x00\x12\x06\n\x02OR\x10\x01"\xc3\x01\n\tCondition\x12\x16\n\x0eip_subnetworks\x18\x01 \x03(\t\x12L\n\rdevice_policy\x18\x02 \x01(\x0b\x32\x35.google.identity.accesscontextmanager.v1.DevicePolicy\x12\x1e\n\x16required_access_levels\x18\x03 \x03(\t\x12\x0e\n\x06negate\x18\x05 \x01(\x08\x12\x0f\n\x07members\x18\x06 \x03(\t\x12\x0f\n\x07regions\x18\x07 \x03(\t".\n\x0b\x43ustomLevel\x12\x1f\n\x04\x65xpr\x18\x01 \x01(\x0b\x32\x11.google.type.Expr"\x89\x03\n\x0c\x44\x65vicePolicy\x12\x1a\n\x12require_screenlock\x18\x01 \x01(\x08\x12\x66\n\x1b\x61llowed_encryption_statuses\x18\x02 \x03(\x0e\x32\x41.google.identity.accesscontextmanager.type.DeviceEncryptionStatus\x12M\n\x0eos_constraints\x18\x03 \x03(\x0b\x32\x35.google.identity.accesscontextmanager.v1.OsConstraint\x12j\n allowed_device_management_levels\x18\x06 \x03(\x0e\x32@.google.identity.accesscontextmanager.type.DeviceManagementLevel\x12\x1e\n\x16require_admin_approval\x18\x07 \x01(\x08\x12\x1a\n\x12require_corp_owned\x18\x08 \x01(\x08"\x8f\x01\n\x0cOsConstraint\x12\x42\n\x07os_type\x18\x01 \x01(\x0e\x32\x31.google.identity.accesscontextmanager.type.OsType\x12\x17\n\x0fminimum_version\x18\x02 \x01(\t\x12"\n\x1arequire_verified_chrome_os\x18\x03 \x01(\x08\x42\xa7\x02\n+com.google.identity.accesscontextmanager.v1B\x10\x41\x63\x63\x65ssLevelProtoP\x01Z\\cloud.google.com/go/accesscontextmanager/apiv1/accesscontextmanagerpb;accesscontextmanagerpb\xa2\x02\x04GACM\xaa\x02\'Google.Identity.AccessContextManager.V1\xca\x02\'Google\\Identity\\AccessContextManager\\V1\xea\x02*Google::Identity::AccessContextManager::V1b\x06proto3'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,16 +19,17 @@ from typing import Optional as _Optional
from typing import Union as _Union

from google.api import resource_pb2 as _resource_pb2
from google.identity.accesscontextmanager.type import (
device_resources_pb2 as _device_resources_pb2,
)
from google.protobuf import descriptor as _descriptor
from google.protobuf import message as _message
from google.protobuf import timestamp_pb2 as _timestamp_pb2
from google.protobuf.internal import containers as _containers
from google.protobuf.internal import enum_type_wrapper as _enum_type_wrapper
from google.type import expr_pb2 as _expr_pb2

from google.identity.accesscontextmanager.type import (
device_resources_pb2 as _device_resources_pb2,
)

DESCRIPTOR: _descriptor.FileDescriptor

class AccessLevel(_message.Message):
Expand Down Expand Up @@ -73,6 +74,7 @@ class BasicLevel(_message.Message):
__slots__ = ()
AND: _ClassVar[BasicLevel.ConditionCombiningFunction]
OR: _ClassVar[BasicLevel.ConditionCombiningFunction]

AND: BasicLevel.ConditionCombiningFunction
OR: BasicLevel.ConditionCombiningFunction
CONDITIONS_FIELD_NUMBER: _ClassVar[int]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
# source: google/identity/accesscontextmanager/v1/access_policy.proto
# Protobuf Python Version: 4.25.3
"""Generated protocol buffer code."""

from google.protobuf import descriptor as _descriptor
from google.protobuf import descriptor_pool as _descriptor_pool
from google.protobuf import symbol_database as _symbol_database
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
# source: google/identity/accesscontextmanager/v1/gcp_user_access_binding.proto
# Protobuf Python Version: 4.25.3
"""Generated protocol buffer code."""

from google.protobuf import descriptor as _descriptor
from google.protobuf import descriptor_pool as _descriptor_pool
from google.protobuf import symbol_database as _symbol_database
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
# source: google/identity/accesscontextmanager/v1/service_perimeter.proto
# Protobuf Python Version: 4.25.3
"""Generated protocol buffer code."""

from google.protobuf import descriptor as _descriptor
from google.protobuf import descriptor_pool as _descriptor_pool
from google.protobuf import symbol_database as _symbol_database
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ class ServicePerimeter(_message.Message):
__slots__ = ()
PERIMETER_TYPE_REGULAR: _ClassVar[ServicePerimeter.PerimeterType]
PERIMETER_TYPE_BRIDGE: _ClassVar[ServicePerimeter.PerimeterType]

PERIMETER_TYPE_REGULAR: ServicePerimeter.PerimeterType
PERIMETER_TYPE_BRIDGE: ServicePerimeter.PerimeterType
NAME_FIELD_NUMBER: _ClassVar[int]
Expand Down Expand Up @@ -93,6 +94,7 @@ class ServicePerimeterConfig(_message.Message):
ANY_IDENTITY: _ClassVar[ServicePerimeterConfig.IdentityType]
ANY_USER_ACCOUNT: _ClassVar[ServicePerimeterConfig.IdentityType]
ANY_SERVICE_ACCOUNT: _ClassVar[ServicePerimeterConfig.IdentityType]

IDENTITY_TYPE_UNSPECIFIED: ServicePerimeterConfig.IdentityType
ANY_IDENTITY: ServicePerimeterConfig.IdentityType
ANY_USER_ACCOUNT: ServicePerimeterConfig.IdentityType
Expand Down Expand Up @@ -247,6 +249,7 @@ class ServicePerimeterConfig(_message.Message):
_Union[ServicePerimeterConfig.EgressTo, _Mapping]
] = ...,
) -> None: ...

RESOURCES_FIELD_NUMBER: _ClassVar[int]
ACCESS_LEVELS_FIELD_NUMBER: _ClassVar[int]
RESTRICTED_SERVICES_FIELD_NUMBER: _ClassVar[int]
Expand Down
56 changes: 40 additions & 16 deletions packages/google-cloud-access-context-manager/noxfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,12 @@
import pathlib
import re
import shutil
from typing import Dict, List
import warnings
from typing import Dict, List

import nox

BLACK_VERSION = "black[jupyter]==23.7.0"
ISORT_VERSION = "isort==5.11.0"
RUFF_VERSION = "ruff==0.14.14"

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

Expand Down Expand Up @@ -102,10 +101,15 @@ def lint(session):
Returns a failure if the linters find linting errors or sufficiently
serious code quality issues.
"""
session.install("flake8", BLACK_VERSION)
session.install("flake8", RUFF_VERSION)

# Check formatting
session.run(
"black",
"ruff",
"format",
"--check",
f"--target-version=py{UNIT_TEST_PYTHON_VERSIONS[0].replace('.', '')}",
"--line-length=88",
*LINT_PATHS,
)

Expand All @@ -114,30 +118,50 @@ def lint(session):

@nox.session(python=DEFAULT_PYTHON_VERSION)
def blacken(session):
"""Run black. Format code to uniform standard."""
session.install(BLACK_VERSION)
"""(Deprecated) Legacy session. Please use 'nox -s format'."""
session.log(
"WARNING: The 'blacken' session is deprecated and will be removed in a future release. Please use 'nox -s format' in the future."
)

# Just run the ruff formatter (keeping legacy behavior of only formatting, not sorting imports)
session.install(RUFF_VERSION)
session.run(
"black",
"ruff",
"format",
f"--target-version=py{UNIT_TEST_PYTHON_VERSIONS[0].replace('.', '')}",
"--line-length=88",
*LINT_PATHS,
)


@nox.session(python=DEFAULT_PYTHON_VERSION)
def format(session):
"""
Run isort to sort imports. Then run black
to format code to uniform standard.
Run ruff to sort imports and format code.
"""
session.install(BLACK_VERSION, ISORT_VERSION)
# Use the --fss option to sort imports using strict alphabetical order.
# See https://pycqa.github.io/isort/docs/configuration/options.html#force-sort-within-sections
# 1. Install ruff (skipped automatically if you run with --no-venv)
session.install(RUFF_VERSION)

# 2. Run Ruff to fix imports
# check --select I: Enables strict import sorting
# --fix: Applies the changes automatically
session.run(
"isort",
"--fss",
"ruff",
"check",
"--select",
"I",
"--fix",
f"--target-version=py{UNIT_TEST_PYTHON_VERSIONS[0].replace('.', '')}",
"--line-length=88", # Standard Black line length
*LINT_PATHS,
)

# 3. Run Ruff to format code
session.run(
"black",
"ruff",
"format",
f"--target-version=py{UNIT_TEST_PYTHON_VERSIONS[0].replace('.', '')}",
"--line-length=88", # Standard Black line length
*LINT_PATHS,
)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
# source: google/cloud/audit/audit_log.proto
# Protobuf Python Version: 4.25.3
"""Generated protocol buffer code."""

from google.protobuf import descriptor as _descriptor
from google.protobuf import descriptor_pool as _descriptor_pool
from google.protobuf import symbol_database as _symbol_database
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,7 @@ class AuthorizationInfo(_message.Message):
ADMIN_WRITE: _ClassVar[AuthorizationInfo.PermissionType]
DATA_READ: _ClassVar[AuthorizationInfo.PermissionType]
DATA_WRITE: _ClassVar[AuthorizationInfo.PermissionType]

PERMISSION_TYPE_UNSPECIFIED: AuthorizationInfo.PermissionType
ADMIN_READ: AuthorizationInfo.PermissionType
ADMIN_WRITE: AuthorizationInfo.PermissionType
Expand Down Expand Up @@ -242,6 +243,7 @@ class ServiceAccountDelegationInfo(_message.Message):
self,
third_party_claims: _Optional[_Union[_struct_pb2.Struct, _Mapping]] = ...,
) -> None: ...

PRINCIPAL_SUBJECT_FIELD_NUMBER: _ClassVar[int]
FIRST_PARTY_PRINCIPAL_FIELD_NUMBER: _ClassVar[int]
THIRD_PARTY_PRINCIPAL_FIELD_NUMBER: _ClassVar[int]
Expand Down Expand Up @@ -282,6 +284,7 @@ class OrgPolicyViolationInfo(_message.Message):
def __init__(
self, key: _Optional[str] = ..., value: _Optional[str] = ...
) -> None: ...

PAYLOAD_FIELD_NUMBER: _ClassVar[int]
RESOURCE_TYPE_FIELD_NUMBER: _ClassVar[int]
RESOURCE_TAGS_FIELD_NUMBER: _ClassVar[int]
Expand All @@ -307,6 +310,7 @@ class ViolationInfo(_message.Message):
BOOLEAN_CONSTRAINT: _ClassVar[ViolationInfo.PolicyType]
LIST_CONSTRAINT: _ClassVar[ViolationInfo.PolicyType]
CUSTOM_CONSTRAINT: _ClassVar[ViolationInfo.PolicyType]

POLICY_TYPE_UNSPECIFIED: ViolationInfo.PolicyType
BOOLEAN_CONSTRAINT: ViolationInfo.PolicyType
LIST_CONSTRAINT: ViolationInfo.PolicyType
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
# source: google/cloud/audit/bigquery_audit_metadata.proto
# Protobuf Python Version: 4.25.3
"""Generated protocol buffer code."""

from google.protobuf import descriptor as _descriptor
from google.protobuf import descriptor_pool as _descriptor_pool
from google.protobuf import symbol_database as _symbol_database
Expand Down
Loading
Loading