-
Notifications
You must be signed in to change notification settings - Fork 9
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
Consider CI-friendly specification of nvd api key token #66
Comments
Would it be worth having a general mechanism where |
That's is an interesting idea. So, I don't currently have a need for this generality, but it is interesting. Waddya think? |
I'm thinking the order of things should be:
That should be backward-compatible and CI-friendly and general enough for the future. |
Yeah, that seems solid to me! |
See also discussion in #70 around |
Oh, what about Java system properties? Should they come into play? |
Just checked: Dependency Check is affected by system properties passed in on the cmd line. |
Can you link me to how/where DC uses JVM system properties? I had a quick search of the docs and code and couldn't see that... |
I did not look in their code, but tried it like so from clj-watson
Notice 1 update of db: And now if I repeat:
Notice 2 upates:
This is pre-merge of #90. |
This looks like it |
Ah, well spotted! I was searching for |
Since we are talking about config, I guess it is probably a good idea to state these changes do not apply to:
|
Correct. |
PR #99 handled the So, the main work left here is:
Then I think split the env var stuff into a separate ticket (or at least PR) and determine whether env vars or JVM properties should take precedence? I think since core handles the JVM properties, the only way to have env vars override is to programmatically call Are JVM properties sufficiently CI-friendly, or does it really need to be env vars? |
I think system properties typically override env vars? $ clojure -M -e "(-> (java.util.TimeZone/getDefault) .getDisplayName)"
"Eastern Standard Time"
$ TZ="US/Hawaii" clojure -M -e "(-> (java.util.TimeZone/getDefault) .getDisplayName)"
"Hawaii-Aleutian Standard Time"
$ TZ="US/Hawaii" clojure -J-Duser.timezone="UTC" -M -e "(-> (java.util.TimeZone/getDefault) .getDisplayName)"
"Coordinated Universal Time" Because an option can be configured in multiple ways, it would be nice to summarize from where a user-specified option is sourced. But maybe this is more #79.
An environment variable for a secret is nice because it avoids the question, "Is CI going to expose my secret?". CI systems will mask secrets, but as a dev, I'd rather not wonder if I should trust a CI system to do so. |
OK, so the order of property handling is going to be: Either:
Or:
Followed by:
Does that sound right? Said another way:
|
Yes, I think that makes sense. |
It feels like this is still quite a chunk of work, so maybe we want to split it into two (or three?) separate issues to address in PRs. I think that once this issue and associated documentation issues are addressed, I'd like to cut a 6.0.0-beta release for folks to test (a lot has changed since 5.1.3 but I don't think any of it is really "breaking" but the API key workflow could be a big change for some users). Once 6.0.0 is tested and goes "gold", we can look at some of the other issues on the board for 6.1.0 release. |
Great idea to cut a release! It's nice to get changes out there to exercise them and hopefully get some feedback. And yes, I agree: I raised this issue with a very specific problem, but we're discussing a broader revamp of how users can convey options to clj-watson. So I think this issue should remain open until it is addressed, but creating separate issues/PRs makes sense to me too. |
Yeah I think that covers it @seancorfield. |
Closed via #108 |
Currently...
The nvd data feed api key can be specified only in a
--clj-watson-properties
file.But...
This makes things a bit awkward for CI usage, where the token would typically be stored as a secret.
Options
Option 1: Do nothing
Tough cookies, spit a
clj-watson.properties
file out on CI and, and use that.Option 2: Allow token to be specified via env var.
CI secrets are often conveyed to a step via an environment variable.
Introduce
CLJ_WATSON_NVD_API_KEY
environment variable.If set, it would take precedence over a token specified in the
--clj-watson-properties
file.Proposal
I like option 2.
Next Steps
I am happy to explore further.
If you agree we should take action, I volunteer to create a PR.
The text was updated successfully, but these errors were encountered: