when listing incoming tls reports, don't show "(no policy)" for tlsa policies

that hint was meant for the mode of a sts policy. for tlsa (and
no-policy-found), there is not going to be a mode.
This commit is contained in:
Mechiel Lukkien 2023-11-12 11:50:48 +01:00
parent 1d02760f66
commit 448879126d
No known key found for this signature in database

View File

@ -1653,6 +1653,17 @@ const domainTLSRPT = async (d) => {
api.Domain(d), api.Domain(d),
]) ])
const policyType = (policy) => {
let s = policy['policy-type']
if (s === 'sts') {
const mode = (policy['policy-string'] || []).find(s => s.startsWith('mode:'))
if (mode) {
s += ': '+mode.replace('mode:', '').trim()
}
}
return s
}
const page = document.getElementById('page') const page = document.getElementById('page')
dom._kids(page, dom._kids(page,
crumbs( crumbs(
@ -1707,7 +1718,7 @@ const domainTLSRPT = async (d) => {
dom.td(reportRowSpan, valignTop, period(new Date(r['date-range']['start-datetime']), new Date(r['date-range']['end-datetime']))), dom.td(reportRowSpan, valignTop, period(new Date(r['date-range']['start-datetime']), new Date(r['date-range']['end-datetime']))),
], ],
index > 0 ? [] : [ index > 0 ? [] : [
dom.td(resultRowSpan, valignTop, '' + result.policy['policy-type']+': '+((result.policy['policy-string'] || []).filter(s => s.startsWith('mode:'))[0] || '(no policy)').replace('mode:', '').trim(), attr({title: (result.policy['policy-string'] || []).join('\n')})), dom.td(resultRowSpan, valignTop, policyType(result.policy), attr({title: (result.policy['policy-string'] || []).join('\n')})),
dom.td(resultRowSpan, valignTop, alignRight, '' + result.summary['total-successful-session-count']), dom.td(resultRowSpan, valignTop, alignRight, '' + result.summary['total-successful-session-count']),
dom.td(resultRowSpan, valignTop, alignRight, '' + result.summary['total-failure-session-count']), dom.td(resultRowSpan, valignTop, alignRight, '' + result.summary['total-failure-session-count']),
], ],