Walk the estate graph from one asset
curl --request GET \
--url https://app.trustivan.com/api/v1/assets/{id}/graph \
--header 'Authorization: Bearer <token>'import requests
url = "https://app.trustivan.com/api/v1/assets/{id}/graph"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://app.trustivan.com/api/v1/assets/{id}/graph', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://app.trustivan.com/api/v1/assets/{id}/graph"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}{
"origin": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"direction": "up",
"depth": 123,
"nodes": [
{
"asset_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"kind": "<string>",
"name": "<string>",
"identity": "<string>",
"environment": "<string>",
"criticality": "<string>",
"depth": 123,
"relationship": "<string>",
"via": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"source": "<string>"
}
]
}{
"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"
}Walk the estate graph from one asset
Multi-hop traversal, which the one-level relationships endpoint cannot do. “Is this vulnerable image actually running?” is image -> workload -> cluster: answering it from the adjacent-edges endpoint costs one request per node.
direction is required and not defaulted, because up and down answer
different questions and a default would silently hand half of callers
the other one’s answer. depth is clamped to the server maximum rather
than refused, and the response reports the depth actually walked.
The walk is cycle-safe: an estate graph is customer-controlled data, and two assets that describe each other are legal.
GET
/
assets
/
{id}
/
graph
Walk the estate graph from one asset
curl --request GET \
--url https://app.trustivan.com/api/v1/assets/{id}/graph \
--header 'Authorization: Bearer <token>'import requests
url = "https://app.trustivan.com/api/v1/assets/{id}/graph"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://app.trustivan.com/api/v1/assets/{id}/graph', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://app.trustivan.com/api/v1/assets/{id}/graph"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}{
"origin": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"direction": "up",
"depth": 123,
"nodes": [
{
"asset_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"kind": "<string>",
"name": "<string>",
"identity": "<string>",
"environment": "<string>",
"criticality": "<string>",
"depth": 123,
"relationship": "<string>",
"via": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"source": "<string>"
}
]
}{
"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
Query Parameters
Response
The nodes reached, shallowest arrival per node.