fix(security): close init config and parser-check redaction gaps

Strip model base URLs from viewer-accessible initialization config
responses and merge redacted parser secrets before engine check overrides
so admin test flows keep working after masked GET responses.
This commit is contained in:
wizardchen
2026-07-02 14:38:41 +08:00
committed by lyingbug
parent 1a264e09c1
commit fc64751f4e
6 changed files with 113 additions and 12 deletions
+6 -1
View File
@@ -16,7 +16,12 @@ func CanViewIntegrationSecrets(ctx context.Context) bool {
return RoleFromContext(ctx).HasPermission(types.TenantRoleAdmin)
}
// RoleCanViewTenantAPIKey is true for Owner+ only.
func RoleCanViewTenantAPIKey(role types.TenantRole) bool {
return role.HasPermission(types.TenantRoleOwner)
}
// CanViewTenantAPIKey is true for Owner+ only.
func CanViewTenantAPIKey(ctx context.Context) bool {
return RoleFromContext(ctx).HasPermission(types.TenantRoleOwner)
return RoleCanViewTenantAPIKey(RoleFromContext(ctx))
}
+1 -1
View File
@@ -45,7 +45,7 @@ func NewTenantResponseWithRole(tenant *types.Tenant, role types.TenantRole) *Ten
return nil
}
includeSecrets := role.HasPermission(types.TenantRoleAdmin)
includeAPIKey := role.HasPermission(types.TenantRoleOwner)
includeAPIKey := RoleCanViewTenantAPIKey(role)
resp := &TenantResponse{
ID: tenant.ID,