List Grants
curl --request GET \
--url https://{deployment}/v1/grants \
--header 'Authorization: Bearer <token>'import requests
url = "https://{deployment}/v1/grants"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://{deployment}/v1/grants', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://{deployment}/v1/grants",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://{deployment}/v1/grants"
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))
}HttpResponse<String> response = Unirest.get("https://{deployment}/v1/grants")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://{deployment}/v1/grants")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"grants": [
{
"id": "<string>",
"enforcement_mode": "observe",
"canary_percent": 123,
"issued_against_provenance": "<string>",
"agent_id": "<string>",
"kind": "<string>",
"environment": "<string>",
"principal_type": "<string>",
"principal_id": "<string>",
"parent_grant_id": "<string>",
"depth": 123,
"scope": {},
"audience": "<string>",
"policy": "<string>",
"policy_rendering": "<string>",
"budget_amount_minor": 123,
"budget_currency": "<string>",
"spent_amount_minor": 123,
"budget_count": 123,
"spent_count": 123,
"created_at": "2023-11-07T05:31:56Z",
"not_before": "2023-11-07T05:31:56Z",
"not_after": "2023-11-07T05:31:56Z",
"conditions": {},
"delegation_policy": "<string>",
"status": "<string>",
"held_amount_minor": 0,
"held_count": 0,
"pending_reason": "<string>",
"revoked_at": "2023-11-07T05:31:56Z",
"revoked_by": "<string>",
"revoked_by_email": "<string>",
"revocation_reason": "<string>"
}
],
"total": 123,
"limit": 123,
"offset": 123,
"has_more": false
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>",
"input": "<unknown>",
"ctx": {}
}
]
}Authority
List Grants
A page of the workspace’s grants, and the size of the set it came from.
Who may call it: any role. A workspace API key is refused here: this is an act that belongs to a named person.
GET
/
v1
/
grants
List Grants
curl --request GET \
--url https://{deployment}/v1/grants \
--header 'Authorization: Bearer <token>'import requests
url = "https://{deployment}/v1/grants"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://{deployment}/v1/grants', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://{deployment}/v1/grants",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://{deployment}/v1/grants"
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))
}HttpResponse<String> response = Unirest.get("https://{deployment}/v1/grants")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://{deployment}/v1/grants")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"grants": [
{
"id": "<string>",
"enforcement_mode": "observe",
"canary_percent": 123,
"issued_against_provenance": "<string>",
"agent_id": "<string>",
"kind": "<string>",
"environment": "<string>",
"principal_type": "<string>",
"principal_id": "<string>",
"parent_grant_id": "<string>",
"depth": 123,
"scope": {},
"audience": "<string>",
"policy": "<string>",
"policy_rendering": "<string>",
"budget_amount_minor": 123,
"budget_currency": "<string>",
"spent_amount_minor": 123,
"budget_count": 123,
"spent_count": 123,
"created_at": "2023-11-07T05:31:56Z",
"not_before": "2023-11-07T05:31:56Z",
"not_after": "2023-11-07T05:31:56Z",
"conditions": {},
"delegation_policy": "<string>",
"status": "<string>",
"held_amount_minor": 0,
"held_count": 0,
"pending_reason": "<string>",
"revoked_at": "2023-11-07T05:31:56Z",
"revoked_by": "<string>",
"revoked_by_email": "<string>",
"revocation_reason": "<string>"
}
],
"total": 123,
"limit": 123,
"offset": 123,
"has_more": false
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>",
"input": "<unknown>",
"ctx": {}
}
]
}