Skip to content

Commit

Permalink
Merge pull request #13 from bento-platform/feat/authz
Browse files Browse the repository at this point in the history
chore: support new authz API
  • Loading branch information
davidlougheed authored Nov 13, 2023
2 parents 0a3b2f7 + cd8233c commit 93b7e28
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "bento_event_relay",
"version": "3.0.2",
"version": "3.1.0",
"description": "Event relay service from Redis PubSub to socket.io",
"main": "src/index.mjs",
"scripts": {
Expand Down
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 93b7e28

Please sign in to comment.