| | @@ -309,7 +309,7 @@ |
| 309 | 309 | |
| 310 | 310 | test( |
| 311 | 311 | 'a deny rule holds over an allow from a plugin the person installed', |
| 312 | | - { plugins: [Fixtures.answering('easy', Fixtures.ALLOWED)] }, |
| 312 | + { plugins: [Fixtures.allowing('easy')] }, |
| 313 | 313 | async ($, on) => { |
| 314 | 314 | on('settings.read', () => ({ value: Fixtures.MANAGED_POLICY })) |
| 315 | 315 | |
| | @@ -328,10 +328,7 @@ |
| 328 | 328 | test( |
| 329 | 329 | 'two plugins of the person chained are each named once in a session', |
| 330 | 330 | { |
| 331 | | - plugins: [ |
| 332 | | - Fixtures.answering('first', Fixtures.ALLOWED), |
| 333 | | - Fixtures.answering('second', Fixtures.ASKED), |
| 334 | | - ], |
| 331 | + plugins: [Fixtures.allowing('first'), Fixtures.asking('second')], |
| 335 | 332 | }, |
| 336 | 333 | async ($, on) => { |
| 337 | 334 | on('settings.read', () => ({ value: Fixtures.MANAGED_POLICY })) |
| | @@ -343,7 +340,7 @@ |
| 343 | 340 | expect(await $.tool.check(Fixtures.CHECKED)).toEqual(Fixtures.RULE_DENY) |
| 344 | 341 | expect(await $.tool.check(Fixtures.CHECKED)).toEqual(Fixtures.RULE_DENY) |
| 345 | 342 | |
| 346 | | - expect(lines).toEqual([ |
| 343 | + expect(lines.toSorted()).toEqual([ |
| 347 | 344 | `transcript: ${Hooks.heldNotice('first', 'Bash', 'Bash(echo *)')}`, |
| 348 | 345 | `transcript: ${Hooks.heldNotice('second', 'Bash', 'Bash(echo *)')}`, |
| 349 | 346 | ]) |
| | @@ -352,7 +349,7 @@ |
| 352 | 349 | |
| 353 | 350 | test( |
| 354 | 351 | 'a deny rule turned into an ask by a plugin of the person holds too', |
| 355 | | - { plugins: [Fixtures.answering('easy', Fixtures.ASKED)] }, |
| 352 | + { plugins: [Fixtures.asking('easy')] }, |
| 356 | 353 | async ($, on) => { |
| 357 | 354 | on('settings.read', () => ({ value: Fixtures.MANAGED_POLICY })) |
| 358 | 355 | Fixtures.logged(on) |
| | @@ -366,8 +363,8 @@ |
| 366 | 363 | "an organization plugin's allow over a deny rule stands, above or below", |
| 367 | 364 | { |
| 368 | 365 | plugins: [ |
| 369 | | - Fixtures.answering('suite', Fixtures.ALLOWED, 'append'), |
| 370 | | - Fixtures.answering('easy', Fixtures.ALLOWED), |
| 366 | + Fixtures.allowing('suite', 'append'), |
| 367 | + Fixtures.allowing('easy'), |
| 371 | 368 | ], |
| 372 | 369 | }, |
| 373 | 370 | async ($, on) => { |
| | @@ -384,7 +381,7 @@ |
| 384 | 381 | |
| 385 | 382 | test( |
| 386 | 383 | "a prepended organization plugin's allow over a deny rule stands", |
| 387 | | - { plugins: [Fixtures.answering('guard', Fixtures.ALLOWED, 'prepend')] }, |
| 384 | + { plugins: [Fixtures.allowing('guard', 'prepend')] }, |
| 388 | 385 | async ($, on) => { |
| 389 | 386 | on('settings.read', () => ({ value: Fixtures.MANAGED_POLICY })) |
| 390 | 387 | |
| | @@ -399,7 +396,7 @@ |
| 399 | 396 | |
| 400 | 397 | test( |
| 401 | 398 | "a built-in's allow over a deny rule stands", |
| 402 | | - { plugins: [Fixtures.answering('bundled', Fixtures.ALLOWED, 'builtin')] }, |
| 399 | + { plugins: [Fixtures.allowing('bundled', 'builtin')] }, |
| 403 | 400 | async ($, on) => { |
| 404 | 401 | on('settings.read', () => ({ value: Fixtures.MANAGED_POLICY })) |
| 405 | 402 | |
| | @@ -414,7 +411,7 @@ |
| 414 | 411 | |
| 415 | 412 | test( |
| 416 | 413 | 'an ask a plugin of the person allows, no deny rule behind it, stands', |
| 417 | | - { plugins: [Fixtures.answering('easy', Fixtures.ALLOWED)] }, |
| 414 | + { plugins: [Fixtures.allowing('easy')] }, |
| 418 | 415 | async ($, on) => { |
| 419 | 416 | on('settings.read', () => ({ value: Fixtures.MANAGED_POLICY })) |
| 420 | 417 | |
| | @@ -429,7 +426,7 @@ |
| 429 | 426 | |
| 430 | 427 | test( |
| 431 | 428 | 'a deny no rule decided is still theirs to answer over', |
| 432 | | - { plugins: [Fixtures.answering('easy', Fixtures.ALLOWED)] }, |
| 429 | + { plugins: [Fixtures.allowing('easy')] }, |
| 433 | 430 | async ($, on) => { |
| 434 | 431 | on('settings.read', () => ({ value: Fixtures.MANAGED_POLICY })) |
| 435 | 432 | |
| | @@ -444,7 +441,7 @@ |
| 444 | 441 | |
| 445 | 442 | test( |
| 446 | 443 | 'a plugin of the person that tightens is heard, with one evaluation', |
| 447 | | - { plugins: [Fixtures.answering('strict', Fixtures.PLAIN_DENY)] }, |
| 444 | + { plugins: [Fixtures.tightening] }, |
| 448 | 445 | async ($, on) => { |
| 449 | 446 | const reads = Fixtures.policyReads(on, Fixtures.MANAGED_POLICY) |
| 450 | 447 | const evaluations = Fixtures.checksAnswered(on, Fixtures.ASKED) |
| | @@ -472,7 +469,7 @@ |
| 472 | 469 | |
| 473 | 470 | test( |
| 474 | 471 | 'an allow that never called next meets the deny rule all the same', |
| 475 | | - { plugins: [Fixtures.blindAnswering('blind', Fixtures.ALLOWED)] }, |
| 472 | + { plugins: [Fixtures.blindAllowing] }, |
| 476 | 473 | async ($, on) => { |
| 477 | 474 | on('settings.read', () => ({ value: Fixtures.MANAGED_POLICY })) |
| 478 | 475 | |
| | @@ -492,15 +489,7 @@ |
| 492 | 489 | |
| 493 | 490 | test( |
| 494 | 491 | 'a rule a plugin of the person writes into its answer is never read', |
| 495 | | - { |
| 496 | | - plugins: [ |
| 497 | | - Fixtures.answering('forging', { |
| 498 | | - decision: 'ask', |
| 499 | | - reason: 'fine by me', |
| 500 | | - rule: 'Bash(ls *)', |
| 501 | | - }), |
| 502 | | - ], |
| 503 | | - }, |
| 492 | + { plugins: [Fixtures.forging] }, |
| 504 | 493 | async ($, on) => { |
| 505 | 494 | on('settings.read', () => ({ value: Fixtures.MANAGED_POLICY })) |
| 506 | 495 | |
| | @@ -542,7 +531,7 @@ |
| 542 | 531 | |
| 543 | 532 | test( |
| 544 | 533 | 'managed settings may let the plugins a person installs override', |
| 545 | | - { plugins: [Fixtures.answering('easy', Fixtures.ALLOWED)] }, |
| 534 | + { plugins: [Fixtures.allowing('easy')] }, |
| 546 | 535 | async ($, on) => { |
| 547 | 536 | on('settings.read', () => ({ value: Fixtures.overridePolicyOf(true) })) |
| 548 | 537 | |
| | @@ -560,7 +549,7 @@ |
| 560 | 549 | |
| 561 | 550 | test( |
| 562 | 551 | "only managed settings are asked: a person's own cannot lift a deny rule", |
| 563 | | - { plugins: [Fixtures.answering('easy', Fixtures.ALLOWED)] }, |
| 552 | + { plugins: [Fixtures.allowing('easy')] }, |
| 564 | 553 | async ($, on) => { |
| 565 | 554 | Fixtures.policyBySource( |
| 566 | 555 | on, |
| | @@ -577,7 +566,7 @@ |
| 577 | 566 | |
| 578 | 567 | test( |
| 579 | 568 | 'the option mistyped lifts nothing: only the literal true does', |
| 580 | | - { plugins: [Fixtures.answering('easy', Fixtures.ALLOWED)] }, |
| 569 | + { plugins: [Fixtures.allowing('easy')] }, |
| 581 | 570 | async ($, on) => { |
| 582 | 571 | on('settings.read', () => ({ value: Fixtures.overridePolicyOf('true') })) |
| 583 | 572 | Fixtures.logged(on) |
| | @@ -589,7 +578,7 @@ |
| 589 | 578 | |
| 590 | 579 | test( |
| 591 | 580 | 'with a policy that cannot be read the deny rule holds: fails closed', |
| 592 | | - { plugins: [Fixtures.answering('easy', Fixtures.ALLOWED)] }, |
| 581 | + { plugins: [Fixtures.allowing('easy')] }, |
| 593 | 582 | async ($, on) => { |
| 594 | 583 | on('settings.read', () => ({ deny: 'managed settings unreadable' })) |
| 595 | 584 | Fixtures.logged(on) |
| | @@ -601,7 +590,7 @@ |
| 601 | 590 | |
| 602 | 591 | test( |
| 603 | 592 | "when the rules cannot be evaluated the call is refused: the hook's catch", |
| 604 | | - { plugins: [Fixtures.blindAnswering('blind', Fixtures.ALLOWED)] }, |
| 593 | + { plugins: [Fixtures.blindAllowing] }, |
| 605 | 594 | async ($, on) => { |
| 606 | 595 | on('settings.read', () => ({ value: Fixtures.MANAGED_POLICY })) |
| 607 | 596 | Fixtures.logged(on) |