@@ -11,6 +11,7 @@ import (
1111 "time"
1212
1313 "github.com/hako/durafmt"
14+ "github.com/jetstack/paranoia/cmd/options"
1415)
1516
1617type NoteLevel string
@@ -36,22 +37,23 @@ type Analyser struct {
3637 RemovedCertificates []removedCertificate
3738}
3839
40+ const defaultMozillaRemovedCACertificateReportURL = "https://ccadb.my.salesforce-sites.com/mozilla/RemovedCACertificateReportCSVFormat"
41+
3942// NewAnalyser creates a new Analyzer using the public Mozilla CA removed certificate list as part of
4043// its checks. This method performs HTTP requests to retrieve that list. The request will be made with the given
41- // context. If mozillaRemovedCertsURL is empty, the default Mozilla URL will be used .
42- func NewAnalyser (mozillaRemovedCertsURL string ) (* Analyser , error ) {
43- rc , err := downloadMozillaRemovedCACertsList (mozillaRemovedCertsURL )
44+ // context. The options struct configures various aspects of the analysis .
45+ func NewAnalyser (opts * options. Analyse ) (* Analyser , error ) {
46+ rc , err := downloadMozillaRemovedCACertsList (opts )
4447 if err != nil {
4548 return nil , err
4649 }
4750 return & Analyser {RemovedCertificates : rc }, nil
4851}
4952
50- func downloadMozillaRemovedCACertsList (mozillaRemovedCertsURL string ) ([]removedCertificate , error ) {
51- const defaultMozillaRemovedCACertificateReportURL = "https://ccadb.my.salesforce-sites.com/mozilla/RemovedCACertificateReportCSVFormat"
53+ func downloadMozillaRemovedCACertsList (opts * options.Analyse ) ([]removedCertificate , error ) {
5254
5355 // Use default URL if none provided
54- url := mozillaRemovedCertsURL
56+ url := opts . MozillaRemovedCertsURL
5557 if url == "" {
5658 url = defaultMozillaRemovedCACertificateReportURL
5759 }
0 commit comments