Skip to content

Add ACL Policy controls to memorystore_v1 python client #17447

@sandman-92

Description

@sandman-92

Determine this is the right repository

  • 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

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:

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}"})

Metadata

Metadata

Assignees

No one assigned

    Labels

    triage meI really want to be triaged.type: feature request‘Nice-to-have’ improvement, new feature or different behavior or design.

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions