Govern an asset (owner, environment, criticality)
curl --request PATCH \
--url https://app.trustivan.com/api/v1/assets/{id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"owner": "<string>"
}
'import requests
url = "https://app.trustivan.com/api/v1/assets/{id}"
payload = { "owner": "<string>" }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({owner: '<string>'})
};
fetch('https://app.trustivan.com/api/v1/assets/{id}', 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/assets/{id}"
payload := strings.NewReader("{\n \"owner\": \"<string>\"\n}")
req, _ := http.NewRequest("PATCH", 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",
"kind": "container_image",
"identity": "<string>",
"name": "<string>",
"registry": "<string>",
"repository": "<string>",
"tag": "<string>",
"last_digest": "<string>",
"operating_system": "<string>",
"attributes": {},
"discovery_source": "scan",
"environment": "unknown",
"criticality": "unknown",
"owner": "<string>",
"first_seen_at": "2023-11-07T05:31:56Z",
"last_seen_at": "2023-11-07T05:31:56Z",
"last_scanned_at": "2023-11-07T05:31:56Z",
"archived_at": "2023-11-07T05:31:56Z",
"archived_reason": "<string>",
"archived_by": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z"
}{
"error": "<string>",
"code": "validation_failed",
"required_scope": "<string>",
"principal": "user"
}{
"error": "<string>",
"code": "validation_failed",
"required_scope": "<string>",
"principal": "user"
}{
"error": "<string>",
"code": "validation_failed",
"required_scope": "<string>",
"principal": "user"
}Govern an asset (owner, environment, criticality)
PATCH rather than PUT because the three fields are independent: a PUT would force a caller to resend all of them to change one, and the first caller to omit a field would silently clear it.
An absent field is left alone. owner set to an empty string clears
the owner; environment and criticality have no cleared state and
return to their unknown member instead.
Requires assets:write.
PATCH
/
assets
/
{id}
Govern an asset (owner, environment, criticality)
curl --request PATCH \
--url https://app.trustivan.com/api/v1/assets/{id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"owner": "<string>"
}
'import requests
url = "https://app.trustivan.com/api/v1/assets/{id}"
payload = { "owner": "<string>" }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({owner: '<string>'})
};
fetch('https://app.trustivan.com/api/v1/assets/{id}', 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/assets/{id}"
payload := strings.NewReader("{\n \"owner\": \"<string>\"\n}")
req, _ := http.NewRequest("PATCH", 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",
"kind": "container_image",
"identity": "<string>",
"name": "<string>",
"registry": "<string>",
"repository": "<string>",
"tag": "<string>",
"last_digest": "<string>",
"operating_system": "<string>",
"attributes": {},
"discovery_source": "scan",
"environment": "unknown",
"criticality": "unknown",
"owner": "<string>",
"first_seen_at": "2023-11-07T05:31:56Z",
"last_seen_at": "2023-11-07T05:31:56Z",
"last_scanned_at": "2023-11-07T05:31:56Z",
"archived_at": "2023-11-07T05:31:56Z",
"archived_reason": "<string>",
"archived_by": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z"
}{
"error": "<string>",
"code": "validation_failed",
"required_scope": "<string>",
"principal": "user"
}{
"error": "<string>",
"code": "validation_failed",
"required_scope": "<string>",
"principal": "user"
}{
"error": "<string>",
"code": "validation_failed",
"required_scope": "<string>",
"principal": "user"
}Authorizations
Body
application/json
The customer's own judgements about an asset. Every field is optional and an absent one is left unchanged; at least one must be present.
Response
The updated asset.
The thing being protected. Not a scan and not a build: if a rebuild produced a new asset, every finding would look new and every triage decision would be discarded on deploy.