Skip to content

Commit

Permalink
Add a user-agent header
Browse files Browse the repository at this point in the history
  • Loading branch information
katzj committed Jul 15, 2024
1 parent 972fe3b commit 94118cc
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
1 change: 1 addition & 0 deletions cmd/tidelift-sbom-vulnerability-reporter/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,7 @@ func writeVulnerabilitiesReport(outputFile string, purls []packageurl.PackageURL
ContentType("application/json").
// TODO: could use the full auth setup that we do in the tidelift cli
Header("Authorization", "Bearer "+os.Getenv("TIDELIFT_API_KEY")).
Header("User-Agent", "tidelift-sbom-info/0.1").
Fetch(context.Background()); err != nil {
log.Warn(fmt.Sprintf("problem fetching vulnerability info %s ", err))
continue
Expand Down
2 changes: 2 additions & 0 deletions internal/utils/utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ func GetPackageInfo(purls []packageurl.PackageURL) ([]api.PackageDetail, []api.P
ContentType("application/json").
// TODO: could use the full auth setup that we do in the tidelift cli
Header("Authorization", "Bearer "+os.Getenv("TIDELIFT_API_KEY")).
Header("User-Agent", "tidelift-sbom-info/0.1").
Fetch(context.Background()); err != nil {
log.Warn(fmt.Sprintf("problem fetching package info %s ", err))
}
Expand All @@ -65,6 +66,7 @@ func GetReleaseInfo(purls []packageurl.PackageURL) ([]api.ReleaseDetail, []Packa
ContentType("application/json").
// TODO: could use the full auth setup that we do in the tidelift cli
Header("Authorization", "Bearer "+os.Getenv("TIDELIFT_API_KEY")).
Header("User-Agent", "tidelift-sbom-info/0.1").
Fetch(context.Background()); err != nil {
log.Warn(fmt.Sprintf("problem fetching package info %s ", err))
}
Expand Down

0 comments on commit 94118cc

Please sign in to comment.