[go: nahoru, domu]

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

clarify error message for root user credential #20043

Merged

Conversation

austin880625
Copy link
Contributor

Community Contribution License

All community contributions in this pull request are licensed to the project maintainers
under the terms of the Apache 2 license.
By creating this pull request I represent that I have the right to license the
contributions to the project maintainers under the Apache 2 license.

Description

Clarifies error messages for root user credential environment variables so that it matches the actual failure reason.

Motivation and Context

MINIO_ACCESS_KEY and MINIO_SECRET_KEY is prompted as deprecated when set in enviroment variables. The error message on failure of credential check still shows "access key" and "secret key", which confuses users.

How to test this PR?

start minio server with MINIO_ROOT_USER and MINIO_ROOT_PASSWORD set and violate the length requirements

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Optimization (provides speedup with no functional changes)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist:

  • Fixes a regression (If yes, please add commit-id or PR # here)
  • Unit tests added/updated
  • Internal documentation updated
  • Create a documentation update request here

@harshavardhana
Copy link
Member

This PR needs to be simplified its changing too many things.

@austin880625 austin880625 force-pushed the clarify-root-credential-errmsg branch from d5ec965 to 38dd31c Compare July 7, 2024 18:48
@austin880625
Copy link
Contributor Author
austin880625 commented Jul 7, 2024

Sorry I'm new to this project. I just pushed another version which only changes the error displayed when MINIO_ROOT_USER or MINIO_ROOT_PASSWORD doesn't meet the credential requirements(removed the changes for env file credentials). Is it still too much for this PR?

cmd/common-main.go Outdated Show resolved Hide resolved
@@ -851,6 +852,7 @@ func loadRootCredentials() {
} else if env.IsSet(config.EnvAccessKey) && env.IsSet(config.EnvSecretKey) {
user = env.Get(config.EnvAccessKey, "")
password = env.Get(config.EnvSecretKey, "")
isUsingKeys = true
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
isUsingKeys = true
legacyCredentials = true

cmd/common-main.go Outdated Show resolved Hide resolved
@harshavardhana
Copy link
Member

the new PR looks good.

MINIO_ACCESS_KEY and MINIO_SECRET_KEY is prompted as deprecated when set in
enviroment variables. The error message on failure of credential check still
shows "access key" and "secret key", which confuses users. This patch clarifies
error messages for these cases so that it matches the actual failure reason.

Signed-off-by: Austin Chang <austin880625@gmail.com>
@austin880625 austin880625 force-pushed the clarify-root-credential-errmsg branch from 38dd31c to a047302 Compare July 10, 2024 04:21
@austin880625
Copy link
Contributor Author

I've just updated the naming. Thank for the review

@austin880625
Copy link
Contributor Author
austin880625 commented Jul 10, 2024

Oops sorry I was using the phone and touched the "merge master" button unintentionally, should we restart the pipeline or I need to force push again?

@harshavardhana harshavardhana merged commit 5f64658 into minio:master Jul 10, 2024
20 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.

None yet

2 participants