Skip to content

Well known config #291

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

Merged
merged 7 commits into from
May 16, 2024
Merged

Conversation

calvinrp
Copy link
Collaborator

  • Added Warg client support for .well-known path, which required the warg_client::FileSystemClient::new_with_config() methods to be async;
  • Support both warg login <registry-url> and warg login --registry <registry-url> (also for warg logout);
  • Sets the default registry, without configuration, to be bytecodealliance.org; See discussions

Follow on work to respect HTTP cache headers.

@calvinrp calvinrp requested review from lann and macovedj May 16, 2024 13:40
@@ -10,11 +10,21 @@ pub struct LogoutCommand {
/// The common command options.
#[clap(flatten)]
pub common: CommonOptions,

/// The URL of the registry to use.
Copy link
Collaborator

Choose a reason for hiding this comment

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

Should we call out that this is an advanced option and plain registry is preferred?

Copy link
Collaborator Author

@calvinrp calvinrp May 16, 2024

Choose a reason for hiding this comment

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

How do you mean "call out"?

I think either is OK. Just errors if you use both at the same time. Current look:

(base) > warg login -h
Manage auth tokens for interacting with a registry

Usage: warg login [OPTIONS] [URL]

Arguments:
  [URL]  The URL of the registry to use

Options:
      --registry <URL>                     The URL of the registry to use
      --config <CONFIG>                    The path to the client configuration file to use
      --ignore-federation-hints            Ignore federation hints
      --auto-accept-federation-hints       Auto accept federation hints
      --keyring-backend <KEYRING_BACKEND>  The backend to use for keyring access
  -h, --help                               Print help (see more with '--help')
  -V, --version                            Print version

Copy link
Collaborator

Choose a reason for hiding this comment

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

Maybe I'm just confused; what is the purpose of these two different arguments?

Copy link
Collaborator Author

@calvinrp calvinrp May 16, 2024

Choose a reason for hiding this comment

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

I was trying to support both warg login --registry <registry-url> (to not break existing instructions but also migrate to warg login <registry-url>.

Been trying, but clap doesn't really support it best I can tell with the derive args

Copy link
Collaborator

Choose a reason for hiding this comment

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

Ah OK; maybe pick one of the two to #[arg(hide)] and comment the reasoning?

Copy link
Collaborator Author

@calvinrp calvinrp May 16, 2024

Choose a reason for hiding this comment

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

Fixed, with hide

@calvinrp calvinrp merged commit ac3342b into bytecodealliance:main May 16, 2024
6 checks passed
@calvinrp calvinrp deleted the well-known-config branch May 16, 2024 15:24
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.

3 participants