-
Notifications
You must be signed in to change notification settings - Fork 33
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
moved the keyring functions back into warg_client #275
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.
Partial review; I suspect this won't compile with cargo build --no-default-features
postgres = ["warg-server/postgres"] | ||
cli-interactive = ["warg-client/cli-interactive"] | ||
keyring = ["warg-client/keyring"] |
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 that we actually need to make this optional for the binary do we? Actually, I didn't really think about this until now: it probably doesn't make sense to have any of these features; what does the postgres
feature even mean here?
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 postgres
feature is for the warg-server
switches between using an in-memory vs Postgres backing when setting the feature flag. That probably still makes sense for now.
The other keyring
and cli-interactive
features might make sense to have the option of compiling without those implementations in the warg-client
.
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.
These features are just for the crate defined in this file: warg-cli
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, you mean we can drop postgres
feature in the top-level Cargo.toml but keep it in the crates/server/Cargo.toml
?
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.
Yeah, most of the root Cargo.toml
is (somewhat confusingly) completely independent of other workspace members.
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.
Removing postgres
from the top-level Cargo.toml
appears to affect how I run tests. It might affect the test runner, but would need to double check. But doesn't seem urgent.
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.
For the time being, we might want to keep the top-level postgres
feature. The test runner is setup expecting it. https://github.com/bytecodealliance/registry/blob/main/ci/run-postgres-tests.sh#L26
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.
Ok; are the keyring
and cli-interactive
features needed?
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.
Well, in theory, if you don't want those features, it will be useful to have them behind a feature flag. But not entirely sure.
postgres = ["warg-server/postgres"] | ||
cli-interactive = ["warg-client/cli-interactive"] | ||
keyring = ["warg-client/keyring"] |
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.
Ok; are the keyring
and cli-interactive
features needed?
path = path.display() | ||
); | ||
let client = | ||
match FileSystemClient::try_new_with_config(self.registry.as_deref(), config, None)? { |
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.
Was it intentional that you're now passing None
for the auth token (and that you deleted the now-unused auth_token
method below)?
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, I was trying to simplify the burden on external crates getting the correct auth_token
. So None
gets the correct one, https://github.com/bytecodealliance/registry/blob/main/crates/client/src/lib.rs#L1403-L1405
Also, introduced new_with_default_config()
to simplify, https://github.com/bytecodealliance/registry/blob/main/crates/client/src/lib.rs#L1428-L1430
This allows us to have a simpler
FileSystemClient::new_with_default_config()
that gets the expectedauth_token
.Would simplify bytecodealliance/cargo-component#288, bytecodealliance/wac#103, bytecodealliance/wasm-pkg-tools#6, esoterra/wow#3
This:
would change to: