Ctrl K
ComunidadGuías…

examples/live-cases.yaml

Rama main · réplica de lectura del repositorio original.

Archivo original ↗Preguntar a KiBot
# Cases for the opt-in live test, run from a clone of the repository with
# toolpass and pytest installed:
#
#   cd toolpass-py
#   TOOLPASS_LIVE_CASES=$PWD/../examples/live-cases.yaml python -m pytest tests/live
#
# config is a toolpass config file (relative to this file). Each case names a
# connection from it and the answer you expect (allow, deny or unknown, and
# optionally the reason code). Fill in real users. Every connection is probed
# first; one whose credential is not available on this machine is reported
# NOT CONFIGURED and skipped (TOOLPASS_LIVE_REQUIRE=1 fails the run instead).
config: toolpass.yaml

cases:
  - name: admin may write
    connection: demo
    user: admin@example.com
    action: thing.write
    resource: thing:1
    expect: allow
  - name: plain user may not write
    connection: demo
    user: dana@example.com
    action: thing.write
    resource: thing:1
    expect: deny
  - name: unknown user
    connection: demo
    user: nobody@example.com
    action: thing.read
    resource: thing:1
    expect: deny
    code: user_not_found