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 @@ -100,7 +100,9 @@
OperationMetadata,
RebalanceConfig,
TaskRetryPolicy,
TlsConfig,
Topic,
TrustConfig,
)

__all__ = (
Expand Down Expand Up @@ -173,5 +175,7 @@
"OperationMetadata",
"RebalanceConfig",
"TaskRetryPolicy",
"TlsConfig",
"Topic",
"TrustConfig",
)
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,4 @@
# See the License for the specific language governing permissions and
# limitations under the License.
#
__version__ = "0.1.11" # {x-release-please-version}
__version__ = "0.0.0" # {x-release-please-version}
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,9 @@
OperationMetadata,
RebalanceConfig,
TaskRetryPolicy,
TlsConfig,
Topic,
TrustConfig,
)

__all__ = (
Expand Down Expand Up @@ -160,7 +162,9 @@
"StopConnectorRequest",
"StopConnectorResponse",
"TaskRetryPolicy",
"TlsConfig",
"Topic",
"TrustConfig",
"UpdateAclRequest",
"UpdateClusterRequest",
"UpdateConnectClusterRequest",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,4 @@
# See the License for the specific language governing permissions and
# limitations under the License.
#
__version__ = "0.1.11" # {x-release-please-version}
__version__ = "0.0.0" # {x-release-please-version}
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,8 @@ class ManagedKafkaAsyncClient:

acl_path = staticmethod(ManagedKafkaClient.acl_path)
parse_acl_path = staticmethod(ManagedKafkaClient.parse_acl_path)
ca_pool_path = staticmethod(ManagedKafkaClient.ca_pool_path)
parse_ca_pool_path = staticmethod(ManagedKafkaClient.parse_ca_pool_path)
cluster_path = staticmethod(ManagedKafkaClient.cluster_path)
parse_cluster_path = staticmethod(ManagedKafkaClient.parse_cluster_path)
consumer_group_path = staticmethod(ManagedKafkaClient.consumer_group_path)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -228,6 +228,28 @@ def parse_acl_path(path: str) -> Dict[str, str]:
)
return m.groupdict() if m else {}

@staticmethod
def ca_pool_path(
project: str,
location: str,
ca_pool: str,
) -> str:
"""Returns a fully-qualified ca_pool string."""
return "projects/{project}/locations/{location}/caPools/{ca_pool}".format(
project=project,
location=location,
ca_pool=ca_pool,
)

@staticmethod
def parse_ca_pool_path(path: str) -> Dict[str, str]:
"""Parses a ca_pool path into its component segments."""
m = re.match(
r"^projects/(?P<project>.+?)/locations/(?P<location>.+?)/caPools/(?P<ca_pool>.+?)$",
path,
)
return m.groupdict() if m else {}

@staticmethod
def cluster_path(
project: str,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,9 @@
OperationMetadata,
RebalanceConfig,
TaskRetryPolicy,
TlsConfig,
Topic,
TrustConfig,
)

__all__ = (
Expand Down Expand Up @@ -152,5 +154,7 @@
"OperationMetadata",
"RebalanceConfig",
"TaskRetryPolicy",
"TlsConfig",
"Topic",
"TrustConfig",
)
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@
"NetworkConfig",
"AccessConfig",
"GcpConfig",
"TlsConfig",
"TrustConfig",
"Topic",
"ConsumerTopicMetadata",
"ConsumerPartitionMetadata",
Expand Down Expand Up @@ -86,6 +88,9 @@ class Cluster(proto.Message):
Output only. Reserved for future use.

This field is a member of `oneof`_ ``_satisfies_pzs``.
tls_config (google.cloud.managedkafka_v1.types.TlsConfig):
Optional. TLS configuration for the Kafka
cluster.
"""

class State(proto.Enum):
Expand Down Expand Up @@ -156,6 +161,11 @@ class State(proto.Enum):
number=12,
optional=True,
)
tls_config: "TlsConfig" = proto.Field(
proto.MESSAGE,
number=13,
message="TlsConfig",
)


class CapacityConfig(proto.Message):
Expand Down Expand Up @@ -280,6 +290,75 @@ class GcpConfig(proto.Message):
)


class TlsConfig(proto.Message):
r"""The TLS configuration for the Kafka cluster.

Attributes:
trust_config (google.cloud.managedkafka_v1.types.TrustConfig):
Optional. The configuration of the broker
truststore. If specified, clients can use mTLS
for authentication.
ssl_principal_mapping_rules (str):
Optional. A list of rules for mapping from SSL principal
names to short names. These are applied in order by Kafka.
Refer to the Apache Kafka documentation for
``ssl.principal.mapping.rules`` for the precise formatting
details and syntax. Example:
"RULE:^CN=(.*?),OU=ServiceUsers.*\ $/$1@example.com/,DEFAULT"

This is a static Kafka broker configuration. Setting or
modifying this field will trigger a rolling restart of the
Kafka brokers to apply the change. An empty string means no
rules are applied (Kafka default).
"""

trust_config: "TrustConfig" = proto.Field(
proto.MESSAGE,
number=1,
message="TrustConfig",
)
ssl_principal_mapping_rules: str = proto.Field(
proto.STRING,
number=2,
)


class TrustConfig(proto.Message):
r"""Sources of CA certificates to install in the broker's
truststore.

Attributes:
cas_configs (MutableSequence[google.cloud.managedkafka_v1.types.TrustConfig.CertificateAuthorityServiceConfig]):
Optional. Configuration for the Google
Certificate Authority Service. Maximum 10.
"""

class CertificateAuthorityServiceConfig(proto.Message):
r"""A configuration for the Google Certificate Authority Service.

Attributes:
ca_pool (str):
Required. The name of the CA pool to pull CA certificates
from. Structured like:
projects/{project}/locations/{location}/caPools/{ca_pool}.
The CA pool does not need to be in the same project or
location as the Kafka cluster.
"""

ca_pool: str = proto.Field(
proto.STRING,
number=1,
)

cas_configs: MutableSequence[
CertificateAuthorityServiceConfig
] = proto.RepeatedField(
proto.MESSAGE,
number=1,
message=CertificateAuthorityServiceConfig,
)


class Topic(proto.Message):
r"""A Kafka topic in a given cluster.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
],
"language": "PYTHON",
"name": "google-cloud-managedkafka",
"version": "0.1.11"
"version": "0.1.0"
},
"snippets": [
{
Expand Down
Loading
Loading