-
Notifications
You must be signed in to change notification settings - Fork 562
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
Add admin users #2554
Add admin users #2554
Conversation
74e0409
to
35ecf85
Compare
Codecov Report
@@ Coverage Diff @@
## master #2554 +/- ##
==========================================
- Coverage 10.49% 10.22% -0.27%
==========================================
Files 107 117 +10
Lines 10828 11114 +286
==========================================
Hits 1136 1136
- Misses 9542 9828 +286
Partials 150 150
Continue to review full report at Codecov.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some comments
cmd/admin-users-add.go
Outdated
e := client.AddUser(args.Get(1), args.Get(2)) | ||
fatalIf(probe.NewError(e).Trace(args...), "Cannot add new user") | ||
|
||
policy, e := ioutil.ReadFile(args.Get(3)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's load policy first to fail before adding a user above.
cmd/admin-users-remove.go
Outdated
|
||
// checkAdminUsersRemoveSyntax - validate all the passed arguments | ||
func checkAdminUsersRemoveSyntax(ctx *cli.Context) { | ||
if len(ctx.Args()) != 4 { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think two arguments not four
cmd/admin-users-revoke.go
Outdated
|
||
// checkAdminUsersRevokeSyntax - validate all the passed arguments | ||
func checkAdminUsersRevokeSyntax(ctx *cli.Context) { | ||
if len(ctx.Args()) != 4 { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Two arguments
cmd/admin-users-revoke.go
Outdated
"github.com/minio/minio/pkg/madmin" | ||
) | ||
|
||
var adminUsersRevokeCmd = cli.Command{ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure, if we revoke the user, how can we reenable it again ?
cmd/admin-users-revoke.go
Outdated
} | ||
} | ||
|
||
// mainAdminUsersRevoke is the handle for "mc admin users add" command. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"mc admin users add" -> "mc admin users revoke"
cmd/admin-users-remove.go
Outdated
} | ||
} | ||
|
||
// mainAdminUsersRemove is the handle for "mc admin users add" command. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
mc admin users add" -> mc admin users remove"
This PR is changing a bit |
4305d32
to
0de3054
Compare
de9b614
to
7e731bf
Compare
docs/minio-admin-complete-guide.md
Outdated
@@ -273,19 +275,69 @@ FLAGS: | |||
Storage : Used 8.2GiB | |||
``` | |||
|
|||
<a name="users"></a> | |||
### Command `users` - Manage regular users | |||
`users` command to add new, remove, enable, disable, list users on Minio server. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
add new, -> add
cmd/admin-users-add.go
Outdated
{{.HelpName}} - {{.Usage}} | ||
|
||
USAGE: | ||
{{.HelpName}} TARGET USERNAME PASSWORD POLICYTYPE|POLICYFILE |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we add possible values of policy type ? and a short example of policy file content
One little problem is when trying to upload an object, mc cp, in a bucket.. it doesn't work because for some reasons, mc want to list all buckets, readwrite policy won't guarantee it that, but users can use custom policy document probably and then fix this later |
This is something of a problem in |
After talking to @abperiasamy some more requirements came in blocking this for now. |
5a675bd
to
9e3f098
Compare
Removing a revoked user gives an inconsistent error that specified key does not exist.
|
9df99b5
to
3edcf4f
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM & tested
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tested & LGTM
No description provided.