Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion nginx.conf
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ server {
gzip_types text/plain text/css application/json application/javascript text/xml application/xml application/xml+rss text/javascript;

# Security headers
add_header Content-Security-Policy "default-src 'self'; base-uri 'self'; object-src 'none'; frame-ancestors 'none'; img-src 'self' data: https:; font-src 'self' data: https://fonts.gstatic.com; style-src 'self' 'unsafe-inline' https://fonts.googleapis.com; script-src 'self' https://*.jam.dev; worker-src 'self' blob:; frame-src 'self' https://accounts.google.com https://*.jam.dev; connect-src 'self' https://uziwdtkzofptihahfooo.supabase.co https://*.supabase.co https://api.openai.com https://api.anthropic.com https://generativelanguage.googleapis.com https://r.jina.ai https://s.jina.ai https://oauth2.googleapis.com https://www.googleapis.com https://*.ingest.sentry.io https://*.sentry.io https://eu.i.posthog.com https://*.posthog.com;" always;
add_header Content-Security-Policy "default-src 'self'; base-uri 'self'; object-src 'none'; frame-ancestors 'none'; img-src 'self' data: https:; font-src 'self' data: https://fonts.gstatic.com; style-src 'self' 'unsafe-inline' https://fonts.googleapis.com; script-src 'self' https://*.jam.dev; worker-src 'self' blob:; frame-src 'self' https://accounts.google.com https://*.jam.dev; connect-src 'self' https://*.jam.dev https://uziwdtkzofptihahfooo.supabase.co https://*.supabase.co https://api.openai.com https://api.anthropic.com https://generativelanguage.googleapis.com https://r.jina.ai https://s.jina.ai https://oauth2.googleapis.com https://www.googleapis.com https://*.ingest.sentry.io https://*.sentry.io https://eu.i.posthog.com https://*.posthog.com;" always;
add_header X-Frame-Options "SAMEORIGIN" always;
add_header X-Content-Type-Options "nosniff" always;
add_header Referrer-Policy "strict-origin-when-cross-origin" always;
Expand Down
3 changes: 2 additions & 1 deletion src/lib/observability.ts
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,8 @@ export function initializeObservability(): void {
dsn: sentryDsn,
environment: import.meta.env.MODE,
ignoreErrors: [/^Synthetic observability verification$/],
sendDefaultPii: false,
// No sendDefaultPii: deprecated, and Sentry ignores it whenever
// dataCollection is set. The block below is the only PII control.
beforeBreadcrumb: filterObservabilityBreadcrumb,
dataCollection: {
userInfo: false,
Expand Down
4 changes: 3 additions & 1 deletion src/test/observability.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,6 @@ describe("observability primitives", () => {
expect(sentryInitMock).toHaveBeenCalledWith(expect.objectContaining({
dsn: "https://public-test@sentry.example/1",
ignoreErrors: [/^Synthetic observability verification$/],
sendDefaultPii: false,
beforeBreadcrumb: filterObservabilityBreadcrumb,
dataCollection: {
userInfo: false,
Expand All @@ -228,6 +227,9 @@ describe("observability primitives", () => {
replaysSessionSampleRate: 0,
replaysOnErrorSampleRate: 1,
}));
// Deprecated and ignored whenever dataCollection is set: passing it would
// read as a PII control that does nothing.
expect(sentryInitMock.mock.calls[0][0]).not.toHaveProperty("sendDefaultPii");
expect(browserTracingIntegrationMock).toHaveBeenCalledOnce();
expect(replayIntegrationMock).toHaveBeenCalledWith({
maskAllText: true,
Expand Down
2 changes: 2 additions & 0 deletions src/test/vercel-deployment-config.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,8 @@ describe("Vercel frontend deployment configuration", () => {

expect(csp).toContain("script-src 'self' https://*.jam.dev");
expect(csp).toContain("frame-src 'self' https://accounts.google.com https://*.jam.dev");
// Loading the recorder is useless if it cannot upload the capture.
expect(csp).toContain("connect-src 'self' https://*.jam.dev");
expect(nginxCsp).toBe(csp);
expect(indexHtml).toContain('<script src="/src/bootstrap.ts" type="module"></script>');
expect(indexHtml).not.toContain('<script type="module" src="/src/main.tsx"></script>');
Expand Down
2 changes: 1 addition & 1 deletion vercel.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
"headers": [
{
"key": "Content-Security-Policy",
"value": "default-src 'self'; base-uri 'self'; object-src 'none'; frame-ancestors 'none'; img-src 'self' data: https:; font-src 'self' data: https://fonts.gstatic.com; style-src 'self' 'unsafe-inline' https://fonts.googleapis.com; script-src 'self' https://*.jam.dev; worker-src 'self' blob:; frame-src 'self' https://accounts.google.com https://*.jam.dev; connect-src 'self' https://uziwdtkzofptihahfooo.supabase.co https://*.supabase.co https://api.openai.com https://api.anthropic.com https://generativelanguage.googleapis.com https://r.jina.ai https://s.jina.ai https://oauth2.googleapis.com https://www.googleapis.com https://*.ingest.sentry.io https://*.sentry.io https://eu.i.posthog.com https://*.posthog.com;"
"value": "default-src 'self'; base-uri 'self'; object-src 'none'; frame-ancestors 'none'; img-src 'self' data: https:; font-src 'self' data: https://fonts.gstatic.com; style-src 'self' 'unsafe-inline' https://fonts.googleapis.com; script-src 'self' https://*.jam.dev; worker-src 'self' blob:; frame-src 'self' https://accounts.google.com https://*.jam.dev; connect-src 'self' https://*.jam.dev https://uziwdtkzofptihahfooo.supabase.co https://*.supabase.co https://api.openai.com https://api.anthropic.com https://generativelanguage.googleapis.com https://r.jina.ai https://s.jina.ai https://oauth2.googleapis.com https://www.googleapis.com https://*.ingest.sentry.io https://*.sentry.io https://eu.i.posthog.com https://*.posthog.com;"
},
{
"key": "X-Frame-Options",
Expand Down
Loading