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:
@@ -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))
|
||||
}
|
||||
|
||||
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user