You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The examples in this document are generic. Cloudsmith provides contextual setup instructions within each repository, complete with copy and paste snippets (with your namespace/repo/rsa-key pre-configured).
19
17
</Note>
@@ -57,26 +55,34 @@ The setup method will differ depending on what authentication type you choose to
57
55
Entitlement Tokens, User Credentials and API-Keys should be treated as secrets, and you should ensure that you do not commit them in configurations files along with source code, or expose them in any logs.
58
56
</Note>
59
57
60
-
```text Entitlement Token Auth
58
+
```toml
59
+
# Entitlement Token Auth
61
60
[registries]
62
61
REGISTRY_NAME = { index = "https://dl.cloudsmith.io/TOKEN/OWNER/REPOSITORY/cargo/index.git" }
63
62
```
64
-
```toml HTTP Basic Auth
63
+
64
+
```toml
65
+
# HTTP Basic Auth
65
66
[registries]
66
67
REGISTRY_NAME = { index = "https://dl.cloudsmith.io/basic/OWNER/REPOSITORY/cargo/index.git" }
67
68
```
68
69
69
70
If using HTTP basic authentication, you'll need to configure Git with credentials. Git's standard authentication mechanisms are used by Cargo and can be configured in the normal way. For example, you could use git's per-user credential store as follows:
If you haven't specified credentials using one of the methods above, you'll be asked to provide them using `cargo login`.
108
114
109
-
You can also set the following environment variables:
110
-
`CARGO_REGISTRIES_<REGISTRY_NAME>_INDEX` - instead of setting the registry URL in `~/.cargo/config`
111
-
`CARGO_REGISTRIES_<REGISTRY_NAME>_TOKEN` - instead of providing credentials via `cargo login` or writing them to `~/.cargo/credentials`:
115
+
Instead of usign the previous authentication methods, you can also set the following environment variables to define your index and token:
116
+
-`CARGO_REGISTRIES_<REGISTRY_NAME>_INDEX`
117
+
-`CARGO_REGISTRIES_<REGISTRY_NAME>_TOKEN`
118
+
119
+
Remember to rename the variable with your registry name.
112
120
113
121
### Upload via the Cloudsmith CLI
114
122
@@ -132,6 +140,14 @@ Please see [Upload a Package](/artifact-management/package-upload) for details o
132
140
133
141
## Download a Package
134
142
143
+
### Configure a new Upstream
144
+
145
+
Cloudsmith supports [https://index.crates.io](https://index.crates.io) as an upstream. This allows you to proxy and cache external Rust crates that are not part of your repository.
146
+
147
+
To enable the upstream, browse to your repository overview page and click in the Upstreams tab. Then, click on **+ Add Upstream Proxy** and then choose the **Cargo** Upstream.
148
+
149
+
In the Upstream creation menu, define a name your Upstream and in the **Proxy URL** field insert `https://index.crates.io/`. Click on **+ Create Upstream Proxy** and the upstream should become immediately available.
150
+
135
151
### Registry Setup
136
152
137
153
It is easy to add a Cloudsmith-based Cargo registry.
@@ -176,7 +192,7 @@ OWNER-REPOSITORY = { index = "https://dl.cloudsmith.io/basic/OWNER/REPOSITORY/ca
176
192
OWNER-REPOSITORY = { index = "https://dl.cloudsmith.io/TOKEN/OWNER/REPOSITORY/cargo/index.git" }
177
193
```
178
194
179
-
## Registry Authentication
195
+
###Registry Authentication
180
196
181
197
You must configure Git with the proper credentials to clone the registry when using HTTP basic authentication. Git's standard authentication mechanisms are used by Cargo and can be configured normally. For example, you could use git's per-user credential store like so:
When you install a Cargo package, `cargo` will assume that all dependencies are available in your Cloudsmith repository. You can configure your Cloudsmith repository to fetch any dependencies from crates.io that are not already present. See the repository [Main Settings](/repositories/repository-settings) for further information.
219
-
</Note>
226
+
<span class="cs-tag cs-tag-dark-green">Supported.</span> Please see our [Security Scanning](/policy-management/security-scanning) documentation for further information.
220
227
221
228
## Key Signing Support
222
229
223
-
<span class="cs-tag cs-tag-dark-grey">Not Supported by Format</span>
0 commit comments