-
Notifications
You must be signed in to change notification settings - Fork 265
Ability to read root credentials from file when bootstrapping #940
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
Conversation
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.
LGTM overall 👍 I think it improves usability of the bootstrap command and environment-based runs with auto-bootstrapping (in-memory).
Just a few minor comments and suggestions.
...core/src/test/java/org/apache/polaris/core/persistence/bootstrap/RootCredentialsSetTest.java
Outdated
Show resolved
Hide resolved
...ris-core/src/main/java/org/apache/polaris/core/persistence/bootstrap/RootCredentialsSet.java
Outdated
Show resolved
Hide resolved
polaris-core/src/test/resources/org/apache/polaris/core/persistence/bootstrap/credentials.yaml
Show resolved
Hide resolved
warnOnInMemory(); | ||
|
||
RootCredentialsSet rootCredentialsSet; | ||
List<String> realms; // TODO Iterable |
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.
Still TODO
?
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.
Yes, waiting for #889
paramLabel = "<realm>", | ||
required = true, | ||
description = "The name of a realm to bootstrap.") | ||
List<String> realms; |
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.
Do we still need this as a separate option? Why not extract after parsing the -c
value?
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 idea is that users may want to bootstrap a realm without providing credentials (they would be randomly-generated). Should I remove this option? It is true that the file-based approach does not permit randomly-generated credentials.
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.
Ah, yes, I missed that use case 🤦
I was just trying to simplify the user experience for the manual case. WDYT about this:
--generate-secrets realm1 --generate-secrets realm2 --credentials realm2,id2,sec2 --credentials realm3,id3,sec3
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 don't know, honestly... the more it goes, the more I'm in favor of requiring the user to provide all the credentials.
But your suggestion is at least coherent... I'm not opposed to it.
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.
In the end, I think it's a minor point compared to the addition of reading secrets from files. We can always refactor that later.
quarkus/admin/src/test/java/org/apache/polaris/admintool/BootstrapCommandTest.java
Outdated
Show resolved
Hide resolved
Conceptually I think this PR is great, but we need to standardize on what a "serialized" principal looks like across the APIs, the CLI, and this file format |
36e6369
to
20febc8
Compare
...ris-core/src/main/java/org/apache/polaris/core/persistence/bootstrap/RootCredentialsSet.java
Show resolved
Hide resolved
I do not think establishing a standard for principal serialization should be a blocker for this PR. This change, IMHO, improves user experience already. If the future standard is different, we will fix the tool at the time the standard becomes effective. Polaris is a young project without a release yet. Users should expect changes in file formats and CLI arguments as the project matures. |
4c8224a
to
1bb6ce8
Compare
paramLabel = "<realm>", | ||
required = true, | ||
description = "The name of a realm to bootstrap.") | ||
List<String> realms; |
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.
In the end, I think it's a minor point compared to the addition of reading secrets from files. We can always refactor that later.
It's not necessarily about establishing a standard across the application, but at least within the CLI. #461 was already open proposing a JSON format for the CLI, so it seems odd that we should have merged a change to the CLI that accepts YAML without a consensus about the format to use. |
I believe this PR did not have any impact on existing functionalities or use cases. So, I do not think this change is an "API" kind of change. Also, as far as I can tell the code in this PR is able to parse the JSON structures proposed in #461. But point taken on reaching consensus. We can change the format of CLI inputs in #461 or another PR if you prefer. |
This was initially done in support of #878, which has been closed.
But I think that the feature is still useful, so I went ahead and opened a PR.
PolarisCredentialsBootstrap
has been refactored into two components in order to facilitate JSON and YAML parsing:RootCredentialsSet
andRootCredentials
.The expected YAML format is as follows: