Asma Rahim
08/01/2022, 11:10 AMAlex Olivier (Cerbos)
Charith (Cerbos)
pw script?Asma Rahim
08/02/2022, 4:20 AMpw script. I used this command to install
./pw installAsma Rahim
08/02/2022, 6:50 AMCharith (Cerbos)
Charith (Cerbos)
Asma Rahim
08/02/2022, 7:36 AMCharith (Cerbos)
Asma Rahim
08/02/2022, 8:04 AMAsma Rahim
08/02/2022, 8:04 AMCharith (Cerbos)
pw script is a Python script itself so it probably uses the global Python interpreter during bootstrap to setup the virtual env and other things. IIRC, Python 3.10 had some backward incompatible changes so that could be why you're getting those errors.Asma Rahim
08/02/2022, 8:22 AMAsma Rahim
08/02/2022, 8:23 AMCharith (Cerbos)
Asma Rahim
08/02/2022, 12:05 PMAsma Rahim
08/02/2022, 12:06 PMAlex Olivier (Cerbos)
Alex Olivier (Cerbos)
Asma Rahim
08/02/2022, 12:07 PMAlex Olivier (Cerbos)
Asma Rahim
08/02/2022, 12:08 PMAlex Olivier (Cerbos)
Alex Olivier (Cerbos)
Asma Rahim
08/02/2022, 12:09 PMAlex Olivier (Cerbos)
@cerbos/httpAlex Olivier (Cerbos)
Asma Rahim
08/02/2022, 12:10 PMAlex Olivier (Cerbos)
Alex Olivier (Cerbos)
Asma Rahim
08/02/2022, 12:15 PMAlex Olivier (Cerbos)
Asma Rahim
08/02/2022, 12:16 PMAsma Rahim
08/02/2022, 12:16 PMAlex Olivier (Cerbos)
Asma Rahim
08/02/2022, 1:09 PMAsma Rahim
08/03/2022, 1:18 PM@cerbos/http
import { HTTP } from "@cerbos/http";
const cerbos = new HTTP("<http://localhost:3592>");
await cerbos.isAllowed({
principal: { id: "<mailto:user@example.com|user@example.com>", roles: ["USER"] },
resource: { kind: "document", id: "1" },
action: "view",
}); // => trueAsma Rahim
08/03/2022, 1:19 PMactions as an array ["eat", "sleep", "repeat"]
Is there any documentation for this SDK besides the readme on github?Alex Olivier (Cerbos)
Asma Rahim
08/03/2022, 1:19 PMAlex Olivier (Cerbos)
Alex Olivier (Cerbos)
Alex Olivier (Cerbos)
Asma Rahim
08/03/2022, 1:40 PMAsma Rahim
08/03/2022, 1:41 PM/api/check_resource_batchAlex Olivier (Cerbos)
Alex Olivier (Cerbos)
Alex Olivier (Cerbos)
const decision = await cerbos.checkResources({
principal: { id: "<mailto:user@example.com|user@example.com>", roles: ["USER"] },
resources: [
{
resource: { kind: "document", id: "1" },
actions: ["view", "edit"],
},
{
resource: { kind: "image", id: "1" },
actions: ["delete"],
},
],
});
decision.isAllowed({
resource: { kind: "document", id: "1" },
action: "view",
}); // => true