Skip to content

Commit

Permalink
chore: support new authz API
Browse files Browse the repository at this point in the history
  • Loading branch information
davidlougheed committed Nov 13, 2023
1 parent 0a3b2f7 commit 6d3053e
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/auth.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -13,16 +13,16 @@ export const checkAgainstAuthorizationService = async (token) => {
}

try {
const res = await fetch(`${BENTO_AUTHZ_SERVICE_URL}policy/evaluate`, {
const res = await fetch(`${BENTO_AUTHZ_SERVICE_URL}policy/evaluate_one`, {
method: "POST",
headers: {
"Authorization": `Bearer ${token}`,
"Content-Type": "application/json",
},
body: JSON.stringify({
requested_resource: {everything: true},
resource: {everything: true},
// TODO: granular permissions + message filtering instead:
required_permissions: ["view:private_portal"],
permission: "view:private_portal",
}),
agent: httpsAgent,
});
Expand Down

0 comments on commit 6d3053e

Please sign in to comment.