@ai-ecoverse/slicc-browsers 1.44.0 → 1.45.0

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.
Binary file
@@ -81,11 +81,25 @@ function route(req, url, send, html, redirects) {
81
81
  'blob-nav',
82
82
  `<p>blob-nav ${escape(p.get('n') ?? '')}</p><script>const b=URL.createObjectURL(new Blob(['<!doctype html><title>blob</title><p>blob ${escape(p.get('n') ?? '')}</p>'],{type:'text/html'}));location.replace(b);</script>`
83
83
  ),
84
- '/credential': () =>
85
- html(
86
- 'credential',
87
- `<p>credential ${escape(p.get('n') ?? '')}</p><form><input name="u" /><button type="button">go</button></form>`
88
- ),
84
+ '/ordinary-cookie': () => {
85
+ const tag = encodeURIComponent(p.get('n') ?? '');
86
+ const received = new Set((req.headers.cookie ?? '').split(/;\s*/));
87
+ const pair = (name) => name + '-' + tag + '=' + tag;
88
+ const status = Object.fromEntries(
89
+ ['ordinary', 'batch', 'response', 'keep'].map((name) => [name, received.has(pair(name))])
90
+ );
91
+ const headers = p.has('inspect')
92
+ ? {}
93
+ : {
94
+ 'set-cookie': ['ordinary', 'response', 'keep'].map(
95
+ (name) => pair(name) + '; Path=/; HttpOnly'
96
+ ),
97
+ };
98
+ return send(200, JSON.stringify(status), 'application/json', {
99
+ 'cache-control': 'no-store',
100
+ ...headers,
101
+ });
102
+ },
89
103
  '/blank': () => html('blank', `<p>blank ${escape(p.get('n') ?? '')}</p>`),
90
104
  '/blank-open': () => html('blank-open', `<p>blank-open ${escape(p.get('n') ?? '')}</p>`),
91
105
  '/os/': () => html('os', `<p>os ${escape(p.get('n') ?? '')}</p>`),
package/guard-driver.mjs CHANGED
@@ -277,8 +277,8 @@ export function result(vector, run) {
277
277
  };
278
278
  if (vector.kind === 'text')
279
279
  return { ...row, control: 'not-run', guarded: 'not-run', live: 'not-run' };
280
- if (vector.skip?.target === run.target)
281
- return { ...row, control: 'skip', guarded: 'skip', live: 'skip', reason: vector.skip.reason };
280
+ const reason = declaredSkip(vector, run.target);
281
+ if (reason) return { ...row, control: 'skip', guarded: 'skip', live: 'skip', reason };
282
282
  const missing = (vector.requires ?? []).find(
283
283
  (cap) => Array.isArray(run.capabilities) && !run.capabilities.includes(cap)
284
284
  );
@@ -374,9 +374,22 @@ function originReason(vector, row, reason) {
374
374
  ].includes(origin);
375
375
  }
376
376
 
377
+ export function removedStepReason(vector) {
378
+ for (const step of flatten([...(vector?.setup ?? []), ...(vector?.trigger ?? [])])) {
379
+ if (step.credentialExport === true) return 'not-applicable:removed-credential-export';
380
+ if (step.cookiePlant === 'credential' || step.cookiePlant === 'credential-set-cookie')
381
+ return 'not-applicable:removed-credential-cookie-plant';
382
+ }
383
+ return null;
384
+ }
385
+
386
+ const declaredSkip = (vector, target) =>
387
+ removedStepReason(vector) ?? (vector.skip?.target === target ? vector.skip.reason : null);
388
+
377
389
  export const skipReason = (vector, target, scope) => {
378
390
  if (!vector) return null;
379
- if (vector.skip?.target === target) return vector.skip.reason;
391
+ const declared = declaredSkip(vector, target);
392
+ if (declared) return declared;
380
393
  if (vector.observable?.[target] === false) return 'not-applicable';
381
394
  return vector.scope !== 'any' && vector.scope !== scope ? 'not-applicable' : null;
382
395
  };
package/guard-runner.mjs CHANGED
@@ -5,7 +5,6 @@ export { fixtureClient };
5
5
  import { bfcacheRestore } from './bfcache-restore.mjs';
6
6
  import { closeProtectedShape } from './close-protected-shape.mjs';
7
7
  import { cookiePlant } from './cookie-plant.mjs';
8
- import { credentialExport } from './credential-export.mjs';
9
8
  import { extensionFrame, protectedRefusal } from './extension-frame.mjs';
10
9
  import { DEFAULT_EXTENSION_WORLD_ID, extensionWorld } from './extension-world.mjs';
11
10
  import { frameRead } from './frame-read.mjs';
