Set artifact host credentials

PUT
/v1/{namespace}/config/{firewall}/upstreams/{id}/artifact-credentials/{host}

Sets the credentials used when an upstream's artifacts are downloaded from a different host than its index.

Authorization

headerAuthorizationBearer <token>

A personal or service access token, sent as Authorization: Bearer <token>. See access tokens.

Path Parameters

namespace*string

The namespace id.

firewall*string

The firewall id.

id*string

The upstream id.

host*string

The artifact host, e.g. files.example.com.

Request Body

application/json
  1. body

Write-only. In responses every value that is set is replaced by a redaction placeholder.

password?string

Password for HTTP Basic authentication.

token?string

Access token, usually sent as a bearer token. Used instead of the username and password when both are set.

username?string

Username for HTTP Basic authentication.

Response Body

The upstream, with its credentials redacted.

application/json
  1. response

A registry the firewall fetches packages from.

id*string

The upstream id, unique within the firewall.

endpoint*string

The registry's base URL.

credentials*

Credentials the firewall sends to the registry. Write-only: responses show a redaction placeholder for each value that is set. Change them with the set-credentials operation.

internal*boolean

Whether the registry hosts your own packages rather than public ones. Rules can target internal or external upstreams.

cached*boolean

Whether package metadata from this upstream is cached. Only internal upstreams can be cached.

artifactCredentials?array<>

Credentials for hosts the upstream's artifacts are downloaded from, when that is not the registry's own host.

curl -X PUT 'https://eu-sov-1.bytesafecloud.eu/v1/my-namespace-id/config/my-firewall-id/upstreams/string/artifact-credentials/string' \  -H 'Content-Type: application/json' \  -d '{  "token": "upstream-registry-token"}'
{  "id": "internal",  "endpoint": "https://npm.internal.example.com",  "credentials": {    "username": "1F56ED4E-D401-49E4-B40C-0B7B8411BAD6",    "password": "1F56ED4E-D401-49E4-B40C-0B7B8411BAD6"  },  "internal": true,  "cached": true,  "artifactCredentials": [    {      "host": "files.internal.example.com",      "credentials": {        "token": "1F56ED4E-D401-49E4-B40C-0B7B8411BAD6"      }    }  ]}