moved the keyring functions back into warg_client#275
moved the keyring functions back into warg_client#275calvinrp merged 3 commits intobytecodealliance:mainfrom
Conversation
lann
left a comment
There was a problem hiding this comment.
Partial review; I suspect this won't compile with cargo build --no-default-features
| default = ["cli-interactive", "keyring"] | ||
| postgres = ["warg-server/postgres"] | ||
| cli-interactive = ["warg-client/cli-interactive"] | ||
| keyring = ["warg-client/keyring"] |
There was a problem hiding this comment.
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.
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.
These features are just for the crate defined in this file: warg-cli
There was a problem hiding this comment.
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.
Yeah, most of the root Cargo.toml is (somewhat confusingly) completely independent of other workspace members.
There was a problem hiding this comment.
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.
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.
Ok; are the keyring and cli-interactive features needed?
There was a problem hiding this comment.
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.
| default = ["cli-interactive", "keyring"] | ||
| postgres = ["warg-server/postgres"] | ||
| cli-interactive = ["warg-client/cli-interactive"] | ||
| keyring = ["warg-client/keyring"] |
There was a problem hiding this comment.
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.
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.
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: