Skip to content

I-01C: add session RBAC idempotency transaction guards - #8

Merged
SayQuan1 merged 2 commits into
mainfrom
wsq/i-01c-security-transaction
Sep 30, 2026
Merged

SayQuan1 merged 2 commits into
mainfrom
wsq/i-01c-security-transaction

Conversation

@SayQuan1

Copy link
Copy Markdown
Owner

I-01C scope

Implements transaction-bound session, RBAC, idempotency, audit, tenant-scope, and last-admin security primitives.

Changes

  • add pure domain authorization and expected-version guards
  • add explicit transaction and tenant-lock primitives
  • add Argon2id session login, CSRF derivation/validation, logout, session epoch revocation, and millisecond UTC timestamps
  • add tenant/actor/method/path/key idempotency with 30-second lease, expired-lease takeover, JSON replay, request-hash conflict, and lease-owner fencing
  • add audit-safe append-only writes and user disable/safety_admin revoke with last-active-admin protection
  • add isolated MySQL and pure authorization tests
  • document I-01C implementation boundary and acceptance evidence

Validation

  • python -m ruff check apps packages tests tools/database
  • python -m ruff format --check apps packages tests tools/database
  • business 6 passed, protocol 4 passed, AI 15 passed
  • security unit 7 passed
  • isolated MySQL 8.0.33: 50 passed; 43 tables, 115 FKs, schema drift clean
  • build_specs.py --check: 16 artifacts; test_readiness_design.py: 148 checks

Review / risks

  • security/database changes require two-person review per CONTRIBUTING
  • no migration added; no production database or existing local service was touched
  • API routes, Origin/rate limiting, full role-grant endpoint, and I-02 application command wiring remain explicitly out of this PR
  • OpenAPI validator must be installed from tools/design/requirements.txt for the final contract check

Rollback

Revert this feature commit before enabling application routes; preserve session/audit history and do not delete database records.

Implement transaction-bound sessions, CSRF and epoch revocation, tenant-scoped RBAC, audit-safe idempotency leases with owner fencing, and last-admin protection. Add isolated MySQL and pure authorization tests plus I-01C acceptance documentation.
@SayQuan1

Copy link
Copy Markdown
Owner Author

@1605009600 审PR

@SayQuan987 SayQuan987 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pass

@SayQuan1
SayQuan1 merged commit 7fe593f into main Sep 30, 2026
10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants