Skip to content
This repository was archived by the owner on Jul 28, 2025. It is now read-only.

Well known config#291

Merged
calvinrp merged 7 commits intobytecodealliance:mainfrom
calvinrp:well-known-config
May 16, 2024
Merged

Well known config#291
calvinrp merged 7 commits intobytecodealliance:mainfrom
calvinrp:well-known-config

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
#[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
@calvinrp calvinrp deleted the well-known-config branch May 16, 2024 15:24
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants