Skip to content
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

feat(server): support passing fetchLicense #1286

Draft
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

setchy
Copy link
Member

@setchy setchy commented Aug 1, 2024

Add support for fetching license information dynamically via CDXGEN Server as an API argument.

The allows the calling workflow to determine if they want license enrichment, or not.

Also added some additional logging to some of the metadata lookup functions. (lots more is desirable still)


Also, while performing this update, I noticed that getMvnMetadata() looked a bit unusual

cdxgen/utils.js

Line 3179 in aa6552b

if (DEBUG_MODE && FETCH_LICENSE) {

Unclear why the FETCH_LICENSE guard is only applied to a log statement and not any of the metadata logic

@setchy setchy requested a review from prabhu as a code owner August 1, 2024 22:04
@setchy setchy added the mode:server cdxgen used as server label Aug 1, 2024
setchy added 3 commits August 2, 2024 08:40
Signed-off-by: Adam Setch <adam.setch@outlook.com>
Signed-off-by: Adam Setch <adam.setch@outlook.com>
Signed-off-by: Adam Setch <adam.setch@outlook.com>
@setchy setchy force-pushed the feature/server-mode-licenses-arg branch from 793a7dc to 074b4d3 Compare August 1, 2024 22:40
@@ -115,6 +116,9 @@ const parseQueryString = (q, body, options = {}) => {
if (options.profile) {
applyProfileOptions(options);
}
if (options.fetchLicense) {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since node is a single process event driven model, one request will affect multiple responses. We need to refactor the codebase and make the fetch license operate with an options argument instead of only relying on env variables

@setchy setchy marked this pull request as draft August 2, 2024 19:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
mode:server cdxgen used as server
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants