Skip to content

Commit

Permalink
Add error
Browse files Browse the repository at this point in the history
  • Loading branch information
taran-p committed Oct 3, 2024
1 parent 6243b10 commit 7bab871
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
2 changes: 1 addition & 1 deletion cmd/admin-accesskey-remove.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright (c) 2015-2023 MinIO, Inc.
// Copyright (c) 2015-2024 MinIO, Inc.
//
// This file is part of MinIO Object Storage stack
//
Expand Down
4 changes: 4 additions & 0 deletions cmd/idp-ldap-accesskey-edit.go
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,10 @@ func accessKeyEditOpts(ctx *cli.Context) madmin.UpdateServiceAccountReq {
description := ctx.String("description")
expDurVal := ctx.Duration("expiry-duration")

if name == "" && expVal == "" && expDurVal == 0 && policyPath == "" && secretKey == "" && description == "" {
fatalIf(probe.NewError(errors.New("At least one property must be edited")), "invalid flags")
}

if expVal != "" && expDurVal != 0 {
fatalIf(probe.NewError(errors.New("Only one of --expiry or --expiry-duration can be specified")), "invalid flags")
}
Expand Down

0 comments on commit 7bab871

Please sign in to comment.