mirror of
https://github.com/paperclipai/paperclip.git
synced 2026-11-11 05:11:49 +01:00
fix(ci): align authz tests and e2e config
This commit is contained in:
1 parent
ea7066709b
commit
539b774491
2 files changed
+5
-1
No files matched your search
@@ -49,7 +49,8 @@ export function assertCompanyAccess(req: Request, companyId: string) {
|
||||
if (!allowedCompanies.includes(companyId)) {
|
||||
throw forbidden("User does not have access to this company");
|
||||
}
|
||||
const isSafeMethod = ["GET", "HEAD", "OPTIONS"].includes(req.method.toUpperCase());
|
||||
const method = typeof req.method === "string" ? req.method.toUpperCase() : "GET";
|
||||
const isSafeMethod = ["GET", "HEAD", "OPTIONS"].includes(method);
|
||||
if (!isSafeMethod && Array.isArray(req.actor.memberships) && req.actor.memberships.length > 0) {
|
||||
const membership = req.actor.memberships.find((item) => item.companyId === companyId);
|
||||
if (membership?.status !== "active") {
|
||||
|
||||
@@ -12,6 +12,9 @@ const PAPERCLIP_HOME = fs.mkdtempSync(path.join(os.tmpdir(), "paperclip-e2e-home
|
||||
export default defineConfig({
|
||||
testDir: ".",
|
||||
testMatch: "**/*.spec.ts",
|
||||
// These suites target dedicated multi-user configurations/ports and are
|
||||
// intentionally not part of the default local_trusted e2e run.
|
||||
testIgnore: ["multi-user.spec.ts", "multi-user-authenticated.spec.ts"],
|
||||
timeout: 60_000,
|
||||
retries: 0,
|
||||
use: {
|
||||
|
||||
Reference in new issue
Block a user