NetKingdom facility for tenant management.
Find a file
tegwick 5d57c7d488 TEN-WP-0003: FlexAuthWriteAuthorizer -- gate writes through flex-auth
flex_auth.py: CheckRequest + FlexAuthCheckClient against flex-auth's real
POST /v1/check contract (schemas/check_request.schema.json,
decision_envelope.schema.json, read directly from the flex-auth repo, not
guessed). Fail-closed by construction: only effect=="allow" authorizes;
every other effect, non-200, malformed body, or transport failure resolves
to deny, nothing raises past is_allowed().

authz.FlexAuthWriteAuthorizer implements the existing WriteAuthorizer
Protocol. Action -> resource-type mapping coordinated with FLEX-WP-0008's
planned vocabulary (both repos reference the same table).
DefaultDenyWriteAuthorizer stays the fallback when no flex-auth URL is
configured.

config.py: Settings.from_env(), mirroring qonto-assistant's pattern.
docs/flex-auth-integration.md documents the contract, fail-closed rule,
and current real state (denies everything until FLEX-WP-0008 lands).

60 tests passing. Verified live twice over real HTTP between separate
processes (not just MockTransport): a deny-returning flex-auth double
produces 403 from POST /tenants, an allow-returning one produces 201.

Also registered (not implemented) the two workplans this depends on for a
complete picture: flex-auth/FLEX-WP-0008 (protected-system registration --
what makes allow reachable) and key-cape/KEY-WP-0005 (discovered key-cape
emits none of iam-profile_v0.3.md's core claims yet, not just missing
tenant_roles -- a bigger, security-sensitive gap flagged rather than
quietly worked around).

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-07-23 22:54:44 +02:00
.claude/rules Bootstrap repo: State Hub registration, agent docs, TEN-WP-0001/0002 2026-07-23 21:56:07 +02:00
docs TEN-WP-0003: FlexAuthWriteAuthorizer -- gate writes through flex-auth 2026-07-23 22:54:44 +02:00
registry Bootstrap repo: State Hub registration, agent docs, TEN-WP-0001/0002 2026-07-23 21:56:07 +02:00
src/tenant_engine TEN-WP-0003: FlexAuthWriteAuthorizer -- gate writes through flex-auth 2026-07-23 22:54:44 +02:00
tests TEN-WP-0003: FlexAuthWriteAuthorizer -- gate writes through flex-auth 2026-07-23 22:54:44 +02:00
workplans TEN-WP-0003: FlexAuthWriteAuthorizer -- gate writes through flex-auth 2026-07-23 22:54:44 +02:00
.custodian-brief.md chore(consistency): sync task status from DB [auto] 2026-07-23 22:48:32 +02:00
.gitignore Bootstrap repo: State Hub registration, agent docs, TEN-WP-0001/0002 2026-07-23 21:56:07 +02:00
.repo-classification.yaml Bootstrap repo: State Hub registration, agent docs, TEN-WP-0001/0002 2026-07-23 21:56:07 +02:00
AGENTS.md Bootstrap repo: State Hub registration, agent docs, TEN-WP-0001/0002 2026-07-23 21:56:07 +02:00
CLAUDE.md Bootstrap repo: State Hub registration, agent docs, TEN-WP-0001/0002 2026-07-23 21:56:07 +02:00
INTENT.md TEN-WP-0003: FlexAuthWriteAuthorizer -- gate writes through flex-auth 2026-07-23 22:54:44 +02:00
LICENSE Initial commit 2026-07-23 19:40:36 +00:00
Makefile TEN-WP-0002 T01-T03: service skeleton, domain model, storage layer 2026-07-23 22:01:23 +02:00
pyproject.toml TEN-WP-0003: FlexAuthWriteAuthorizer -- gate writes through flex-auth 2026-07-23 22:54:44 +02:00
README.md Initial commit 2026-07-23 19:40:36 +00:00
SCOPE.md TEN-WP-0003: FlexAuthWriteAuthorizer -- gate writes through flex-auth 2026-07-23 22:54:44 +02:00
WORK-RECORDS.md TEN-WP-0003: FlexAuthWriteAuthorizer -- gate writes through flex-auth 2026-07-23 22:54:44 +02:00

tenant-engine

NetKingdom facility for tenant management.