Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MinioAdmin: conditionally decrypt response in {attach,detach}_policy APIs #1472

Conversation

balamurugana
Copy link
Member

No description provided.

Copy link
Member

@prakashsvmx prakashsvmx left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tested.

from minio.credentials import StaticProvider
from minio.minioadmin import MinioAdmin

provider = StaticProvider("minio", "minio123")

mc_admin = MinioAdmin(
    endpoint="localhost:22000",
    credentials=provider,
    secure=False, 
)
attach_res=mc_admin.attach_policy(["readonly","readwrite"],"test-user")
print(attach_res)

Output:

{"policiesAttached":["readonly","readwrite"],"updatedAt":"2025-01-07T07:59:35.837651287Z"}
➜ mc admin user add local22 test-user minio123
Added user `test-user` successfully.

 ➜ mc admin user list local22                  
enabled    test-user           
                      
# Run the above program 

 ➜ mc admin user list local22
enabled    test-user             readonly,readwrite  

@kannappanr
Copy link
Collaborator

what versions are we talking about?

@balamurugana
Copy link
Member Author

what versions are we talking about?

@kannappanr I am not sure. Refer https://github.com/minio/madmin-go/blob/main/policy-commands.go#L270

@kannappanr
Copy link
Collaborator

the previous PR was tested with latest release of minio and it failed, so not sure if the title is correct

@balamurugana balamurugana changed the title MinioAdmin: handle older minio server in {attach,detach}_policy APIs MinioAdmin: conditionally decrypt response in {attach,detach}_policy APIs Jan 8, 2025
@harshavardhana harshavardhana merged commit 6425726 into minio:master Jan 8, 2025
15 checks passed
@balamurugana balamurugana deleted the MinioAdmin-handle-older-minio-server-in-attach-detach-policy-APIs branch January 8, 2025 12:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants