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>
66 lines
1.7 KiB
Python
66 lines
1.7 KiB
Python
import json
|
|
import platform
|
|
import sys
|
|
|
|
from . import __version__ as pyjwt_version
|
|
|
|
try:
|
|
import cryptography
|
|
|
|
cryptography_version = cryptography.__version__
|
|
except ModuleNotFoundError:
|
|
cryptography_version = ""
|
|
|
|
|
|
def info() -> dict[str, dict[str, str]]:
|
|
"""
|
|
Generate information for a bug report.
|
|
Based on the requests package help utility module.
|
|
"""
|
|
try:
|
|
platform_info = {
|
|
"system": platform.system(),
|
|
"release": platform.release(),
|
|
}
|
|
except OSError:
|
|
platform_info = {"system": "Unknown", "release": "Unknown"}
|
|
|
|
implementation = platform.python_implementation()
|
|
|
|
if implementation == "CPython":
|
|
implementation_version = platform.python_version()
|
|
elif implementation == "PyPy":
|
|
pypy_version_info = sys.pypy_version_info # type: ignore[attr-defined]
|
|
implementation_version = (
|
|
f"{pypy_version_info.major}."
|
|
f"{pypy_version_info.minor}."
|
|
f"{pypy_version_info.micro}"
|
|
)
|
|
if pypy_version_info.releaselevel != "final":
|
|
implementation_version = "".join(
|
|
[
|
|
implementation_version,
|
|
pypy_version_info.releaselevel,
|
|
]
|
|
)
|
|
else:
|
|
implementation_version = "Unknown"
|
|
|
|
return {
|
|
"platform": platform_info,
|
|
"implementation": {
|
|
"name": implementation,
|
|
"version": implementation_version,
|
|
},
|
|
"cryptography": {"version": cryptography_version},
|
|
"pyjwt": {"version": pyjwt_version},
|
|
}
|
|
|
|
|
|
def main() -> None:
|
|
"""Pretty-print the bug information as JSON."""
|
|
print(json.dumps(info(), sort_keys=True, indent=2))
|
|
|
|
|
|
if __name__ == "__main__":
|
|
main()
|