Skip to content

Commit

Permalink
update atom to get cpg 1.0.1 and the latest protobuf (#1462)
Browse files Browse the repository at this point in the history
* update atom to get cpg 1.0.1 and the latest protobuf

Signed-off-by: Prabhu Subramanian <[email protected]>

* Fetch license for java in deep mode

Signed-off-by: Prabhu Subramanian <[email protected]>

* update atom

Signed-off-by: Prabhu Subramanian <[email protected]>

---------

Signed-off-by: Prabhu Subramanian <[email protected]>
  • Loading branch information
prabhu authored Nov 17, 2024
1 parent aec1e96 commit d83d58a
Show file tree
Hide file tree
Showing 7 changed files with 22 additions and 12 deletions.
2 changes: 1 addition & 1 deletion deno.json
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@
"gen-types": "npx -p typescript tsc"
},
"imports": {
"@appthreat/atom": "npm:@appthreat/[email protected].22",
"@appthreat/atom": "npm:@appthreat/[email protected].24",
"@appthreat/cdx-proto": "npm:@appthreat/[email protected]",
"@babel/parser": "npm:@babel/parser@^7.26.2",
"@babel/traverse": "npm:@babel/traverse@^7.25.7",
Expand Down
2 changes: 1 addition & 1 deletion lib/cli/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -2142,7 +2142,7 @@ export async function createJavaBom(path, options) {
}
}
pkgList = trimComponents(pkgList);
pkgList = await getMvnMetadata(pkgList, jarNSMapping);
pkgList = await getMvnMetadata(pkgList, jarNSMapping, options.deep);
return buildBomNSData(options, pkgList, "maven", {
src: path,
nsMapping: jarNSMapping,
Expand Down
11 changes: 9 additions & 2 deletions lib/helpers/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -3426,8 +3426,15 @@ export function guessLicenseId(content) {
*
* @param {Array} pkgList Package list
* @param {Object} jarNSMapping Jar Namespace mapping object
* @param {Boolean} force Force fetching of license
*
* @returns {Array} Updated package list
*/
export async function getMvnMetadata(pkgList, jarNSMapping = {}) {
export async function getMvnMetadata(
pkgList,
jarNSMapping = {},
force = false,
) {
const MAVEN_CENTRAL_URL =
process.env.MAVEN_CENTRAL_URL || "https://repo1.maven.org/maven2/";
const ANDROID_MAVEN_URL =
Expand Down Expand Up @@ -3472,7 +3479,7 @@ export async function getMvnMetadata(pkgList, jarNSMapping = {}) {
}
const group = p.group || "";
// If the package already has key metadata skip querying maven
if (group && p.name && p.version && !shouldFetchLicense()) {
if (group && p.name && p.version && !shouldFetchLicense() && !force) {
cdepList.push(p);
continue;
}
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@
"yargs": "^17.7.2"
},
"optionalDependencies": {
"@appthreat/atom": "2.0.22",
"@appthreat/atom": "2.0.24",
"@appthreat/cdx-proto": "1.0.1",
"@cyclonedx/cdxgen-plugins-bin": "1.6.9",
"@cyclonedx/cdxgen-plugins-bin-arm": "1.6.9",
Expand Down
10 changes: 5 additions & 5 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 4 additions & 1 deletion types/lib/helpers/utils.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -315,8 +315,11 @@ export function guessLicenseId(content: string): any;
*
* @param {Array} pkgList Package list
* @param {Object} jarNSMapping Jar Namespace mapping object
* @param {Boolean} force Force fetching of license
*
* @returns {Array} Updated package list
*/
export function getMvnMetadata(pkgList: any[], jarNSMapping?: any): Promise<any[]>;
export function getMvnMetadata(pkgList: any[], jarNSMapping?: any, force?: boolean): any[];
/**
* Method to compose URL of pom.xml
*
Expand Down
2 changes: 1 addition & 1 deletion types/lib/helpers/utils.d.ts.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit d83d58a

Please sign in to comment.