mirror of
https://github.com/tiennm99/goclaw.git
synced 2026-10-13 08:15:29 +00:00
Revert "fix(http): propagate cross-tenant context in HTTP auth middleware (#427)"
This reverts commit 39b7c689f2.
This commit is contained in:
1 parent
39b7c689f2
commit
0209f6f970
1 file changed
+1
-5
@@ -289,17 +289,14 @@ func requireAuth(minRole permissions.Role, next http.HandlerFunc) http.HandlerFu
|
||||
}
|
||||
if auth.CrossTenant && auth.TenantID != uuid.Nil {
|
||||
// Cross-tenant admin with tenant scope: filter data by chosen tenant
|
||||
ctx = store.WithCrossTenant(ctx)
|
||||
ctx = store.WithTenantID(ctx, auth.TenantID)
|
||||
slog.Debug("security.http_auth_resolved",
|
||||
"path", r.URL.Path,
|
||||
"role", string(auth.Role),
|
||||
"cross_tenant", true,
|
||||
"tenant_scope", auth.TenantID.String(),
|
||||
)
|
||||
} else if auth.CrossTenant {
|
||||
// Cross-tenant admin without scope: default to MasterTenantID.
|
||||
ctx = store.WithCrossTenant(ctx)
|
||||
// Auto-scope to MasterTenantID so all operations use a concrete tenant.
|
||||
ctx = store.WithTenantID(ctx, store.MasterTenantID)
|
||||
slog.Debug("security.http_auth_resolved",
|
||||
"path", r.URL.Path,
|
||||
@@ -370,7 +367,6 @@ func requireAuthBearer(minRole permissions.Role, bearer string, w http.ResponseW
|
||||
ctx = store.WithUserID(ctx, userID)
|
||||
}
|
||||
if auth.CrossTenant {
|
||||
ctx = store.WithCrossTenant(ctx)
|
||||
ctx = store.WithTenantID(ctx, store.MasterTenantID)
|
||||
} else if auth.TenantID != uuid.Nil {
|
||||
ctx = store.WithTenantID(ctx, auth.TenantID)
|
||||
|
||||
Reference in new issue
Block a user