Note
From Artifactory version 7.58.x, the default method for Cargo indexing is sparse indexing. However, If you are using an Artifactory earlier than 7.46.3, or a Cargo client earlier than 1.60, you may need to use Cargo Git Indexing.
To configure the Cargo client to work opposite JFrog Artifactory using Git indexing:
Edit the configuration file under your Cargo home directory (for example
~/.cargo/config.toml):# Makes artifactory the default registry and saves passing --registry parameter [registry] default = "artifactory" [registries.artifactory] index = "https://company.jfrog.io/artifactory/git/bank32-cargo-local-2.git" # For sending credentials in git requests. # Not required if anonymous access is enabled [net] git-fetch-with-cli = trueTo set your credentials for API calls such as
publishandyank, add the following section to the credentials file under your Cargo home directory (for example~/.cargo/credentials.toml):[registries.artifactory] token = "<identity_token>"
Git Support for Cargo Repositories
As the Cargo Client requires the Cargo registry to be a Git repository, the following Git support has been applied in Artifactory:
An internal
.gitfolder exists for each Cargo repository to reflect the index.gitfiles. This folder is recreated after every reindexing process.An internal
gitdirectory in theDatadirectory of Artifactory has been added for each Cargo repository. This is a local clone that will be recreated following each restart or repository init.