@mindfulauth/core 2.0.0-beta.2 → 2.0.0-beta.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/config.d.ts CHANGED
@@ -1,5 +1,5 @@
1
- export declare const CENTRAL_AUTH_ORIGIN = "https://dev-api.mindfulauth.com";
2
- export declare const CDN_ORIGIN = "https://dev-cdn.mindfulauth.com";
1
+ export declare const CENTRAL_AUTH_ORIGIN = "https://api.mindfulauth.com";
2
+ export declare const CDN_ORIGIN = "https://cdn.mindfulauth.com";
3
3
  export declare const ALLOWED_AUTH_METHODS: string[];
4
4
  export declare const MAX_BODY_SIZE_BYTES = 1048576;
5
5
  export declare const AUTH_PROXY_TIMEOUT_MS = 15000;
@@ -15,6 +15,10 @@ export declare const PUBLIC_PREFIXES: string[];
15
15
  * Configure Mindful Auth security settings including CSP sources and static
16
16
  * assets to skip. Returns the options to be passed to getMauthViteDefines().
17
17
  *
18
+ * IMPORTANT: A nonce must be provided for inline styles to work. Without a nonce, inline styles will be blocked by CSP. If you need 'unsafe-inline' for development or testing, explicitly add it to styleSources in mauthSecurityConfig().
19
+ *
20
+ * IMPORTANT: Do not use Astro 6 security.csp in astro.config.mjs alongside this function. Astro's CSP will override these headers. Use mauthSecurityConfig() exclusively.
21
+ *
18
22
  * Call in astro.config.mjs and pass the result to vite.define:
19
23
  *
20
24
  * @example
@@ -25,7 +29,15 @@ export declare const PUBLIC_PREFIXES: string[];
25
29
  * scriptSources: ['https://analytics.example.com'],
26
30
  * connectSources: ['https://api.example.com'],
27
31
  * frameSources: ['https://stripe.com'],
28
- * fontSources: ['https://fonts.googleapis.com']
32
+ * fontSources: ['https://fonts.googleapis.com'],
33
+ * styleSources: ['https://cdn.example.com/styles'],
34
+ * imageSources: ['https://images.example.com'],
35
+ * frameAncestors: ["'self'"],
36
+ * workerSources: ["'self'"],
37
+ * manifestSources: ["'self'"],
38
+ * objectSources: ["'none'"],
39
+ * baseUris: ["'self'"],
40
+ * formActions: ["'self'"]
29
41
  * }
30
42
  * });
31
43
  *
@@ -40,6 +52,14 @@ export declare function mauthSecurityConfig(options?: {
40
52
  connectSources?: string[];
41
53
  frameSources?: string[];
42
54
  fontSources?: string[];
55
+ styleSources?: string[];
56
+ imageSources?: string[];
57
+ frameAncestors?: string[];
58
+ workerSources?: string[];
59
+ manifestSources?: string[];
60
+ objectSources?: string[];
61
+ baseUris?: string[];
62
+ formActions?: string[];
43
63
  };
44
64
  }): typeof options;
45
65
  /**
@@ -54,11 +74,15 @@ export declare function getMauthViteDefines(options?: {
54
74
  connectSources?: string[];
55
75
  frameSources?: string[];
56
76
  fontSources?: string[];
77
+ styleSources?: string[];
78
+ imageSources?: string[];
79
+ frameAncestors?: string[];
80
+ workerSources?: string[];
81
+ manifestSources?: string[];
82
+ objectSources?: string[];
83
+ baseUris?: string[];
84
+ formActions?: string[];
57
85
  };
58
86
  }): Record<string, string>;
59
- /**
60
- * Get security headers with CSP sources merged from defaults and build-time
61
- * custom values injected via vite.define (from getMauthViteDefines()).
62
- */
63
87
  export declare function GET_SECURITY_HEADERS(nonce?: string): Record<string, string>;
