Skip to main content

Save a registry's credential

PUT 

/registry-credentials/:registry

Required role: admin. Only an account or token with the admin role can call this operation.

Example request
curl --request PUT \
--header "Authorization: Bearer $HOSERVA_TOKEN" \
--header "Content-Type: application/json" \
--data @body.json \
"https://$HOSERVA_HOST:8008/api/v1/registry-credentials/{registry}"

Saves the username and password the update check logs in to this registry with, replacing any it already has, sealed under the machine key. The password is write-only: no operation returns it and it is never logged. The credential is sent only to this registry's own host (and, for Docker Hub, its token service auth.docker.io), only over https, and never follows a redirect to another host or scheme; a registry whose address would send it in plain HTTP, or whose token service is on another host, is not logged in to and its images are reported failed. It is carried in a config archive's secrets.age, so a restore with the backup passphrase brings it back; without it the credential is cleared and the restore report names it. A host that is not a registry host name, or an empty username or password, a username with a colon, or a value with control characters is 400 invalid_registry_credential.

Request​

Responses​

The credential was saved.