@dr-co/dsh-secret-form 0.4.1 → 0.4.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/index.mjs CHANGED
@@ -924,7 +924,10 @@ export function apply(ctx, config = {}) {
924
924
 
925
925
  const credentialsOf = () => (typeof ctx?.get === 'function' ? ctx.get('credentials') : ctx?.credentials);
926
926
  const handler = createRouteHandler({ forms, shares, settings, logger, credentialsOf, notifier });
927
- const route = { kind: 'prefix', path: settings.routePrefix, handler };
927
+ // A form link is opened by a person who has no DSH session; the page's own
928
+ // uuid token is the only credential. The web server's default `required`
929
+ // admission answered 401 before the handler could check that token.
930
+ const route = { kind: 'prefix', path: settings.routePrefix, auth: 'anonymous', handler };
928
931
 
929
932
  if (typeof ctx?.webServer?.register !== 'function') {
930
933
  throw new TypeError('dsh-secret-form: the webServer service is required');
package/lib/page.mjs CHANGED
@@ -14,7 +14,7 @@ import { FALLBACK_LOCALE, format, messagesFor, normalizeLocale } from './i18n.mj
14
14
  /** Headers that apply to every response, form pages and outcome pages alike. */
15
15
  export const SECURITY_HEADERS = Object.freeze({
16
16
  'Cache-Control': 'no-store',
17
- 'Referrer-Policy': 'no-referrer',
17
+ 'Referrer-Policy': 'same-origin',
18
18
  'X-Content-Type-Options': 'nosniff',
19
19
  'X-Frame-Options': 'DENY',
20
20
  'Content-Security-Policy': "default-src 'none'; style-src 'unsafe-inline'; script-src 'unsafe-inline'; form-action 'self'; base-uri 'none'",
@@ -186,7 +186,7 @@ function shell({ title, body, script, locale }) {
186
186
  <head>
187
187
  <meta charset="utf-8">
188
188
  <meta name="viewport" content="width=device-width, initial-scale=1">
189
- <meta name="referrer" content="no-referrer">
189
+ <meta name="referrer" content="same-origin">
190
190
  <meta name="robots" content="noindex, nofollow">
191
191
  <title>${escapeHtml(title)}</title>
192
192
  <style>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dr-co/dsh-secret-form",
3
- "version": "0.4.1",
3
+ "version": "0.4.3",
4
4
  "description": "Secret links in both directions for DeepSeek Harness: the human types a secret into a one-time form, or the model hands one over through a link whose reveal button works exactly once. Durable in SQLite, with file uploads and a note to the session that asked.",
5
5
  "type": "module",
6
6
  "main": "./index.mjs",