Skip to content

Commit

Permalink
add scopes
Browse files Browse the repository at this point in the history
  • Loading branch information
tdraier committed Nov 18, 2024
1 parent 8a9f80f commit 10a9a1a
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 4 deletions.
2 changes: 1 addition & 1 deletion extension/app/background.ts
Original file line number Diff line number Diff line change
Expand Up @@ -267,7 +267,7 @@ const authenticate = async (
client_id: AUTH0_CLIENT_ID,
response_type: "code",
scope:
"offline_access read:user_profile read:conversation create:conversation update:conversation read:agent",
"offline_access read:user_profile read:conversation create:conversation update:conversation read:agent read:file create:file delete:file",
redirect_uri: redirectUrl,
audience: DUST_API_AUDIENCE,
code_challenge_method: "S256",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -116,4 +116,5 @@ async function handler(

export default withPublicAPIAuthentication(handler, {
isStreaming: true,
requiredScopes: { POST: "update:conversation" },
});
Original file line number Diff line number Diff line change
Expand Up @@ -142,4 +142,6 @@ async function handler(
}
}

export default withPublicAPIAuthentication(handler);
export default withPublicAPIAuthentication(handler, {
requiredScopes: { POST: "update:conversation" },
});
8 changes: 7 additions & 1 deletion front/pages/api/v1/w/[wId]/files/[fileId].ts
Original file line number Diff line number Diff line change
Expand Up @@ -123,4 +123,10 @@ async function handler(
}
}

export default withPublicAPIAuthentication(handler);
export default withPublicAPIAuthentication(handler, {
requiredScopes: {
GET: "read:file",
POST: "create:file",
DELETE: "delete:file",
},
});
4 changes: 3 additions & 1 deletion front/pages/api/v1/w/[wId]/files/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -167,4 +167,6 @@ async function handler(
}
}

export default withPublicAPIAuthentication(handler);
export default withPublicAPIAuthentication(handler, {
requiredScopes: { POST: "create:file" },
});

0 comments on commit 10a9a1a

Please sign in to comment.