-
Notifications
You must be signed in to change notification settings - Fork 250
dont print provided creds in BootstrapCommand #1799
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
Open
XN137
wants to merge
1
commit into
apache:main
Choose a base branch
from
XN137:dont-print-root-credentials
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
If the user has explicitly set
printCredentials
, why wouldn't we print?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.
the assumption is that a user would want to only print the credentials that were generated on the fly, not the ones that were provided by the user via
--credential
or--credentials-file
.if the assumption is false, then yeah we should still print all of them.
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'd prefer not to print user-provided credentials. From the general security POV, Polaris should not add risk of exposure to user secrets if it can be avoided. Polaris prints generated secrets to make the user aware of them, but that is not required for user inputs.
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.
The "print" option is still relevant when multiple realms bootstrap at the same time - some of them may get auto-generated credentials, I think.
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.
Then don't set the
--print-credentials
flag, and they shouldn't print... but if a user sets this flag, it seems odd to explicitly disregard it.Uh oh!
There was an error while loading. Please reload this page.
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.
@eric-maynard : please consider this use case:
Current output:
Side note: the credential printed for realm
r1
is not what the user provided (rotated automatically).More importantly, I believe in this case the user should receive credentials for realm
r2
(which got auto-generated), but not for realmr1
(user-provided).The fact that
r1
credentials are rotated during bootstrap is irrelevant to this PR. We can probably deal with that separately.Uh oh!
There was an error while loading. Please reload this page.
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.
This behavior looks completely correct to me.
If the user doesn't want to print credentials for r1, they should bootstrap r1 without setting
--print-credentials
. It's quite straightforward.All the more reason that printing the credentials is valuable, no? But I agree that this can/should change.
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.
This has been fixed already: #801 but since then,
JdbcMetaStoreManagerFactory
was introduced and still rotates the secrets.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.
@eric-maynard : from the UX perspective, WDYT about converting the current
--print-credentials
options into a new--generate-credentials
option? The behaviour would be:--generate-credentials
and a realm does not have user-provided creds -> error--generate-credentials
is set, realms without user-provided creds get generated creds and those get printed automatically?Uh oh!
There was an error while loading. Please reload this page.
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.
--generate-credentials
seems redundant with the supplied credentials. That is, there are 4 modes and 2 of them would be invalid:Besides that, we'd lose what appears to me a valid behavior -- echoing back non-generated credentials.
In the contrived scenario where someone wants to bootstrap N different realms, and they want to generate credentials for a value in (0, N) of them, and they have an issue with printing the non-generated credentials, they have the option of simply running two bootstrap commands. I don't think we need a breaking change to better support this scenario.