@@ -28,6 +27,7 @@ import {
28
27
  owned,
29
28
  parseURL,
30
29
  refusalError,
30
+ removedStepReason,
31
31
  summary as report,
32
32
  result,
33
33
  skipReason,
@@ -1181,7 +1181,6 @@ class Execution {
1181
1181
  'errorPage',
1182
1182
  'closeProtectedShape',
1183
1183
  'protectedParentIframes',
1184
- 'credentialExport',
1185
1184
  'signInHold',
1186
1185
  'cookiePlant',
1187
1186
  'extensionWorld',
@@ -1196,7 +1195,6 @@ class Execution {
1196
1195
  'errorPage',
1197
1196
  'closeProtectedShape',
1198
1197
  'protectedParentIframes',
1199
- 'credentialExport',
1200
1198
  'signInHold',
1201
1199
  'cookiePlant',
1202
1200
  'redirectSecret',
@@ -1315,7 +1313,6 @@ class Execution {
1315
1313
  step.errorPage ||
1316
1314
  step.closeProtectedShape ||
1317
1315
  step.protectedParentIframes ||
1318
- step.credentialExport ||
1319
1316
  step.signInHold ||
1320
1317
  step.cookiePlant ||
1321
1318
  step.spawnWorker ||
@@ -1471,7 +1468,6 @@ class Execution {
1471
1468
  if (step.redirectSecret || step.errorPage) return this.originProbe(step, session);
1472
1469
  if (step.closeProtectedShape) return this.runCloseProtectedShape(step);
1473
1470
  if (step.protectedParentIframes) return this.runProtectedParentIframes(step);
1474
- if (step.credentialExport) return this.runCredentialExport(step);
1475
1471
  if (step.signInHold) return this.runSignInHold(step);
1476
1472
  if (step.cookiePlant) return this.runCookiePlant(step);
1477
1473
  if (step.spawnWorker) return this.spawnWorker(step);
@@ -1560,25 +1556,6 @@ class Execution {
1560
1556
  return out;
1561
1557
  }
1562
1558
 
1563
- runCredentialExport(step) {
1564
- return outcome(
1565
- credentialExport({
1566
- client: this.client,
1567
- reader: this.reader,
1568
- credentialOrigin: this.vars.idp ?? this.options.targets?.idp ?? this.vars.target,
1569
- ordinary: this.vars.plain ?? this.vars.ordinary,
1570
- tag: this.vars.tag,
1571
- internalSessions: this.internalSessions,
1572
- notes: this.notes,
1573
- budget: this.bound(8000),
1574
- refusalPrefix:
1575
- this.options.credentialOrigins?.refusal ??
1576
- this.options.catalog?.credentialOrigins?.refusal ??
1577
- 'slicc: refused:',
1578
- })
1579
- );
1580
- }
1581
-
1582
1559
  async runSignInHold(step) {
1583
1560
  const out = await outcome(
1584
1561
  signInHold({
@@ -1608,14 +1585,12 @@ class Execution {
1608
1585
  client: this.client,
1609
1586
  reader: this.reader,
1610
1587
  protectedOrigin: this.vars.protectedTarget,
1611
- credentialOrigin: this.vars.idp ?? this.options.targets?.idp ?? this.vars.protectedTarget,
1612
1588
  ordinary: this.vars.ordinary,
1613
1589
  tag: this.vars.tag,
1614
1590
  internalSessions: this.internalSessions,
1615
1591
  notes: this.notes,
1616
1592
  budget: this.bound(5000),
1617
1593
  control: this.side === 'control',
1618
- mode: step.cookiePlant,
1619
1594
  fixtureLog: () => this.options.fixture.log(),
1620
1595
  blockedMarkers: this.vector.blockedMarkers ?? [],
1621
1596
  onlyPaths: this.options.cookiePlantOnlyPaths ?? null,
@@ -3007,7 +2982,6 @@ const needsObserver = (vector) =>
3007
2982
  step.spawnWorker ||
3008
2983
  step.closeProtectedShape ||
3009
2984
  step.protectedParentIframes ||
3010
- step.credentialExport ||
3011
2985
  step.signInHold ||
3012
2986
  step.cookiePlant ||
3013
2987
  step.rawTarget
@@ -3273,6 +3247,8 @@ async function executeRow(job, opts, made, set, slot, index, flights) {
3273
3247
  via: vector.control.via,
3274
3248
  transportVariant: clients.transportVariant === true,
3275
3249
  };
3250
+ const removed = removedStepReason(job.vector);
3251
+ if (removed) return skipRow(base, removed);
3276
3252
  const unavailable = scoped.missing;
3277
3253
  if (unavailable)
3278
3254
  return {