diff --git a/api/auth.ts b/api/auth.ts index d211383..8ac5af0 100644 --- a/api/auth.ts +++ b/api/auth.ts @@ -102,6 +102,7 @@ export const withAuth = (): MiddlewareHandler< if ( !isAllowed(namespace, payload) ) { + console.warn(`${credentials} is invalid`); const res = new Response("Forbbiden", { status: 403, headers: { @@ -121,6 +122,7 @@ export const withAuth = (): MiddlewareHandler< url.search = ""; const atLeastOneIsAllowed = scopes.some((scope) => scope.test(url)); if (!atLeastOneIsAllowed) { + console.warn(`${credentials} scope not allowed.`); const res = new Response("Forbbiden", { status: 403, headers: { diff --git a/api/router.ts b/api/router.ts index 28213a7..88c9159 100644 --- a/api/router.ts +++ b/api/router.ts @@ -47,6 +47,7 @@ export const getRouter = async ( const { id } = req.param(); const execution = await service.getExecution(id); if (execution === undefined) { + console.error("execution not found", id); return Response.json({}, { status: 403 }); // do not expose not found errors. } return Response.json(execution); @@ -55,6 +56,7 @@ export const getRouter = async ( const { id } = req.param(); const execution = await service.getExecution(id); if (execution === undefined) { + console.error("execution not found", id); return Response.json({}, { status: 403 }); // do not expose not found errors. } await service.touchExecution(id); @@ -75,6 +77,7 @@ export const getRouter = async ( pageSize ? +pageSize : 10, ); if (history === undefined) { + console.error("execution not found", id); return Response.json({}, { status: 403 }); // do not expose not found errors. } return Response.json(history);