mirror of
https://github.com/gocsaf/csaf.git
synced 2025-12-22 11:55:40 +01:00
refactor: deduplicate filtering pmd results from security.txt
already done in `loadFromSecurity`
This commit is contained in:
parent
a46c286cf4
commit
51dc9b5bcb
1 changed files with 2 additions and 15 deletions
|
|
@ -178,20 +178,7 @@ func (pmdl *ProviderMetadataLoader) Load(domain string) *LoadedProviderMetadata
|
||||||
}
|
}
|
||||||
|
|
||||||
// Next load the PMDs from security.txt
|
// Next load the PMDs from security.txt
|
||||||
secResults := pmdl.loadFromSecurity(domain)
|
secGoods := pmdl.loadFromSecurity(domain)
|
||||||
|
|
||||||
// Filter out the results which are valid.
|
|
||||||
var secGoods []*LoadedProviderMetadata
|
|
||||||
|
|
||||||
for _, result := range secResults {
|
|
||||||
if len(result.Messages) > 0 {
|
|
||||||
// If there where validation issues append them
|
|
||||||
// to the overall report
|
|
||||||
pmdl.messages.AppendUnique(pmdl.messages)
|
|
||||||
} else {
|
|
||||||
secGoods = append(secGoods, result)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// Mention extra CSAF entries in security.txt.
|
// Mention extra CSAF entries in security.txt.
|
||||||
ignoreExtras := func() {
|
ignoreExtras := func() {
|
||||||
|
|
@ -246,7 +233,7 @@ func (pmdl *ProviderMetadataLoader) Load(domain string) *LoadedProviderMetadata
|
||||||
return dnsURLResult
|
return dnsURLResult
|
||||||
}
|
}
|
||||||
|
|
||||||
// loadFromSecurity loads the PMDs mentioned in the security.txt.
|
// loadFromSecurity loads the PMDs mentioned in the security.txt. Only valid PMDs are returned.
|
||||||
func (pmdl *ProviderMetadataLoader) loadFromSecurity(domain string) []*LoadedProviderMetadata {
|
func (pmdl *ProviderMetadataLoader) loadFromSecurity(domain string) []*LoadedProviderMetadata {
|
||||||
|
|
||||||
// If .well-known fails try legacy location.
|
// If .well-known fails try legacy location.
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue