Qiao-yq opened a new pull request, #1592: URL: https://github.com/apache/dubbo-admin/pull/1592
## Summary Implements the Session ownership and tenant/user isolation foundation for Issue #1539. - add server-owned `Subject` and explicit `AccessContext` - persist tenant, owner, version, and expiration on Sessions - enforce tenant/owner isolation in Memory and GORM stores - apply authorization across Session APIs, chat, history, and deletion - add explicit maintenance interfaces for expiration cleanup and legacy adoption - harden static authentication defaults and require an explicit Router authenticator - add shared Memory/GORM ownership and lifecycle contract tests ## Scope This PR implements the Session ownership portion of requirement 4 and establishes the authentication and policy interfaces used by later work. Static authentication is intentionally limited to local development: - defaults to `127.0.0.1` - CORS is disabled by default - non-loopback binding requires `allow_insecure_static_auth: true` - system maintenance access is rejected by the HTTP middleware Legacy Session adoption is disabled by default. When explicitly enabled, it adopts only rows where both tenant and owner are absent. Partially owned rows remain isolated for manual repair. ## Out of scope This PR does **not** claim to fully complete Issue requirement 4. - production JWT or signed-gateway authentication is deferred to the Phase 1 G1 delivery described in the proposal - resource-level ACL resolution and `AuthorizedResourceScope` are not implemented; `ResourceReference` remains untrusted input - idempotency, quotas, retention configuration, deletion propagation, Sanitizer, Usage/Cost, and Context Compiler work remain in later PRs Until production authentication and resource-level authorization are delivered, this change provides Session ownership isolation but must not be treated as complete production identity isolation. ## Compatibility and migration - Store APIs now require `AccessContext`, so callers inside the AI module were updated together. - `SessionStore` and `MessageStore` expose business operations only; privileged cleanup and adoption use `MaintenanceStore`. - GORM ownership columns remain migration-compatible with existing rows. - Memory and GORM use the same Session validation, active-state, expiration, and ownership contract. ## Validation - `go test ./...` - `go vet ./...` - `go test -race ./security ./store/test ./store/memory ./store/gorm ./component/server/...` - `git diff --check` Related to #1539. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
