googleapis / googleapis/google-cloud-python

Add ACL Policy controls to memorystore_v1 python client

未关闭
#17,447 1 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看
type: feature request
主要语言
Python
星标
5.4k
派生
1.8k
平均合并
3 天 4 小时
30 天内合并 PR
122

描述

### Determine this is the right repository

- [x] I determined this is the correct repository in which to report this feature request.

### Summary of the feature request

The `google-cloud-memorystore` Python client library (`v0.5.0`) does not expose any methods or types for managing ACL Policies on Memorystore instances. The full CRUD surface (`create`, `describe`, `list`, `update`, `delete`) is available in the `gcloud` CLI under `gcloud memorystore acl-policies`, but there are no corresponding methods on `MemorystoreClient` and no `AclPolicy` type in `google.cloud.memorystore_v1.types`. Users who want to manage ACL policies programmatically in Python are forced to fall back to either `subprocess` wrapping `gcloud` or raw REST calls via `google-auth` + `requests`.

### Desired code experience

```python
from google.cloud import memorystore_v1

client = memorystore_v1.MemorystoreClient()

parent = "projects/my-project/locations/us-central1/instances/my-instance"

# List ACL policies
for policy in client.list_acl_policies(parent=parent):
print(policy.name)

# Get a specific ACL policy
policy = client.get_acl_policy(
name=f"{parent}/aclPolicies/my-policy"
)

# Create an ACL policy
created = client.create_acl_policy(
parent=parent,
acl_policy_id="my-policy",
acl_policy=memorystore_v1.types.AclPolicy(
acl_entries=[...]
),
)

# Update an ACL policy
updated = client.update_acl_policy(acl_policy=policy, update_mask=...)

# Delete an ACL policy
client.delete_acl_policy(name=f"{parent}/aclPolicies/my-policy")
```

### Expected results

`MemorystoreClient` (and `MemorystoreAsyncClient`) should expose `list_acl_policies`, `get_acl_policy`, `create_acl_policy`, `update_acl_policy`, and `delete_acl_policy` methods, consistent with the full ACL policy surface available in the `gcloud memorystore acl-policies` CLI group. A corresponding `AclPolicy` type (and any related subtypes such as `AclEntry`) should be present in `google.cloud.memorystore_v1.types`.

### API client name and version

google-cloud-memorystore

### Use case

Managing granular, per-user access control on a shared Memorystore instance — specifically, allowing multiple users to access only their own keys without exposing other users' data. Without ACL policy support in the Python client, teams building multi-tenant data pipelines or access control automation cannot manage this programmatically and must resort to manual `gcloud` CLI commands or brittle subprocess calls.

### Additional context

The ACL policy functionality is fully available in the `gcloud` CLI (`gcloud memorystore acl-policies create/delete/describe/list/update`) and documented at https://docs.cloud.google.com/sdk/gcloud/reference/memorystore/acl-policies. This suggests the underlying REST API already supports ACL policy management, and the gap is in the generated Python client library not yet exposing this surface.

Current workaround requires raw REST calls:

```python
import google.auth
import google.auth.transport.requests
import requests

creds, project = google.auth.default()
creds.refresh(google.auth.transport.requests.Request())

url = (
f"https://memorystore.googleapis.com/v1/projects/{project}"
f"/locations/us-central1/instances/my-instance/aclPolicies"
)
resp = requests.get(url, headers={"Authorization": f"Bearer {creds.token}"})
```

贡献指南

打开贡献指南

评估

这个 Issue 还没有评估数据。

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。