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

Updates/merge multiple policy #4691

Merged
merged 11 commits into from
Oct 24, 2023

Conversation

r-scheele
Copy link
Contributor

@r-scheele r-scheele commented Sep 21, 2023

Description

This PR merges multiple policies in mc admin user policy TARGET USERNAME command, if more than one exists.

./mc admin user add myminio minio1 minio123
Added user `minio1` successfully.
$ ./mc admin policy list myminio
consoleAdmin
diagnostics
readonly
readwrite
writeonly
$ ./mc admin user policy myminio minio1
{
  "Version": "2012-10-17",
  "Statement": [
    {
      "Effect": "Allow",
      "Action": [
        "admin:*"
      ]
    },
    {
      "Effect": "Allow",
      "Action": [
        "kms:*"
      ]
    },
    {
      "Effect": "Allow",
      "Action": [
        "s3:*"
      ],
      "Resource": [
        "arn:aws:s3:::*"
      ]
    }
  ]
}

cmd/admin-user-policy.go Outdated Show resolved Hide resolved
cmd/admin-user-policy.go Outdated Show resolved Hide resolved
cmd/admin-user-policy.go Show resolved Hide resolved
Copy link
Member

@donatello donatello left a comment

Choose a reason for hiding this comment

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

I think output should indicate that this is a merged policy output of the policies applied to the user to reduce chances of confusion.

Copy link
Member

@harshavardhana harshavardhana left a comment

Choose a reason for hiding this comment

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

In mc we treat go err as e and probe.Error as err

cmd/admin-user-policy.go Outdated Show resolved Hide resolved
cmd/admin-user-policy.go Outdated Show resolved Hide resolved
cmd/admin-user-policy.go Outdated Show resolved Hide resolved
cmd/admin-user-policy.go Outdated Show resolved Hide resolved
@harshavardhana
Copy link
Member

PTAL @donatello

@harshavardhana
Copy link
Member

PTAL @donatello @shtripat

Copy link
Contributor

@shtripat shtripat left a comment

Choose a reason for hiding this comment

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

lgtm

@harshavardhana harshavardhana merged commit 75e7222 into minio:master Oct 24, 2023
5 checks passed
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