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

Add some code documentation

This commit is contained in:
Fadi Abbud 2022-03-04 16:04:21 +01:00
parent b852ae4ec1
commit aa60e8f245
3 changed files with 33 additions and 0 deletions

View file

@ -42,6 +42,9 @@ func (bc *baseReporter) requirement(domain *Domain) *Requirement {
return req
}
// report tests if the URLs are HTTPS and set the "message" field value
// of the "Requirement" struct as a result of that.
// A list of non HTTPS URLs is included in the value of the "message" field.
func (r *tlsReporter) report(p *processor, domain *Domain) {
req := r.requirement(domain)
if p.noneTLS == nil {
@ -64,6 +67,8 @@ func (r *tlsReporter) report(p *processor, domain *Domain) {
req.message(urls...)
}
// report tests if redirects are used and set the "message" field value
// of the "Requirement" struct as a result of that.
func (r *redirectsReporter) report(p *processor, domain *Domain) {
req := r.requirement(domain)
if len(p.redirects) == 0 {
@ -84,6 +89,8 @@ func (r *redirectsReporter) report(p *processor, domain *Domain) {
req.Messages = keys
}
// report tests if an provider-metatdata.json are available and set the
// "message" field value of the "Requirement" struct as a result of that.
func (r *providerMetadataReport) report(p *processor, domain *Domain) {
req := r.requirement(domain)
if !used(p.badProviderMetadatas) {
@ -97,6 +104,8 @@ func (r *providerMetadataReport) report(p *processor, domain *Domain) {
req.Messages = p.badProviderMetadatas
}
// report tests the "security.txt" file and set the "message" field value
// of the "Requirement" struct as a result of that.
func (r *securityReporter) report(p *processor, domain *Domain) {
req := r.requirement(domain)
if !used(p.badSecurities) {