@using AIStudio.Agents.AssistantAudit @inherits MSGComponentBase @if (this.Plugin is not null) { var state = this.SecurityState;
@T("Assistant Security") @state.AuditLabel @if (!string.IsNullOrWhiteSpace(state.SourceLabel)) { @state.SourceLabel } @if (!string.IsNullOrWhiteSpace(state.AvailabilityLabel)) { @state.AvailabilityLabel }
@state.Headline
@if (state.IsEnterpriseApproved) { @T("Enterprise approval is active") } else { @T("Confidence"): @this.GetConfidenceLabel() } @this.GetFindingSummary() @this.GetAuditTimestampLabel() @state.Description
@T("Technical Details")
@T("Plugin ID") @this.Plugin.Id @T("Status source") @state.SourceLabel @T("Current hash") @GetShortHash(state.CurrentHash) @if (state.EnterpriseApproval is not null) { @T("Approved hash") @GetShortHash(state.EnterpriseApproval.PluginHash) @if (!string.IsNullOrWhiteSpace(state.EnterpriseApproval.DisplayName)) { @T("Approved name") @state.EnterpriseApproval.DisplayName } @if (!string.IsNullOrWhiteSpace(state.EnterpriseApproval.ApprovedBy)) { @T("Approved by") @state.EnterpriseApproval.ApprovedBy } @if (state.EnterpriseApproval.ApprovedAtUtc is not null) { @T("Approved at") @this.FormatFileTimestamp(state.EnterpriseApproval.ApprovedAtUtc.Value.ToLocalTime().DateTime) } @if (!string.IsNullOrWhiteSpace(state.EnterpriseApproval.Comment)) { @T("Approval comment") @state.EnterpriseApproval.Comment } } @if (state.Audit is not null) { @T("Audit hash") @GetShortHash(state.Audit.PluginHash) @T("Audit provider") @this.GetAuditProviderLabel() @T("Audited at") @this.FormatFileTimestamp(state.Audit.AuditedAtUtc.ToLocalTime().DateTime) @T("Audit level") @state.AuditLabel @T("Availability") @state.AvailabilityLabel } @T("Required minimum") @state.Settings.MinimumLevel.GetName()
@if (state.Audit is null) { @if (state.IsEnterpriseApproved) { @T("This plugin is approved by your organization. A manual security audit is not required.") } else { @T("No stored audit details are available yet.") } } else if (state.Audit.Findings.Count == 0) { @T("No security findings were stored for this assistant plugin.") } else {
@foreach (var finding in state.Audit.Findings) { @finding.Category: @finding.Description @if (!string.IsNullOrWhiteSpace(finding.Location)) {
@finding.Location
}
}
}
@state.ActionLabel @T("Close")
}