-
Notifications
You must be signed in to change notification settings - Fork 603
🌱 Set OSV User-Agent for scorecard cli and cron workers. #4883
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
|
This pull request has been marked stale because it has been open for 10 days with no activity |
|
You can track the upstream issue here at google/osv-scanner#2420 We'll need to wait for a new osv-scanner release before we can set it. |
Signed-off-by: kash2104 <kparikh1104@gmail.com>
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## main #4883 +/- ##
==========================================
+ Coverage 66.80% 69.70% +2.90%
==========================================
Files 230 251 +21
Lines 16602 15652 -950
==========================================
- Hits 11091 10911 -180
+ Misses 4808 3867 -941
- Partials 703 874 +171 🚀 New features to boost your workflow:
|
|
@Ly-Joey Can you take a quick look to confirm this is correct? |
|
|
+1 to this. The current strategy was based on the old package global. We might need a new flag in our osv-client representing the source, that way when we initialize the client we can pass in a string to use for the user agent. maybe something like this? And then tweaking DefaultVulnerabilitiesClient to use NewOSVClient for backwards compatibility. (and we can get rid of type OSVConfig struct {
ExperimentalLocal bool
UserAgent string
}
func NewOSVClient(config *OSVConfig) VulnerabilitiesClient {
if config == nil { // some defaults }
// store as needed
} |
|
Will look into it. |
What kind of change does this PR introduce?
This PR introduces improvement to OSV API request by configuring versioned User-Agent for Scorecard.
What is the current behavior?
Currently API requests to
osv.devare made without specifying a unique user-agent.What is the new behavior (if this is a feature change)?**
Now a distinct, versioned user agent is set for the OSV API request:
scorecard/{version}for CLIscorecard-cron/{version}for cron workersUses
GetId()andGetAliases()inclients/osv.goas per the latest updates in the osv scanner package.Tests for the changes have been added (for bug fixes/features)
Which issue(s) this PR fixes
Fixes #4029
Special notes for your reviewer
osv-scanner/1.9.2has been installed.Does this PR introduce a user-facing change?
No
For user-facing changes, please add a concise, human-readable release note to
the
release-note(In particular, describe what changes users might need to make in their
application as a result of this pull request.)