64
88
  //# sourceMappingURL=config.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../src/config.ts"],"names":[],"mappings":"AAKA,eAAO,MAAM,mBAAmB,oCAAoC,CAAC;AACrE,eAAO,MAAM,UAAU,oCAAoC,CAAC;AAG5D,eAAO,MAAM,oBAAoB,UAAkB,CAAC;AACpD,eAAO,MAAM,mBAAmB,UAAU,CAAC;AAC3C,eAAO,MAAM,qBAAqB,QAAQ,CAAC;AAC3C,eAAO,MAAM,6BAA6B,QAAQ,CAAC;AAenD;;;GAGG;AACH,wBAAgB,eAAe,IAAI,MAAM,EAAE,CAE1C;AAID,eAAO,MAAM,aAAa,UAQzB,CAAC;AAIF,eAAO,MAAM,eAAe,UAO3B,CAAC;AA0CF;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH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AC;QAC3B,aAAa,CAAC,EAAE,MAAM,EAAE,CAAC;QACzB,QAAQ,CAAC,EAAE,MAAM,EAAE,CAAC;QACpB,WAAW,CAAC,EAAE,MAAM,EAAE,CAAC;KAC1B,CAAC;CACL,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAgBzB;AAED,wBAAgB,oBAAoB,CAAC,KAAK,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CA2E3E"}
package/dist/config.js CHANGED
@@ -2,8 +2,8 @@
2
2
  // Configuration for the Astro Portal
3
3
  // ============================================================================
4
4
  // API Endpoints
5
- export const CENTRAL_AUTH_ORIGIN = 'https://dev-api.mindfulauth.com';
6
- export const CDN_ORIGIN = 'https://dev-cdn.mindfulauth.com';
5
+ export const CENTRAL_AUTH_ORIGIN = 'https://api.mindfulauth.com';
6
+ export const CDN_ORIGIN = 'https://cdn.mindfulauth.com';
7
7
  // Request & Timeout Configuration
8
8
  export const ALLOWED_AUTH_METHODS = ['GET', 'POST'];
9
9
  export const MAX_BODY_SIZE_BYTES = 1048576; // 1MB limit
@@ -55,14 +55,14 @@ const DEFAULT_SCRIPT_SOURCES = [
55
55
  "'self'",
56
56
  'https://*.cloudflare.com',
57
57
  'https://*.cloudflareinsights.com',
58
- 'https://dev-cdn.mindfulauth.com',
59
- 'https://dev-api.mindfulauth.com'
58
+ 'https://cdn.mindfulauth.com',
59
+ 'https://api.mindfulauth.com'
60
60
  ];
61
61
  // Default allowed connection sources for CSP
62
62
  const DEFAULT_CONNECT_SOURCES = [
63
63
  "'self'",
64
64
  'https://*.cloudflare.com',
65
- 'https://dev-api.mindfulauth.com'
65
+ 'https://api.mindfulauth.com'
66
66
  ];
67
67
  // Default allowed frame sources for CSP
68
68
  const DEFAULT_FRAME_SOURCES = [
@@ -74,10 +74,47 @@ const DEFAULT_FONT_SOURCES = [
74
74
  "'self'",
75
75
  'data:'
76
76
  ];
77
+ // Default allowed style sources for CSP
78
+ const DEFAULT_STYLE_SOURCES = [
79
+ "'self'",
80
+ ];
81
+ // Default allowed image sources for CSP
82
+ const DEFAULT_IMAGE_SOURCES = [
83
+ "'self'",
84
+ 'https:'
85
+ ];
86
+ // Default allowed frame ancestors for CSP (clickjacking protection)
87
+ const DEFAULT_FRAME_ANCESTORS = [
88
+ "'self'"
89
+ ];
90
+ // Default allowed worker sources for CSP (Web Workers, Service Workers)
91
+ const DEFAULT_WORKER_SOURCES = [
92
+ "'self'"
93
+ ];
94
+ // Default allowed manifest sources for CSP (web app manifest)
95
+ const DEFAULT_MANIFEST_SOURCES = [
96
+ "'self'"
97
+ ];
98
+ // Default allowed object sources for CSP (disallow plugins like Flash/Java)
99
+ const DEFAULT_OBJECT_SOURCES = [
100
+ "'none'"
101
+ ];
102
+ // Default allowed base URIs for CSP
103
+ const DEFAULT_BASE_URIS = [
104
+ "'self'"
105
+ ];
106
+ // Default allowed form actions for CSP
107
+ const DEFAULT_FORM_ACTIONS = [
108
+ "'self'"
109
+ ];
77
110
  /**
78
111
  * Configure Mindful Auth security settings including CSP sources and static
79
112
  * assets to skip. Returns the options to be passed to getMauthViteDefines().
80
113
  *
114
+ * IMPORTANT: A nonce must be provided for inline styles to work. Without a nonce, inline styles will be blocked by CSP. If you need 'unsafe-inline' for development or testing, explicitly add it to styleSources in mauthSecurityConfig().
115
+ *
116
+ * IMPORTANT: Do not use Astro 6 security.csp in astro.config.mjs alongside this function. Astro's CSP will override these headers. Use mauthSecurityConfig() exclusively.
117
+ *
81
118
  * Call in astro.config.mjs and pass the result to vite.define:
82
119
  *
83
120
  * @example
@@ -88,7 +125,15 @@ const DEFAULT_FONT_SOURCES = [
88
125
  * scriptSources: ['https://analytics.example.com'],
89
126
  * connectSources: ['https://api.example.com'],
90
127
  * frameSources: ['https://stripe.com'],
91
- * fontSources: ['https://fonts.googleapis.com']
128
+ * fontSources: ['https://fonts.googleapis.com'],
129
+ * styleSources: ['https://cdn.example.com/styles'],
130
+ * imageSources: ['https://images.example.com'],
131
+ * frameAncestors: ["'self'"],
132
+ * workerSources: ["'self'"],
133
+ * manifestSources: ["'self'"],
134
+ * objectSources: ["'none'"],
135
+ * baseUris: ["'self'"],
136
+ * formActions: ["'self'"]
92
137
  * }
93
138
  * });
94
139
  *
@@ -111,22 +156,39 @@ export function getMauthViteDefines(options) {
111
156
  __MAUTH_CONNECT_SOURCES__: JSON.stringify(options?.csp?.connectSources ?? []),
112
157
  __MAUTH_FRAME_SOURCES__: JSON.stringify(options?.csp?.frameSources ?? []),
113
158
  __MAUTH_FONT_SOURCES__: JSON.stringify(options?.csp?.fontSources ?? []),
159
+ __MAUTH_STYLE_SOURCES__: JSON.stringify(options?.csp?.styleSources ?? []),
160
+ __MAUTH_IMAGE_SOURCES__: JSON.stringify(options?.csp?.imageSources ?? []),
161
+ __MAUTH_FRAME_ANCESTORS__: JSON.stringify(options?.csp?.frameAncestors ?? []),
162
+ __MAUTH_WORKER_SOURCES__: JSON.stringify(options?.csp?.workerSources ?? []),
163
+ __MAUTH_MANIFEST_SOURCES__: JSON.stringify(options?.csp?.manifestSources ?? []),
164
+ __MAUTH_OBJECT_SOURCES__: JSON.stringify(options?.csp?.objectSources ?? []),
165
+ __MAUTH_BASE_URIS__: JSON.stringify(options?.csp?.baseUris ?? []),
166
+ __MAUTH_FORM_ACTIONS__: JSON.stringify(options?.csp?.formActions ?? []),
114
167
  };
115
168
  }
116
- /**
117
- * Get security headers with CSP sources merged from defaults and build-time
118
- * custom values injected via vite.define (from getMauthViteDefines()).
119
- */
120
169
  export function GET_SECURITY_HEADERS(nonce) {
121
170
  // Custom sources are baked in at build time via vite.define
122
- const SCRIPT_SOURCES = [
123
- ...DEFAULT_SCRIPT_SOURCES,
124
- ...__MAUTH_SCRIPT_SOURCES__,
125
- ...(nonce ? [`'nonce-${nonce}'`] : []),
126
- ];
127
- const CONNECT_SOURCES = [...DEFAULT_CONNECT_SOURCES, ...__MAUTH_CONNECT_SOURCES__];
128
- const FRAME_SOURCES = [...DEFAULT_FRAME_SOURCES, ...__MAUTH_FRAME_SOURCES__];
129
- const FONT_SOURCES = [...DEFAULT_FONT_SOURCES, ...__MAUTH_FONT_SOURCES__];
171
+ // Using Set to deduplicate sources while preserving order
172
+ const SCRIPT_SOURCES = [...new Set([
173
+ ...DEFAULT_SCRIPT_SOURCES,
174
+ ...__MAUTH_SCRIPT_SOURCES__,
175
+ ...(nonce ? [`'nonce-${nonce}'`] : []),
176
+ ])];
177
+ const STYLE_SOURCES = [...new Set([
178
+ ...DEFAULT_STYLE_SOURCES,
179
+ ...__MAUTH_STYLE_SOURCES__,
180
+ ...(nonce ? [`'nonce-${nonce}'`] : []),
181
+ ])];
182
+ const CONNECT_SOURCES = [...new Set([...DEFAULT_CONNECT_SOURCES, ...__MAUTH_CONNECT_SOURCES__])];
183
+ const FRAME_SOURCES = [...new Set([...DEFAULT_FRAME_SOURCES, ...__MAUTH_FRAME_SOURCES__])];
184
+ const FONT_SOURCES = [...new Set([...DEFAULT_FONT_SOURCES, ...__MAUTH_FONT_SOURCES__])];
185
+ const IMAGE_SOURCES = [...new Set([...DEFAULT_IMAGE_SOURCES, ...__MAUTH_IMAGE_SOURCES__])];
186
+ const FRAME_ANCESTORS = [...new Set([...DEFAULT_FRAME_ANCESTORS, ...__MAUTH_FRAME_ANCESTORS__])];
187
+ const WORKER_SOURCES = [...new Set([...DEFAULT_WORKER_SOURCES, ...__MAUTH_WORKER_SOURCES__])];
188
+ const MANIFEST_SOURCES = [...new Set([...DEFAULT_MANIFEST_SOURCES, ...__MAUTH_MANIFEST_SOURCES__])];
189
+ const OBJECT_SOURCES = [...new Set([...DEFAULT_OBJECT_SOURCES, ...__MAUTH_OBJECT_SOURCES__])];
190
+ const BASE_URIS = [...new Set([...DEFAULT_BASE_URIS, ...__MAUTH_BASE_URIS__])];
191
+ const FORM_ACTIONS = [...new Set([...DEFAULT_FORM_ACTIONS, ...__MAUTH_FORM_ACTIONS__])];
130
192
  return {
131
193
  'X-Content-Type-Options': 'nosniff',
132
194
  'X-Frame-Options': 'SAMEORIGIN',
@@ -134,25 +196,33 @@ export function GET_SECURITY_HEADERS(nonce) {
134
196
  'Strict-Transport-Security': 'max-age=31536000; includeSubDomains',
135
197
  'Permissions-Policy': 'geolocation=(), microphone=(), camera=()',
136
198
  'Content-Security-Policy': [
137
- // Default policy
138
- "default-src 'self'",
199
+ // Deny by default - only allow explicitly defined sources
200
+ "default-src 'none'",
139
201
  // Scripts
140
202
  `script-src ${SCRIPT_SOURCES.join(' ')}`,
141
203
  // Styles
142
- "style-src 'self' 'unsafe-inline'",
204
+ `style-src ${STYLE_SOURCES.join(' ')}`,
143
205
  // Images
144
- "img-src 'self' data: https:",
206
+ `img-src ${IMAGE_SOURCES.join(' ')}`,
145
207
  // Connections
146
208
  `connect-src ${CONNECT_SOURCES.join(' ')}`,
147
209
  // Frames
148
210
  `frame-src ${FRAME_SOURCES.join(' ')}`,
211
+ // Frame ancestors (clickjacking protection)
212
+ `frame-ancestors ${FRAME_ANCESTORS.join(' ')}`,
149
213
  // Fonts
150
214
  `font-src ${FONT_SOURCES.join(' ')}`,
215
+ // Web Workers and Service Workers
216
+ `worker-src ${WORKER_SOURCES.join(' ')}`,
217
+ // Web app manifest
218
+ `manifest-src ${MANIFEST_SOURCES.join(' ')}`,
151
219
  // Disallow object/embed tags (Flash, Java, etc.)
152
- "object-src 'none'",
220
+ `object-src ${OBJECT_SOURCES.join(' ')}`,
221
+ // Base URI
222
+ `base-uri ${BASE_URIS.join(' ')}`,
223
+ // Form action
224
+ `form-action ${FORM_ACTIONS.join(' ')}`,
153
225
  // Security directives
154
- "base-uri 'self'",
155
- "form-action 'self'",
156
226
  "upgrade-insecure-requests",
157
227
  "block-all-mixed-content"
158
228
  ].join('; ')
@@ -1 +1 @@
1
- {"version":3,"file":"middleware.d.ts","sourceRoot":"","sources":["../src/middleware.ts"],"names":[],"mappings":"AAoCA,eAAO,MAAM,SAAS,mCAuEpB,CAAC"}
1
+ {"version":3,"file":"middleware.d.ts","sourceRoot":"","sources":["../src/middleware.ts"],"names":[],"mappings":"AAoCA,eAAO,MAAM,SAAS,mCA0FpB,CAAC"}
@@ -13,7 +13,7 @@ import { validateSession, validateMemberIdInUrl } from './auth';
13
13
  /** Check if a path is a public route (no auth required) */
14
14
  function isPublicRoute(pathname) {
15
15
  return PUBLIC_ROUTES.includes(pathname) ||
16
- PUBLIC_PREFIXES.some(prefix => pathname.startsWith(prefix));
16
+ PUBLIC_PREFIXES.some((prefix) => pathname.startsWith(prefix));
17
17
  }
18
18
  /** Add security headers to a response */
19
19
  // NOTE: In Cloudflare Workers, Response.headers is immutable.
@@ -33,6 +33,11 @@ function addSecurityHeaders(response, nonce) {
33
33
  export const onRequest = defineMiddleware(async (context, next) => {
34
34
  const { request, url, redirect, locals } = context;
35
35
  const pathname = url.pathname;
36
+ // Redirect HTTP to HTTPS (skip in dev mode and localhost)
37
+ if (!import.meta.env.DEV && url.protocol === 'http:' && url.hostname !== 'localhost' && url.hostname !== '127.0.0.1') {
38
+ const httpsUrl = url.toString().replace('http://', 'https://');
39
+ return redirect(httpsUrl, 307);
40
+ }
36
41
  // Generate a per-request nonce for CSP. Exposed as locals.cspNonce so
37
42
  // layouts can add nonce={Astro.locals.cspNonce} to inline <script> tags.
38
43
  const nonce = generateNonce();
@@ -58,6 +63,18 @@ export const onRequest = defineMiddleware(async (context, next) => {
58
63
  locals.recordId = match ? match[1] : 'dev-user-123';
59
64
  return next();
60
65
  }
66
+ // PREVIEW MODE: Skip auth (for testing without Mindful Auth on localhost)
67
+ // npm run preview builds the project first, so import.meta.env.DEV is false.
68
+ // We need a runtime check for localhost to simulate auth in preview.
69
+ if (url.hostname === 'localhost' || url.hostname === '127.0.0.1') {
70
+ if (isPublicRoute(pathname)) {
71
+ locals.recordId = null;
72
+ return addSecurityHeaders(await next(), nonce);
73
+ }
74
+ const match = pathname.match(/^\/([a-zA-Z0-9-]+)(?:\/|$)/);
75
+ locals.recordId = match ? match[1] : 'preview-user-123';
76
+ return addSecurityHeaders(await next(), nonce);
77
+ }
61
78
  // Sanitize path
62
79
  const safePath = sanitizePath(pathname);
63
80
  if (!safePath) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mindfulauth/core",
3
- "version": "2.0.0-beta.2",
3
+ "version": "2.0.0-beta.3",
4
4
  "description": "Mindful Auth core authentication library for Astro 6",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -46,7 +46,7 @@
46
46
  },
47
47
  "devDependencies": {
48
48
  "@cloudflare/workers-types": "^4.20260303.0",
49
- "astro": "^6.0.0-beta.14",
49
+ "astro": "^6.0.0-beta.15",
50
50
  "typescript": "^5.9.3"
51
51
  }
52
52
  }