curl --request PUT \
--url https://app.trustivan.com/api/v1/registry-credentials/{id}/enabled \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"enabled": true
}
'import requests
url = "https://app.trustivan.com/api/v1/registry-credentials/{id}/enabled"
payload = { "enabled": True }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({enabled: true})
};
fetch('https://app.trustivan.com/api/v1/registry-credentials/{id}/enabled', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://app.trustivan.com/api/v1/registry-credentials/{id}/enabled"
payload := strings.NewReader("{\n \"enabled\": true\n}")
req, _ := http.NewRequest("PUT", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>",
"kind": "registry",
"registry": "ghcr.io",
"scheme": "basic",
"status": "unverified",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"username": "<string>",
"external_id": "<string>",
"status_reason": "<string>",
"last_verified_at": "2023-11-07T05:31:56Z",
"last_used_at": "2023-11-07T05:31:56Z",
"rotated_at": "2023-11-07T05:31:56Z",
"created_by": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}Disable or re-enable a registry credential
Separate from deletion because “stop using this now, decide later” and “this is gone” are different decisions with different reversibility, and a customer responding to a suspected leak at 2am needs the reversible one.
Re-enabling returns the credential to unverified rather than to
active: whatever was true when it was disabled has not been true
since.
curl --request PUT \
--url https://app.trustivan.com/api/v1/registry-credentials/{id}/enabled \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"enabled": true
}
'import requests
url = "https://app.trustivan.com/api/v1/registry-credentials/{id}/enabled"
payload = { "enabled": True }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({enabled: true})
};
fetch('https://app.trustivan.com/api/v1/registry-credentials/{id}/enabled', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://app.trustivan.com/api/v1/registry-credentials/{id}/enabled"
payload := strings.NewReader("{\n \"enabled\": true\n}")
req, _ := http.NewRequest("PUT", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>",
"kind": "registry",
"registry": "ghcr.io",
"scheme": "basic",
"status": "unverified",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"username": "<string>",
"external_id": "<string>",
"status_reason": "<string>",
"last_verified_at": "2023-11-07T05:31:56Z",
"last_used_at": "2023-11-07T05:31:56Z",
"rotated_at": "2023-11-07T05:31:56Z",
"created_by": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}Authorizations
Response
Updated.
A stored registry credential, without its secret. There is no read path for the plaintext at any permission, so no response anywhere carries one. A customer who has lost their token rotates it.
registry for a credential served by /registry-credentials,
git for one served by /git-credentials. The listings return
only their own kind, but the routes that take an {id} reach any
credential the organization holds, so rotating the credential
behind a cloud account or a cluster answers with cloud or
kubernetes. The two surfaces share
this schema and are separate stores: github.com serves both a
registry and a repository host, the tokens differ, and they are
rotated on different schedules.
registry, git, cloud, kubernetes The canonicalised host this credential authenticates to, such as
ghcr.io or registry.example.com:5000, or github.com or
bitbucket.example.com:8443 for a git credential. Also the
matching key: a credential is selected for a scan by the host of
the image or repository being scanned, never named by the caller.
"ghcr.io"
unverified has never authenticated, active last did so
successfully, invalid was rejected by the registry, disabled
was switched off by an administrator. A timeout or an unreachable
host leaves the status untouched rather than marking it invalid.
unverified, active, invalid, disabled Stored in plaintext deliberately: it is not a secret, and it is
what makes "which account is this" answerable. What it holds
depends on the scheme: a username for basic, the role ARN for
assume_role, the access key id for aws_access_key,
<tenant-id>/<client-id> for azure_service_principal. Absent for
token, bearer and gcp_service_account.