fastapi-gsap/.venv/lib/python3.12/site-packages/_pytest/terminalprogress.py
Tyler J King e744336385 fix: capability enforcement, credential safety, atomic delegations, input validation
C-6: ConnectorRuntime enforces capability_mask per operation.
     READ-only ACs cannot invoke MUTATE operations (wipe, lock, retire).
C-7: AC validated against database (exists, active, not expired)
     before connector invocation.
C-9: Delegated AC capability bounded by delegator's capability.
C-10: Command counter uses atomic SQL increment with limit check.
M-23: expire_stale() uses same atomic SQL pattern.

H-1: Sensitive credential fields hidden from repr/logs via repr=False.
H-2: Stub backend requires ALLOW_STUB_CREDENTIALS=true to activate.
H-3: Kerberos backend raises CredentialResolutionError instead of
     returning stub ticket.
H-4: Chronicle INTENT emitted before execution, RESULT after.
H-5: device_id validated as UUID before Graph API URL interpolation.
H-8: ConnectorRuntime enforces governance for all connector invocations.

Signed-off-by: Tyler King <tking@guildhouse.dev>
2026-04-14 08:13:27 -04:00

30 lines
1.1 KiB
Python

# A plugin to register the TerminalProgressPlugin plugin.
#
# This plugin is not loaded by default due to compatibility issues (#13896),
# but can be enabled in one of these ways:
# - The terminal plugin enables it in a few cases where it's safe, and not
# blocked by the user (using e.g. `-p no:terminalprogress`).
# - The user explicitly requests it, e.g. using `-p terminalprogress`.
#
# In a few years, if it's safe, we can consider enabling it by default. Then,
# this file will become unnecessary and can be inlined into terminal.py.
from __future__ import annotations
import os
from _pytest.config import Config
from _pytest.config import hookimpl
from _pytest.terminal import TerminalProgressPlugin
from _pytest.terminal import TerminalReporter
@hookimpl(trylast=True)
def pytest_configure(config: Config) -> None:
reporter: TerminalReporter | None = config.pluginmanager.get_plugin(
"terminalreporter"
)
if reporter is not None and reporter.isatty() and os.environ.get("TERM") != "dumb":
plugin = TerminalProgressPlugin(reporter)
config.pluginmanager.register(plugin, name="terminalprogress-plugin")