curl --request POST \
--url https://use.hoop.dev/api/sidecars/reviews \
--header 'Content-Type: application/json' \
--header 'hoop-sidecar-token: <hoop-sidecar-token>' \
--data '
{
"listener_name": "appdb",
"payload": "REVMRVRFIEZST00gdXNlcnM7"
}
'import requests
url = "https://use.hoop.dev/api/sidecars/reviews"
payload = {
"listener_name": "appdb",
"payload": "REVMRVRFIEZST00gdXNlcnM7"
}
headers = {
"hoop-sidecar-token": "<hoop-sidecar-token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
'hoop-sidecar-token': '<hoop-sidecar-token>',
'Content-Type': 'application/json'
},
body: JSON.stringify({listener_name: 'appdb', payload: 'REVMRVRFIEZST00gdXNlcnM7'})
};
fetch('https://use.hoop.dev/api/sidecars/reviews', 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://use.hoop.dev/api/sidecars/reviews",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'listener_name' => 'appdb',
'payload' => 'REVMRVRFIEZST00gdXNlcnM7'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"hoop-sidecar-token: <hoop-sidecar-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"
"strings"
"net/http"
"io"
)
func main() {
url := "https://use.hoop.dev/api/sidecars/reviews"
payload := strings.NewReader("{\n \"listener_name\": \"appdb\",\n \"payload\": \"REVMRVRFIEZST00gdXNlcnM7\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("hoop-sidecar-token", "<hoop-sidecar-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))
}HttpResponse<String> response = Unirest.post("https://use.hoop.dev/api/sidecars/reviews")
.header("hoop-sidecar-token", "<hoop-sidecar-token>")
.header("Content-Type", "application/json")
.body("{\n \"listener_name\": \"appdb\",\n \"payload\": \"REVMRVRFIEZST00gdXNlcnM7\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://use.hoop.dev/api/sidecars/reviews")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["hoop-sidecar-token"] = '<hoop-sidecar-token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"listener_name\": \"appdb\",\n \"payload\": \"REVMRVRFIEZST00gdXNlcnM7\"\n}"
response = http.request(request)
puts response.read_body{
"access_duration": 0,
"access_request_rule_name": "default-access-request-rule",
"created_at": "2024-07-25T15:56:35.317601Z",
"force_approval_groups": [
"sre-team"
],
"id": "9F9745B4-C77B-4D52-84D3-E24F67E3623C",
"listener_name": "appdb",
"min_approvals": 2,
"rejection_reason": "This command is not allowed in production.",
"review_groups_data": [
{
"forced_review": false,
"group": "sre",
"id": "20A5AABE-C35D-4F04-A5A7-C856EE6C7703",
"review_date": "2024-07-25T19:36:41Z",
"reviewed_by": {
"email": "john.wick@bad.org",
"id": "D5BFA2DD-7A09-40AE-AFEB-C95787BA9E90",
"name": "John Wick",
"slack_id": "U053ELZHB53"
},
"status": "APPROVED"
}
],
"revoke_at": "",
"session": "35DB0A2F-E5CE-4AD8-A308-55C3108956E5",
"sidecar_id": "5F5E5C6E-6C3A-4E9A-9E8B-2D6A7F1B0C4D",
"status": "PENDING",
"time_window": {
"configuration": {
"end_time": "18:00",
"start_time": "09:00"
},
"type": "time_range"
},
"type": "onetime"
}{
"message": "the error description"
}{
"message": "the error description"
}{
"message": "the error description"
}{
"message": "the error description"
}{
"message": "the error description"
}Create Sidecar Review
Register a review for a statement a sidecar held. The sidecar is taken from the token, never the body.
curl --request POST \
--url https://use.hoop.dev/api/sidecars/reviews \
--header 'Content-Type: application/json' \
--header 'hoop-sidecar-token: <hoop-sidecar-token>' \
--data '
{
"listener_name": "appdb",
"payload": "REVMRVRFIEZST00gdXNlcnM7"
}
'import requests
url = "https://use.hoop.dev/api/sidecars/reviews"
payload = {
"listener_name": "appdb",
"payload": "REVMRVRFIEZST00gdXNlcnM7"
}
headers = {
"hoop-sidecar-token": "<hoop-sidecar-token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
'hoop-sidecar-token': '<hoop-sidecar-token>',
'Content-Type': 'application/json'
},
body: JSON.stringify({listener_name: 'appdb', payload: 'REVMRVRFIEZST00gdXNlcnM7'})
};
fetch('https://use.hoop.dev/api/sidecars/reviews', 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://use.hoop.dev/api/sidecars/reviews",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'listener_name' => 'appdb',
'payload' => 'REVMRVRFIEZST00gdXNlcnM7'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"hoop-sidecar-token: <hoop-sidecar-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"
"strings"
"net/http"
"io"
)
func main() {
url := "https://use.hoop.dev/api/sidecars/reviews"
payload := strings.NewReader("{\n \"listener_name\": \"appdb\",\n \"payload\": \"REVMRVRFIEZST00gdXNlcnM7\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("hoop-sidecar-token", "<hoop-sidecar-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))
}HttpResponse<String> response = Unirest.post("https://use.hoop.dev/api/sidecars/reviews")
.header("hoop-sidecar-token", "<hoop-sidecar-token>")
.header("Content-Type", "application/json")
.body("{\n \"listener_name\": \"appdb\",\n \"payload\": \"REVMRVRFIEZST00gdXNlcnM7\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://use.hoop.dev/api/sidecars/reviews")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["hoop-sidecar-token"] = '<hoop-sidecar-token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"listener_name\": \"appdb\",\n \"payload\": \"REVMRVRFIEZST00gdXNlcnM7\"\n}"
response = http.request(request)
puts response.read_body{
"access_duration": 0,
"access_request_rule_name": "default-access-request-rule",
"created_at": "2024-07-25T15:56:35.317601Z",
"force_approval_groups": [
"sre-team"
],
"id": "9F9745B4-C77B-4D52-84D3-E24F67E3623C",
"listener_name": "appdb",
"min_approvals": 2,
"rejection_reason": "This command is not allowed in production.",
"review_groups_data": [
{
"forced_review": false,
"group": "sre",
"id": "20A5AABE-C35D-4F04-A5A7-C856EE6C7703",
"review_date": "2024-07-25T19:36:41Z",
"reviewed_by": {
"email": "john.wick@bad.org",
"id": "D5BFA2DD-7A09-40AE-AFEB-C95787BA9E90",
"name": "John Wick",
"slack_id": "U053ELZHB53"
},
"status": "APPROVED"
}
],
"revoke_at": "",
"session": "35DB0A2F-E5CE-4AD8-A308-55C3108956E5",
"sidecar_id": "5F5E5C6E-6C3A-4E9A-9E8B-2D6A7F1B0C4D",
"status": "PENDING",
"time_window": {
"configuration": {
"end_time": "18:00",
"start_time": "09:00"
},
"type": "time_range"
},
"type": "onetime"
}{
"message": "the error description"
}{
"message": "the error description"
}{
"message": "the error description"
}{
"message": "the error description"
}{
"message": "the error description"
}Headers
The token returned when the sidecar was created
Body
The request body resource
The sidecar listener the statement arrived on
Bounded because private.reviews.listener_name is VARCHAR(255): a longer name would reach Postgres and fail the write, rather than being told at the door that it is too long.
255"appdb"
The statement to review, base64 encoded
"REVMRVRFIEZST00gdXNlcnM7"
Response
Created
The amount of time (nanoseconds) to allow access to the connection. It's valid only for jit type reviews
0
The name of the access request rule that triggered this review, if null means it was triggered by the review plugin
"default-access-request-rule"
The time the resource was created
"2024-07-25T15:56:35.317601Z"
Groups that can force approve sessions for this review
["sre-team"]
Resource identifier
"9F9745B4-C77B-4D52-84D3-E24F67E3623C"
The sidecar listener this review is bound to. Absent on a review that came from a connection
"appdb"
The minimum number of approvals required for this review
2
The reason provided by the reviewer when rejecting this review
"This command is not allowed in production."
Contains the groups that requires to approve this review
Show child attributes
Show child attributes
The time when this review was revoked
""
The id of session
"35DB0A2F-E5CE-4AD8-A308-55C3108956E5"
The sidecar that filed this review. Absent on a review that came from a connection
"5F5E5C6E-6C3A-4E9A-9E8B-2D6A7F1B0C4D"
The status of the review
- PENDING - The resource is waiting to be reviewed
- APPROVED - The resource is fully approved
- REJECTED - The resource is fully rejected
- REVOKED - The resource was revoked after being approved
- PROCESSING - The review is being executed
- EXECUTED - The review was executed
- UNKNOWN - Unable to know the status of the review
PENDING, APPROVED, REJECTED, REVOKED, PROCESSING, EXECUTED, UNKNOWN The time window configuration that can execute the session
Show child attributes
Show child attributes
The type of the review
- onetime - Represents a one time execution
- jit - Represents a time based review
onetime, jit Was this page helpful?