1
0
Fork 0
mirror of https://github.com/gocsaf/csaf.git synced 2025-12-22 05:40:11 +01:00

Write directory_urls in provider if write indices.

This commit is contained in:
Sascha L. Teichmann 2022-07-30 12:20:21 +02:00
parent 4c0785c060
commit 8af0aeea46
2 changed files with 23 additions and 0 deletions

View file

@ -298,6 +298,17 @@ func createProviderMetadata(c *config, wellknownCSAF string) error {
pm := csaf.NewProviderMetadataDomain(c.CanonicalURLPrefix, c.modelTLPs())
c.ProviderMetaData.apply(pm)
// We have directory based distributions.
if c.WriteIndices {
// Every TLP as a distribution?
for _, t := range c.TLPs {
if t != tlpCSAF {
pm.AddDirectoryDistribution(
c.CanonicalURLPrefix + "/.well-known/csaf/" + string(t))
}
}
}
key, err := loadCryptoKeyFromFile(c.OpenPGPPublicKey)
if err != nil {
return fmt.Errorf("cannot load public key: %v", err)