Skip to content
This repository has been archived by the owner on Jul 1, 2024. It is now read-only.

Latest commit

 

History

History
66 lines (49 loc) · 1.19 KB

USAGE.md

File metadata and controls

66 lines (49 loc) · 1.19 KB
import { OpaApiClient } from "@styra/opa";
import { GzipAcceptEncoding } from "@styra/opa/sdk/models/components";

const opaApiClient = new OpaApiClient();

async function run() {
    const result = await opaApiClient.executeDefaultPolicyWithInput(
        8203.11,
        false,
        GzipAcceptEncoding.Gzip
    );

    // Handle the result
    console.log(result);
}

run();
import { OpaApiClient } from "@styra/opa";

const opaApiClient = new OpaApiClient();

async function run() {
    const result = await opaApiClient.executeBatchPolicyWithInput({
        path: "app/rbac",
        requestBody: {
            inputs: {
                key: "<value>",
            },
        },
    });

    // Handle the result
    console.log(result);
}

run();
import { OpaApiClient } from "@styra/opa";

const opaApiClient = new OpaApiClient();

async function run() {
    const result = await opaApiClient.executePolicyWithInput({
        path: "app/rbac",
        requestBody: {
            input: false,
        },
    });

    // Handle the result
    console.log(result);
}

run();