Record a pipeline gate run
curl --request POST \
--url https://app.trustivan.com/api/v1/certificates/gates \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"failed": true,
"repository": "<string>",
"ref": "<string>",
"commit": "<string>",
"run_url": "<string>",
"hosts": [
{
"host": "<string>",
"port": 123,
"file": "<string>",
"object": "<string>",
"sha256": "<string>",
"error": "<string>",
"not_after": "2023-11-07T05:31:56Z",
"issuer": "<string>",
"failed": true,
"findings": [
{
"check": "<string>",
"title": "<string>",
"evidence": "<string>"
}
]
}
],
"files": [
{
"host": "<string>",
"port": 123,
"file": "<string>",
"object": "<string>",
"sha256": "<string>",
"error": "<string>",
"not_after": "2023-11-07T05:31:56Z",
"issuer": "<string>",
"failed": true,
"findings": [
{
"check": "<string>",
"title": "<string>",
"evidence": "<string>"
}
]
}
]
}
'import requests
url = "https://app.trustivan.com/api/v1/certificates/gates"
payload = {
"failed": True,
"repository": "<string>",
"ref": "<string>",
"commit": "<string>",
"run_url": "<string>",
"hosts": [
{
"host": "<string>",
"port": 123,
"file": "<string>",
"object": "<string>",
"sha256": "<string>",
"error": "<string>",
"not_after": "2023-11-07T05:31:56Z",
"issuer": "<string>",
"failed": True,
"findings": [
{
"check": "<string>",
"title": "<string>",
"evidence": "<string>"
}
]
}
],
"files": [
{
"host": "<string>",
"port": 123,
"file": "<string>",
"object": "<string>",
"sha256": "<string>",
"error": "<string>",
"not_after": "2023-11-07T05:31:56Z",
"issuer": "<string>",
"failed": True,
"findings": [
{
"check": "<string>",
"title": "<string>",
"evidence": "<string>"
}
]
}
]
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
failed: true,
repository: '<string>',
ref: '<string>',
commit: '<string>',
run_url: '<string>',
hosts: [
{
host: '<string>',
port: 123,
file: '<string>',
object: '<string>',
sha256: '<string>',
error: '<string>',
not_after: '2023-11-07T05:31:56Z',
issuer: '<string>',
failed: true,
findings: [{check: '<string>', title: '<string>', evidence: '<string>'}]
}
],
files: [
{
host: '<string>',
port: 123,
file: '<string>',
object: '<string>',
sha256: '<string>',
error: '<string>',
not_after: '2023-11-07T05:31:56Z',
issuer: '<string>',
failed: true,
findings: [{check: '<string>', title: '<string>', evidence: '<string>'}]
}
]
})
};
fetch('https://app.trustivan.com/api/v1/certificates/gates', 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/certificates/gates"
payload := strings.NewReader("{\n \"failed\": true,\n \"repository\": \"<string>\",\n \"ref\": \"<string>\",\n \"commit\": \"<string>\",\n \"run_url\": \"<string>\",\n \"hosts\": [\n {\n \"host\": \"<string>\",\n \"port\": 123,\n \"file\": \"<string>\",\n \"object\": \"<string>\",\n \"sha256\": \"<string>\",\n \"error\": \"<string>\",\n \"not_after\": \"2023-11-07T05:31:56Z\",\n \"issuer\": \"<string>\",\n \"failed\": true,\n \"findings\": [\n {\n \"check\": \"<string>\",\n \"title\": \"<string>\",\n \"evidence\": \"<string>\"\n }\n ]\n }\n ],\n \"files\": [\n {\n \"host\": \"<string>\",\n \"port\": 123,\n \"file\": \"<string>\",\n \"object\": \"<string>\",\n \"sha256\": \"<string>\",\n \"error\": \"<string>\",\n \"not_after\": \"2023-11-07T05:31:56Z\",\n \"issuer\": \"<string>\",\n \"failed\": true,\n \"findings\": [\n {\n \"check\": \"<string>\",\n \"title\": \"<string>\",\n \"evidence\": \"<string>\"\n }\n ]\n }\n ]\n}")
req, _ := http.NewRequest("POST", 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))
}{
"gate": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"repository": "<string>",
"ref": "<string>",
"commit": "<string>",
"run_url": "<string>",
"failed": true,
"results": [
{
"host": "<string>",
"port": 123,
"file": "<string>",
"object": "<string>",
"sha256": "<string>",
"error": "<string>",
"not_after": "2023-11-07T05:31:56Z",
"issuer": "<string>",
"failed": true,
"findings": [
{
"check": "<string>",
"severity": "low",
"title": "<string>",
"evidence": "<string>"
}
]
}
],
"fingerprints": [
"<string>"
],
"failed_fingerprints": [
"<string>"
],
"created_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"
}{
"error": "<string>",
"code": "validation_failed",
"required_scope": "<string>",
"principal": "user"
}Record a pipeline gate run
Stores one tls-check run’s JSON result (hosts and files, as
tls-check -json prints them) with where it ran. At most 512 KiB, 500
results and 32 findings per result; the organization keeps its newest
500 runs. A result’s sha256 links it to the inventory’s certificate
with that fingerprint. Requires scans:create, the scope a CI key
already holds.
POST
/
certificates
/
gates
Record a pipeline gate run
curl --request POST \
--url https://app.trustivan.com/api/v1/certificates/gates \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"failed": true,
"repository": "<string>",
"ref": "<string>",
"commit": "<string>",
"run_url": "<string>",
"hosts": [
{
"host": "<string>",
"port": 123,
"file": "<string>",
"object": "<string>",
"sha256": "<string>",
"error": "<string>",
"not_after": "2023-11-07T05:31:56Z",
"issuer": "<string>",
"failed": true,
"findings": [
{
"check": "<string>",
"title": "<string>",
"evidence": "<string>"
}
]
}
],
"files": [
{
"host": "<string>",
"port": 123,
"file": "<string>",
"object": "<string>",
"sha256": "<string>",
"error": "<string>",
"not_after": "2023-11-07T05:31:56Z",
"issuer": "<string>",
"failed": true,
"findings": [
{
"check": "<string>",
"title": "<string>",
"evidence": "<string>"
}
]
}
]
}
'import requests
url = "https://app.trustivan.com/api/v1/certificates/gates"
payload = {
"failed": True,
"repository": "<string>",
"ref": "<string>",
"commit": "<string>",
"run_url": "<string>",
"hosts": [
{
"host": "<string>",
"port": 123,
"file": "<string>",
"object": "<string>",
"sha256": "<string>",
"error": "<string>",
"not_after": "2023-11-07T05:31:56Z",
"issuer": "<string>",
"failed": True,
"findings": [
{
"check": "<string>",
"title": "<string>",
"evidence": "<string>"
}
]
}
],
"files": [
{
"host": "<string>",
"port": 123,
"file": "<string>",
"object": "<string>",
"sha256": "<string>",
"error": "<string>",
"not_after": "2023-11-07T05:31:56Z",
"issuer": "<string>",
"failed": True,
"findings": [
{
"check": "<string>",
"title": "<string>",
"evidence": "<string>"
}
]
}
]
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
failed: true,
repository: '<string>',
ref: '<string>',
commit: '<string>',
run_url: '<string>',
hosts: [
{
host: '<string>',
port: 123,
file: '<string>',
object: '<string>',
sha256: '<string>',
error: '<string>',
not_after: '2023-11-07T05:31:56Z',
issuer: '<string>',
failed: true,
findings: [{check: '<string>', title: '<string>', evidence: '<string>'}]
}
],
files: [
{
host: '<string>',
port: 123,
file: '<string>',
object: '<string>',
sha256: '<string>',
error: '<string>',
not_after: '2023-11-07T05:31:56Z',
issuer: '<string>',
failed: true,
findings: [{check: '<string>', title: '<string>', evidence: '<string>'}]
}
]
})
};
fetch('https://app.trustivan.com/api/v1/certificates/gates', 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/certificates/gates"
payload := strings.NewReader("{\n \"failed\": true,\n \"repository\": \"<string>\",\n \"ref\": \"<string>\",\n \"commit\": \"<string>\",\n \"run_url\": \"<string>\",\n \"hosts\": [\n {\n \"host\": \"<string>\",\n \"port\": 123,\n \"file\": \"<string>\",\n \"object\": \"<string>\",\n \"sha256\": \"<string>\",\n \"error\": \"<string>\",\n \"not_after\": \"2023-11-07T05:31:56Z\",\n \"issuer\": \"<string>\",\n \"failed\": true,\n \"findings\": [\n {\n \"check\": \"<string>\",\n \"title\": \"<string>\",\n \"evidence\": \"<string>\"\n }\n ]\n }\n ],\n \"files\": [\n {\n \"host\": \"<string>\",\n \"port\": 123,\n \"file\": \"<string>\",\n \"object\": \"<string>\",\n \"sha256\": \"<string>\",\n \"error\": \"<string>\",\n \"not_after\": \"2023-11-07T05:31:56Z\",\n \"issuer\": \"<string>\",\n \"failed\": true,\n \"findings\": [\n {\n \"check\": \"<string>\",\n \"title\": \"<string>\",\n \"evidence\": \"<string>\"\n }\n ]\n }\n ]\n}")
req, _ := http.NewRequest("POST", 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))
}{
"gate": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"repository": "<string>",
"ref": "<string>",
"commit": "<string>",
"run_url": "<string>",
"failed": true,
"results": [
{
"host": "<string>",
"port": 123,
"file": "<string>",
"object": "<string>",
"sha256": "<string>",
"error": "<string>",
"not_after": "2023-11-07T05:31:56Z",
"issuer": "<string>",
"failed": true,
"findings": [
{
"check": "<string>",
"severity": "low",
"title": "<string>",
"evidence": "<string>"
}
]
}
],
"fingerprints": [
"<string>"
],
"failed_fingerprints": [
"<string>"
],
"created_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"
}{
"error": "<string>",
"code": "validation_failed",
"required_scope": "<string>",
"principal": "user"
}Authorizations
Body
application/json