mirror of
https://github.com/minio/minio.git
synced 2025-01-24 13:13:16 -05:00
Add expiration to ListServiceAccounts function (#17249)
This commit is contained in:
parent
b210ea79bc
commit
0649aca219
@ -1123,14 +1123,18 @@ func (a adminAPIHandlers) ListServiceAccounts(w http.ResponseWriter, r *http.Req
|
||||
return
|
||||
}
|
||||
|
||||
var serviceAccountsNames []string
|
||||
var serviceAccountList []madmin.ServiceAccountInfo
|
||||
|
||||
for _, svc := range serviceAccounts {
|
||||
serviceAccountsNames = append(serviceAccountsNames, svc.AccessKey)
|
||||
expiryTime := svc.Expiration
|
||||
serviceAccountList = append(serviceAccountList, madmin.ServiceAccountInfo{
|
||||
AccessKey: svc.AccessKey,
|
||||
Expiration: &expiryTime,
|
||||
})
|
||||
}
|
||||
|
||||
listResp := madmin.ListServiceAccountsResp{
|
||||
Accounts: serviceAccountsNames,
|
||||
Accounts: serviceAccountList,
|
||||
}
|
||||
|
||||
data, err := json.Marshal(listResp)
|
||||
|
@ -1329,7 +1329,11 @@ func (c *check) assertSvcAccAppearsInListing(ctx context.Context, madmClient *ma
|
||||
if err != nil {
|
||||
c.Fatalf("unable to list svc accounts: %v", err)
|
||||
}
|
||||
if !set.CreateStringSet(listResp.Accounts...).Contains(svcAK) {
|
||||
var accessKeys []string
|
||||
for _, item := range listResp.Accounts {
|
||||
accessKeys = append(accessKeys, item.AccessKey)
|
||||
}
|
||||
if !set.CreateStringSet(accessKeys...).Contains(svcAK) {
|
||||
c.Fatalf("service account did not appear in listing!")
|
||||
}
|
||||
}
|
||||
|
8
go.mod
8
go.mod
@ -43,13 +43,13 @@ require (
|
||||
github.com/lithammer/shortuuid/v4 v4.0.0
|
||||
github.com/miekg/dns v1.1.54
|
||||
github.com/minio/cli v1.24.2
|
||||
github.com/minio/console v0.28.0
|
||||
github.com/minio/console v0.29.0
|
||||
github.com/minio/csvparser v1.0.0
|
||||
github.com/minio/dperf v0.4.4
|
||||
github.com/minio/highwayhash v1.0.2
|
||||
github.com/minio/kes-go v0.1.0
|
||||
github.com/minio/madmin-go/v2 v2.1.3
|
||||
github.com/minio/minio-go/v7 v7.0.54
|
||||
github.com/minio/madmin-go/v2 v2.2.0
|
||||
github.com/minio/minio-go/v7 v7.0.55-0.20230525060734-b7836f021bfb
|
||||
github.com/minio/mux v1.9.0
|
||||
github.com/minio/pkg v1.7.2
|
||||
github.com/minio/selfupdate v0.6.0
|
||||
@ -179,7 +179,7 @@ require (
|
||||
github.com/matttproud/golang_protobuf_extensions v1.0.4 // indirect
|
||||
github.com/minio/colorjson v1.0.4 // indirect
|
||||
github.com/minio/filepath v1.0.0 // indirect
|
||||
github.com/minio/mc v0.0.0-20230523171519-7415469c72f3 // indirect
|
||||
github.com/minio/mc v0.0.0-20230526175537-0fac0e006eae // indirect
|
||||
github.com/minio/md5-simd v1.1.2 // indirect
|
||||
github.com/minio/websocket v1.6.0 // indirect
|
||||
github.com/mitchellh/mapstructure v1.5.0 // indirect
|
||||
|
16
go.sum
16
go.sum
@ -769,8 +769,8 @@ github.com/minio/cli v1.24.2 h1:J+fCUh9mhPLjN3Lj/YhklXvxj8mnyE/D6FpFduXJ2jg=
|
||||
github.com/minio/cli v1.24.2/go.mod h1:bYxnK0uS629N3Bq+AOZZ+6lwF77Sodk4+UL9vNuXhOY=
|
||||
github.com/minio/colorjson v1.0.4 h1:sNJYTb2uNswdqmGARg9wrogCX8+GRZzEacYbJT86e00=
|
||||
github.com/minio/colorjson v1.0.4/go.mod h1:ZgE8vYon4xC4yfBPclP/2gqMRYw+p+xRsBbLMDKdb9M=
|
||||
github.com/minio/console v0.28.0 h1:gZNqdV66Zr1PnPcaHrwHuvOI5y9d6QfZdKxixeJpLdg=
|
||||
github.com/minio/console v0.28.0/go.mod h1:29pUwWpPBCqiiffSpAMBM0n/7G9kDd/FANOhnxW8ozo=
|
||||
github.com/minio/console v0.29.0 h1:MkUH0knRLF4M1cZkC3ElYAc2nZe+60QyZ797gWkqeyM=
|
||||
github.com/minio/console v0.29.0/go.mod h1:vHwdsGiU0Q6HC+qC6luhrMNIYW3GsPDB+2PLIq58KCA=
|
||||
github.com/minio/csvparser v1.0.0 h1:xJEHcYK8ZAjeW4hNV9Zu30u+/2o4UyPnYgyjWp8b7ZU=
|
||||
github.com/minio/csvparser v1.0.0/go.mod h1:lKXskSLzPgC5WQyzP7maKH7Sl1cqvANXo9YCto8zbtM=
|
||||
github.com/minio/dperf v0.4.4 h1:ayJsuyx/ZjQjNnZxLizGUnobYDYKKmjSBnkWnoELKEQ=
|
||||
@ -782,16 +782,16 @@ github.com/minio/highwayhash v1.0.2/go.mod h1:BQskDq+xkJ12lmlUUi7U0M5Swg3EWR+dLT
|
||||
github.com/minio/kes-go v0.1.0 h1:h201DyOYP5sTqajkxFGxmXz/kPbT8HQNX1uh3Yx2PFc=
|
||||
github.com/minio/kes-go v0.1.0/go.mod h1:VorHLaIYis9/MxAHAtXN4d8PUMNKhIxTIlvFt0hBOEo=
|
||||
github.com/minio/madmin-go v1.6.6/go.mod h1:ATvkBOLiP3av4D++2v1UEHC/QzsGtgXD5kYvvRYzdKs=
|
||||
github.com/minio/madmin-go/v2 v2.1.3 h1:9pkUgAujfm/SaFei4a1LwpS2et1/qGvRjFqFbRWa6xA=
|
||||
github.com/minio/madmin-go/v2 v2.1.3/go.mod h1:8bL1RMNkblIENFSgGYjeHrzUx9PxROb7OqfNuMU9ivE=
|
||||
github.com/minio/mc v0.0.0-20230523171519-7415469c72f3 h1:irwCLY9VPu8qHIZogX1oGe7DX369aSvtejdddZp3aZE=
|
||||
github.com/minio/mc v0.0.0-20230523171519-7415469c72f3/go.mod h1:RE5bLggH7ehQUDoGYKW8B5h7kFrYRRNF/IAXOdF8Ch8=
|
||||
github.com/minio/madmin-go/v2 v2.2.0 h1:DtJPzallTD/7wx0ZaxPBl+HrKgI5L5Z+ULa6tAMvuH8=
|
||||
github.com/minio/madmin-go/v2 v2.2.0/go.mod h1:8bL1RMNkblIENFSgGYjeHrzUx9PxROb7OqfNuMU9ivE=
|
||||
github.com/minio/mc v0.0.0-20230526175537-0fac0e006eae h1:jqj4OwgFKlbL8xUWWM4CnsUgKFp3kcFEyll2R+4fVbI=
|
||||
github.com/minio/mc v0.0.0-20230526175537-0fac0e006eae/go.mod h1:hVJCldV0teZzZtbkeP+t0BebFVOiSQvZzsCQL8Ax2ps=
|
||||
github.com/minio/md5-simd v1.1.2 h1:Gdi1DZK69+ZVMoNHRXJyNcxrMA4dSxoYHZSQbirFg34=
|
||||
github.com/minio/md5-simd v1.1.2/go.mod h1:MzdKDxYpY2BT9XQFocsiZf/NKVtR7nkE4RoEpN+20RM=
|
||||
github.com/minio/minio-go/v6 v6.0.46/go.mod h1:qD0lajrGW49lKZLtXKtCB4X/qkMf0a5tBvN2PaZg7Gg=
|
||||
github.com/minio/minio-go/v7 v7.0.41/go.mod h1:nCrRzjoSUQh8hgKKtu3Y708OLvRLtuASMg2/nvmbarw=
|
||||
github.com/minio/minio-go/v7 v7.0.54 h1:1tS2v8nhylHEn307qUwXBNioCDHLDcgOMTA4Te4wFVc=
|
||||
github.com/minio/minio-go/v7 v7.0.54/go.mod h1:NUDy4A4oXPq1l2yK6LTSvCEzAMeIcoz9lcj5dbzSrRE=
|
||||
github.com/minio/minio-go/v7 v7.0.55-0.20230525060734-b7836f021bfb h1:oW9owq24i06IMYrfufzdjLH5S4rcOc9M1f7Cak+Ya5I=
|
||||
github.com/minio/minio-go/v7 v7.0.55-0.20230525060734-b7836f021bfb/go.mod h1:NUDy4A4oXPq1l2yK6LTSvCEzAMeIcoz9lcj5dbzSrRE=
|
||||
github.com/minio/mux v1.9.0 h1:dWafQFyEfGhJvK6AwLOt83bIG5bxKxKJnKMCi0XAaoA=
|
||||
github.com/minio/mux v1.9.0/go.mod h1:1pAare17ZRL5GpmNL+9YmqHoWnLmMZF9C/ioUCfy0BQ=
|
||||
github.com/minio/pkg v1.5.4/go.mod h1:2MOaRFdmFKULD+uOLc3qHLGTQTuxCNPKNPfLBTxC8CA=
|
||||
|
Loading…
x
Reference in New Issue
Block a user