fix(security): redact integration secrets from viewer-accessible endpoints
Prevent low-privileged tenant members from reading raw API keys and infrastructure credentials via tenant profile, KV config, model/MCP/web search listings, and KB initialization config responses.
This commit is contained in:
@@ -0,0 +1,22 @@
|
||||
package dto
|
||||
|
||||
import (
|
||||
"context"
|
||||
|
||||
"github.com/Tencent/WeKnora/internal/types"
|
||||
)
|
||||
|
||||
func adminContext() context.Context {
|
||||
ctx := context.Background()
|
||||
return context.WithValue(ctx, types.TenantRoleContextKey, types.TenantRoleAdmin)
|
||||
}
|
||||
|
||||
func viewerContext() context.Context {
|
||||
ctx := context.Background()
|
||||
return context.WithValue(ctx, types.TenantRoleContextKey, types.TenantRoleViewer)
|
||||
}
|
||||
|
||||
func ownerContext() context.Context {
|
||||
ctx := context.Background()
|
||||
return context.WithValue(ctx, types.TenantRoleContextKey, types.TenantRoleOwner)
|
||||
}
|
||||
Reference in New Issue
Block a user