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

Add support for Alternate Registries #2

Merged
merged 2 commits into from
Jun 29, 2024
Merged

Conversation

BarbossHack
Copy link
Owner

Add support for alternate registries, as discussed in serayuzgur/crates#217 (comment) :

  • Read alternate registries from ~/.cargo/config.toml (or ~/.cargo/config for legacy) if any.
  • Read registry tokens from ~/.cargo/credentials.toml if any.
  • Support registry authentification with cargo:token credentials.
  • Does not support registry authenfication with cargo:libsecret, cargo:macos-keychain, cargo:wincred. Support may be added later.
  • Decorator (mouseover popup) fields View Crate, Check review and Doc are hidden for crates that are on alternate registries.
  • Default behavior is to ignore crates that have an alternate registry :
    • If a crate have an alternate registry, but it could not be found in config.toml, just ignore it without error, and do NOT use indexServerURL as a fallback registry.
    • If the registry is found, then fetch versions on this registry.
  • I've added a script (./sample/alternate-registry.sh) to facilitate testing with alternate registries, for development purposes only.

Other modifications :

  • I removed src/api/crates-index-server.ts as it was not used anymore
  • I removed isSparseCompatible() as it was not used anymore

Fixes serayuzgur/crates#213
Fixes serayuzgur/crates#182

@BarbossHack
Copy link
Owner Author

Fixes serayuzgur/crates#233

@BarbossHack
Copy link
Owner Author

Fixes serayuzgur/crates#217

@BarbossHack BarbossHack merged commit b89ffd0 into master Jun 29, 2024
@serayuzgur
Copy link
Contributor

Hello,
Congratulations for these features . As you can see, I rebrand the extension now we got more language support refactored all the code and more.

You can also check the new code base if it is compatible what you did or not.
If you have any questions, you are welcome

@BarbossHack BarbossHack deleted the alternate-registries branch June 29, 2024 20:25
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.

Support for multiple registries! Support for private registries
2 participants