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

mc admin accesskey: --expiry-duration accepts only time units (up to hours) #5100

Closed
trilga opened this issue Dec 30, 2024 · 5 comments
Closed

Comments

@trilga
Copy link

trilga commented Dec 30, 2024

Expected behavior

As per documentation, --expiry-duration should accept also days (--expiry-duration)

Actual behavior

When passing 30d, the parameter is ignored:

mc admin accesskey create myminio/ minio_user --expiry-duration 30d
Access Key: PYWZXA0Y4H33NZFQ9TXJ
Secret Key: uWXlQJ24YtoXrNi0Hp+hjxuVzuXbJpLcAbjTGERc
Expiration: NONE
Name:
Description:

Though it works well with hours, for example:

mc admin accesskey create myminio/ minio_user --expiry-duration 30h
Access Key: T2FZHTFM82DL0Q2IARB7
Secret Key: fMypggp3wDkHiMChNR+FLlq1Ay3zaNyFBQXgpcjZ
Expiration: 2024-12-31 19:37:16 +0000 UTC
Name:
Description:

Steps to reproduce the behavior

Run mc admin accesskey create myminio/ minio_user --expiry-duration 30d

mc --version

  • mc version RELEASE.2024-10-08T09-37-26Z (commit-id=cf128de2cf42e763e7bd30c6df8b749fa94e0c10)
    Runtime: go1.22.8 linux/amd64
    Copyright (c) 2015-2024 MinIO, Inc.
    License GNU AGPLv3 https://www.gnu.org/licenses/agpl-3.0.html

System information

@harshavardhana
Copy link
Member

You specify 720hr, 30d is not a time.Duration supported format - thats why the flag says --expiry-duration

@harshavardhana
Copy link
Member

As per documentation, --expiry-duration should accept also days (--expiry-duration)

where is it documented?

@trilga
Copy link
Author

trilga commented Dec 31, 2024

@harshavardhana https://min.io/docs/minio/linux/reference/minio-mc-admin/mc-admin-accesskey-create.html#command-mc.admin.accesskey.create:~:text=expiry%2Dduration.-,%2D%2Dexpiry%2Dduration,-Optional

This might be an expected behavior, but I'm not sure it's correct to close the issue while documentation is providing an incorrect example.
I'd also suggest adding to the docs list of the possible units, as a user is not supposed to now that internal implementation is done in Golang and what duration units are available.

@harshavardhana
Copy link
Member

@harshavardhana https://min.io/docs/minio/linux/reference/minio-mc-admin/mc-admin-accesskey-create.html#command-mc.admin.accesskey.create:~:text=expiry%2Dduration.-,%2D%2Dexpiry%2Dduration,-Optional

@ravindk89 we need to fix this, valid time units for duration are always

Valid time units are "ns", "us" (or "µs"), "ms", "s", "m", "h".

@ravindk89
Copy link
Contributor

minio/docs@fff6e87

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants