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>
62 lines
1.5 KiB
Python
62 lines
1.5 KiB
Python
# A highish-level implementation of the HTTP/1.1 wire protocol (RFC 7230),
|
|
# containing no networking code at all, loosely modelled on hyper-h2's generic
|
|
# implementation of HTTP/2 (and in particular the h2.connection.H2Connection
|
|
# class). There's still a bunch of subtle details you need to get right if you
|
|
# want to make this actually useful, because it doesn't implement all the
|
|
# semantics to check that what you're asking to write to the wire is sensible,
|
|
# but at least it gets you out of dealing with the wire itself.
|
|
|
|
from h11._connection import Connection, NEED_DATA, PAUSED
|
|
from h11._events import (
|
|
ConnectionClosed,
|
|
Data,
|
|
EndOfMessage,
|
|
Event,
|
|
InformationalResponse,
|
|
Request,
|
|
Response,
|
|
)
|
|
from h11._state import (
|
|
CLIENT,
|
|
CLOSED,
|
|
DONE,
|
|
ERROR,
|
|
IDLE,
|
|
MIGHT_SWITCH_PROTOCOL,
|
|
MUST_CLOSE,
|
|
SEND_BODY,
|
|
SEND_RESPONSE,
|
|
SERVER,
|
|
SWITCHED_PROTOCOL,
|
|
)
|
|
from h11._util import LocalProtocolError, ProtocolError, RemoteProtocolError
|
|
from h11._version import __version__
|
|
|
|
PRODUCT_ID = "python-h11/" + __version__
|
|
|
|
|
|
__all__ = (
|
|
"Connection",
|
|
"NEED_DATA",
|
|
"PAUSED",
|
|
"ConnectionClosed",
|
|
"Data",
|
|
"EndOfMessage",
|
|
"Event",
|
|
"InformationalResponse",
|
|
"Request",
|
|
"Response",
|
|
"CLIENT",
|
|
"CLOSED",
|
|
"DONE",
|
|
"ERROR",
|
|
"IDLE",
|
|
"MUST_CLOSE",
|
|
"SEND_BODY",
|
|
"SEND_RESPONSE",
|
|
"SERVER",
|
|
"SWITCHED_PROTOCOL",
|
|
"ProtocolError",
|
|
"LocalProtocolError",
|
|
"RemoteProtocolError",
|
|
)
|