Skip to content
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

Areas requiring agreement for stabilization of alternative registries #4688

Closed
2 of 10 tasks
cswindle opened this issue Oct 31, 2017 · 14 comments · Fixed by #6654
Closed
2 of 10 tasks

Areas requiring agreement for stabilization of alternative registries #4688

cswindle opened this issue Oct 31, 2017 · 14 comments · Fixed by #6654
Labels
A-registries Area: registries C-tracking-issue Category: A tracking issue for something unstable.

Comments

@cswindle
Copy link
Contributor

cswindle commented Oct 31, 2017

Below are a list of current concerns that @alexcrichton raised as wanting resolution before alternative registries becomes stable:

Please add to the list to include any other concerns.

@fa7ca7
Copy link
Contributor

fa7ca7 commented Oct 31, 2017

I have a few things to discuss:

What do you think?

@withoutboats withoutboats added the A-registries Area: registries label Oct 31, 2017
@withoutboats
Copy link
Contributor

format of the registry name, including validation of the format

Seems like there's no reason to put on it any more restrictions than what toml does, right? If your name is silly, you might need to quote & escape it in some places but toml supports arbitrary unicode strings both as table names and keys, afaik.

it just returns an error instead of printing a URL to visit and reading the token from a prompt

Does this mean it needs to accept a --registry argument like publish/yank? Probably other commands that interact with a registry should all accept this argument?

@cswindle
Copy link
Contributor Author

cswindle commented Nov 1, 2017

Does this mean it needs to accept a --registry argument like publish/yank? Probably other commands that interact with a registry should all accept this argument?

As implemented in #4680, I have added support for cargo login to store the token in the credentials file, but only if it is provided, if not it returns an error. When you want to publish to an alternate registry you then must provide --registry <reg> as an argument. I have also added the option --registry to all commands that interact with the registry.

@alexcrichton
Copy link
Member

@withoutboats

Seems like there's no reason to put on it any more restrictions than what toml does, right?

Perhaps, yeah, but Cargo often has things show up in weird places. For example you can specify configuration through an environment variable, and I don't actually know what that would do if you tried to specify a registry with a + in the name, for example, in an env var. These things also show up on the filesystem from time to time, which can have odd restrictions as well.

I was basically thinking that we could stick to a conservative set of names and then expand it later if we wanted.

Probably other commands that interact with a registry should all accept this argument?

Ah sorry what I meant is that if you type cargo login today it says "go visit https://crates.io/me and paste the token here". That exact same UI isn't available with cargo login --registry foo because we don't actually know for a custom registry where a token would come from. For example the index of the registry would need to provide the url https://crates.io at least (perhaps). I'm not sure we actually want to solve this though.

@carols10cents
Copy link
Member

Before stabilization, I would like to see the index specification in cargo's docs rather than in the text of RFC 2141, so that it can be more easily discovered and corrected/modified.

@est31
Copy link
Member

est31 commented Nov 26, 2017

@carols10cents having a "living" document one can point to is a great idea. The RFC should mention it so that readers don't mistake the RFC for such a living document.

@sfackler
Copy link
Member

sfackler commented Mar 1, 2018

The credentials file format has been changed to be a subset of .cargo/config in #4839. The example in this issue now looks like

[registry]
token = ".." # crates.io token
[registries.custom-registry-name]
token = ".." # custom registry token

@sfackler
Copy link
Member

sfackler commented Mar 1, 2018

Registry names are also now a purely local concern, so I don't think we necessarily need to put any restrictions on what they look like.

@stale
Copy link

stale bot commented Sep 16, 2018

As there hasn't been any activity here in over 6 months I've marked this as stale and if no further activity happens for 7 days I will close it.

I'm a bot so this may be in error! If this issue should remain open, could someone (the author, a team member, or any interested party) please comment to that effect?

The team would be especially grateful if such a comment included details such as:

  • Is this still relevant?
  • If so, what is blocking it?
  • Is it known what could be done to help move this forward?

Thank you for contributing!

If you're reading this comment from the distant future, fear not if this was closed automatically. If you believe it's still an issue please leave a comment and a team member can reopen this issue. Opening a new issue is also acceptable!

@stale stale bot added the stale label Sep 16, 2018
@carols10cents
Copy link
Member

This is still relevant because none of the alternative registry stuff has been stabilized yet and we'd like it to be, presumably. There's a decent list of TODO items in the description of this issue and the comments; some of them definitely haven't been completed yet. To move this forward, folks could investigate and see if the tasks in this issue have been completed yet and note as such, and if they haven't been completed, work on them or ask for help in working on them.

@carols10cents carols10cents added C-tracking-issue Category: A tracking issue for something unstable. and removed stale labels Sep 17, 2018
@hobofan
Copy link

hobofan commented Sep 26, 2018

Not 100% sure if that fits here, but that I noticed and think that should maybe be addressed before stabilization of alternative registries:

The token is not sent on all routes the registry and I wonder if there would be a downside to doing so. I have a use-case where it would be desirable to also receive the token on other API endpoints such as the download route, so the registry server can respond according to configuration tied to the token.

@mthebridge
Copy link

One other concern to add - it doesn't seem possible to override dependencies from alternate registries using [patch]. This doesn't work, for example (assuming the registry and crates are valid):

[dependencies]
"bar" = { registry = "foo", version = "1" }

[patch.foo]
"bar" = { path = "../my-local-bar-copy" }

Just specfiying the registry URL in the [patch] doesn't seem to work either. Unless I'm missing something.

@sfackler
Copy link
Member

sfackler commented Nov 14, 2018

Patches do work, but you need to do it via the URL rather than the registry name:

[patch."ssh://git@github.com/my-org/my-internal-index"]
bar = { path = "../my-local-bar-copy" }

There an open issue here to switch over to the patch.foo syntax since that's more consistent and less awkward: #5149

@mthebridge
Copy link

Aha! Sorry for not spotting that. Thanks for the speedy reply.

bors added a commit that referenced this issue Dec 20, 2018
Restrict registry names to same style as package names.

See #4688 (comment)
bors added a commit that referenced this issue Feb 12, 2019
Stabilize Alternative Registries

This includes a few minor changes besides stabilizing:
- `cargo search` won't display `crates.io` search URL for extra results for non-crates.io registries.
- Document using environment variables for API tokens.
- Explicit section in `config.md` for documenting the credentials file.

Closes rust-lang/rust#44931
Closes rust-lang/crates-io-cargo-teams#21
Closes #6589
Closes #4688
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-registries Area: registries C-tracking-issue Category: A tracking issue for something unstable.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

9 participants