diff --git a/docs/ENV.md b/docs/ENV.md index 89144b785..740e115a6 100644 --- a/docs/ENV.md +++ b/docs/ENV.md @@ -66,3 +66,4 @@ The following environment variables are available to configure the bom generatio | SWIFT_COMPILER_ARGS | Full compiler arguments string to use for semantic analysis. Eg: -sdk -F -Xcc -I | | SWIFT_SDK_ARGS | Swift sdk arguments. Eg: -sdk | | SWIFT_COMPILER_EXTRA_ARGS | Extra compiler arguments to add to the auto-detected string. Eg: -suppress-warnings -track-system-dependencies | +| GO_FETCH_VCS | Set this variable to `true` or `1` to fetch vcs url from pkg.go.dev. For golang | \ No newline at end of file diff --git a/lib/helpers/utils.js b/lib/helpers/utils.js index af4b72e00..61e6c850d 100644 --- a/lib/helpers/utils.js +++ b/lib/helpers/utils.js @@ -142,6 +142,12 @@ export function shouldFetchLicense() { ); } +export function shouldFetchVCS() { + return ( + process.env.GO_FETCH_VCS && ["true", "1"].includes(process.env.GO_FETCH_VCS) + ); +} + // Whether license information should be fetched export const FETCH_LICENSE = shouldFetchLicense(); @@ -4956,18 +4962,13 @@ export async function getRepoLicense(repoUrl, repoMetadata) { */ export async function getGoPkgLicense(repoMetadata) { const group = repoMetadata.group; - const name = repoMetadata.name; - let pkgUrlPrefix = process.env.GO_PKG_URL || "https://pkg.go.dev/"; - if (group && group !== "." && group !== name) { - pkgUrlPrefix = `${pkgUrlPrefix + group}/`; - } - pkgUrlPrefix = `${pkgUrlPrefix + name}?tab=licenses`; + const pkgUrl = `${getGoPkgUrl(repoMetadata)}?tab=licenses`; // Check the metadata cache first - if (metadata_cache[pkgUrlPrefix]) { - return metadata_cache[pkgUrlPrefix]; + if (metadata_cache[pkgUrl]) { + return metadata_cache[pkgUrl]; } try { - const res = await cdxgenAgent.get(pkgUrlPrefix); + const res = await cdxgenAgent.get(pkgUrl); if (res?.body) { const $ = load(res.body); let licenses = $("#LICENSE > h2").text().trim(); @@ -4988,11 +4989,11 @@ export async function getGoPkgLicense(repoMetadata) { } else { alicense.id = id.trim(); } - alicense["url"] = pkgUrlPrefix; + alicense["url"] = pkgUrl; licList.push(alicense); } } - metadata_cache[pkgUrlPrefix] = licList; + metadata_cache[pkgUrl] = licList; return licList; } } catch (err) { @@ -5004,6 +5005,35 @@ export async function getGoPkgLicense(repoMetadata) { return undefined; } +/** + * Method to get go pkg vcs url from go.dev site. + * + * @param {String} group Package group + * @param {String} name Package name + */ +async function getGoPkgVCSUrl(group, name) { + const fullName = getGoPkgFullName(group, name); + if (fullName.startsWith("github.com") || fullName.startsWith("gitlab.com")) { + return `https://${fullName}`; + } + const pkgUrl = getGoPkgUrl({ fullName }); + if (metadata_cache[pkgUrl]) { + return metadata_cache[pkgUrl]; + } + try { + const res = await cdxgenAgent.get(pkgUrl); + if (res?.body) { + const $ = load(res.body); + const vcs = $("div.UnitMeta-repo").children("a").attr("href"); + metadata_cache[pkgUrl] = vcs; + return vcs; + } + } catch (err) { + return undefined; + } + return undefined; +} + export async function getGoPkgComponent(group, name, version, hash) { let license = undefined; if (shouldFetchLicense()) { @@ -5021,7 +5051,11 @@ export async function getGoPkgComponent(group, name, version, hash) { const purlString = new PackageURL("golang", group, name, version) .toString() .replace(/%2F/g, "/"); - return { + let vcs = undefined; + if (shouldFetchVCS()) { + vcs = await getGoPkgVCSUrl(group, name); + } + const packageInfo = { group: group, name: name, version: version, @@ -5030,6 +5064,33 @@ export async function getGoPkgComponent(group, name, version, hash) { purl: purlString, "bom-ref": decodeURIComponent(purlString), }; + if (vcs) { + packageInfo.externalReferences = [{ type: "vcs", url: vcs }]; + } + return packageInfo; +} + +/** + * Method to get go pkg url (go.dev site). + * + * @param {Object} pkgMetadata pkg metadata + */ +function getGoPkgUrl(pkgMetadata) { + const pkgUrlPrefix = process.env.GO_PKG_URL || "https://pkg.go.dev/"; + const fullName = + pkgMetadata.fullName || + getGoPkgFullName(pkgMetadata.group, pkgMetadata.name); + return pkgUrlPrefix + fullName; +} + +/** + * Method to get go pkg full name. + * + * @param {String} group Package group + * @param {String} name Package name + */ +function getGoPkgFullName(group, name) { + return group && group !== "." && group !== name ? `${group}/${name}` : name; } /** diff --git a/lib/helpers/utils.test.js b/lib/helpers/utils.test.js index 118c650a9..d04c986cd 100644 --- a/lib/helpers/utils.test.js +++ b/lib/helpers/utils.test.js @@ -1,7 +1,7 @@ import { Buffer } from "node:buffer"; import { readFileSync } from "node:fs"; import path from "node:path"; -import { expect, test } from "@jest/globals"; +import { afterAll, beforeAll, describe, expect, test } from "@jest/globals"; import { parse } from "ssri"; import { buildObjectForGradleModule, @@ -1088,6 +1088,428 @@ test("parseGoSumData", async () => { }); }, 120000); +describe("go data with vcs", () => { + beforeAll(() => { + process.env.GO_FETCH_VCS = "true"; + }); + afterAll(() => { + delete process.env.GO_FETCH_VCS; + }); + test("parseGoSumData with vcs", async () => { + let dep_list = await parseGosumData(null); + expect(dep_list).toEqual([]); + dep_list = await parseGosumData( + readFileSync("./test/gomod/go.sum", { encoding: "utf-8" }), + ); + expect(dep_list.length).toEqual(4); + expect(dep_list[0]).toEqual({ + group: "", + name: "google.golang.org/grpc", + license: undefined, + version: "v1.21.0", + _integrity: "sha256-oYelfM1adQP15Ek0mdvEgi9Df8B9CZIaU1084ijfRaM=", + "bom-ref": "pkg:golang/google.golang.org/grpc@v1.21.0", + purl: "pkg:golang/google.golang.org/grpc@v1.21.0", + externalReferences: [ + { + type: "vcs", + url: "https://github.com/grpc/grpc-go", + }, + ], + }); + expect(dep_list[1]).toEqual({ + group: "", + name: "github.com/spf13/cobra", + license: undefined, + version: "v1.0.0", + _integrity: "sha256-/6GTrnGXV9HjY+aR4k0oJ5tcvakLuG6EuKReYlHNrgE=", + "bom-ref": "pkg:golang/github.com/spf13/cobra@v1.0.0", + purl: "pkg:golang/github.com/spf13/cobra@v1.0.0", + externalReferences: [ + { + type: "vcs", + url: "https://github.com/spf13/cobra", + }, + ], + }); + expect(dep_list[2]).toEqual({ + group: "", + name: "github.com/spf13/viper", + license: undefined, + version: "v1.0.2", + _integrity: "sha256-A8kyI5cUJhb8N+3pkfONlcEcZbueH6nhAm0Fq7SrnBM=", + "bom-ref": "pkg:golang/github.com/spf13/viper@v1.0.2", + purl: "pkg:golang/github.com/spf13/viper@v1.0.2", + externalReferences: [ + { + type: "vcs", + url: "https://github.com/spf13/viper", + }, + ], + }); + expect(dep_list[3]).toEqual({ + group: "", + name: "github.com/stretchr/testify", + license: undefined, + version: "v1.6.1", + _integrity: "sha256-6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=", + "bom-ref": "pkg:golang/github.com/stretchr/testify@v1.6.1", + purl: "pkg:golang/github.com/stretchr/testify@v1.6.1", + externalReferences: [ + { + type: "vcs", + url: "https://github.com/stretchr/testify", + }, + ], + }); + dep_list.forEach((d) => { + expect(d.license); + }); + }, 120000); + + test("parseGoModData", async () => { + let retMap = await parseGoModData(null); + expect(retMap).toEqual({}); + const gosumMap = { + "google.golang.org/grpc@v1.21.0": + "sha256-oYelfM1adQP15Ek0mdvEgi9Df8B9CZIaU1084ijfRaM=", + "github.com/aws/aws-sdk-go@v1.38.47": "sha256-fake-sha-for-aws-go-sdk=", + "github.com/spf13/cobra@v1.0.0": + "sha256-/6GTrnGXV9HjY+aR4k0oJ5tcvakLuG6EuKReYlHNrgE=", + "github.com/spf13/viper@v1.3.0": + "sha256-A8kyI5cUJhb8N+3pkfONlcEcZbueH6nhAm0Fq7SrnBM=", + "github.com/stretchr/testify@v1.6.1": + "sha256-6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=", + }; + retMap = await parseGoModData( + readFileSync("./test/gomod/go.mod", { encoding: "utf-8" }), + gosumMap, + ); + expect(retMap.pkgList.length).toEqual(6); + expect(retMap.pkgList).toEqual([ + { + group: "", + name: "github.com/aws/aws-sdk-go", + version: "v1.38.47", + _integrity: "sha256-fake-sha-for-aws-go-sdk=", + purl: "pkg:golang/github.com/aws/aws-sdk-go@v1.38.47", + "bom-ref": "pkg:golang/github.com/aws/aws-sdk-go@v1.38.47", + externalReferences: [ + { + type: "vcs", + url: "https://github.com/aws/aws-sdk-go", + }, + ], + }, + { + group: "", + name: "github.com/spf13/cobra", + version: "v1.0.0", + _integrity: "sha256-/6GTrnGXV9HjY+aR4k0oJ5tcvakLuG6EuKReYlHNrgE=", + purl: "pkg:golang/github.com/spf13/cobra@v1.0.0", + "bom-ref": "pkg:golang/github.com/spf13/cobra@v1.0.0", + externalReferences: [ + { + type: "vcs", + url: "https://github.com/spf13/cobra", + }, + ], + }, + { + group: "", + name: "github.com/spf13/viper", + version: "v1.0.2", + purl: "pkg:golang/github.com/spf13/viper@v1.0.2", + "bom-ref": "pkg:golang/github.com/spf13/viper@v1.0.2", + externalReferences: [ + { + type: "vcs", + url: "https://github.com/spf13/viper", + }, + ], + }, + { + group: "", + name: "github.com/spf13/viper", + version: "v1.3.0", + _integrity: "sha256-A8kyI5cUJhb8N+3pkfONlcEcZbueH6nhAm0Fq7SrnBM=", + purl: "pkg:golang/github.com/spf13/viper@v1.3.0", + "bom-ref": "pkg:golang/github.com/spf13/viper@v1.3.0", + externalReferences: [ + { + type: "vcs", + url: "https://github.com/spf13/viper", + }, + ], + }, + { + group: "", + name: "google.golang.org/grpc", + version: "v1.21.0", + _integrity: "sha256-oYelfM1adQP15Ek0mdvEgi9Df8B9CZIaU1084ijfRaM=", + purl: "pkg:golang/google.golang.org/grpc@v1.21.0", + "bom-ref": "pkg:golang/google.golang.org/grpc@v1.21.0", + externalReferences: [ + { + type: "vcs", + url: "https://github.com/grpc/grpc-go", + }, + ], + }, + { + group: "", + name: "google.golang.org/grpc", + version: "v1.32.0", + purl: "pkg:golang/google.golang.org/grpc@v1.32.0", + "bom-ref": "pkg:golang/google.golang.org/grpc@v1.32.0", + externalReferences: [ + { + type: "vcs", + url: "https://github.com/grpc/grpc-go", + }, + ], + }, + ]); + + retMap.pkgList.forEach((d) => { + expect(d.license); + }); + retMap = await parseGoModData( + readFileSync("./test/data/go-dvwa.mod", { encoding: "utf-8" }), + {}, + ); + expect(retMap.parentComponent).toEqual({ + "bom-ref": "pkg:golang/github.com/sqreen/go-dvwa", + name: "github.com/sqreen/go-dvwa", + purl: "pkg:golang/github.com/sqreen/go-dvwa", + type: "application", + }); + expect(retMap.pkgList.length).toEqual(19); + expect(retMap.rootList.length).toEqual(4); + retMap = await parseGoModData( + readFileSync("./test/data/go-syft.mod", { encoding: "utf-8" }), + {}, + ); + expect(retMap.parentComponent).toEqual({ + "bom-ref": "pkg:golang/github.com/anchore/syft", + name: "github.com/anchore/syft", + purl: "pkg:golang/github.com/anchore/syft", + type: "application", + }); + expect(retMap.pkgList.length).toEqual(239); + expect(retMap.rootList.length).toEqual(84); + }, 120000); +}); + +describe("go data with licenses", () => { + beforeAll(() => { + process.env.FETCH_LICENSE = "true"; + }); + afterAll(() => { + delete process.env.FETCH_LICENSE; + }); + test("parseGoSumData with licenses", async () => { + let dep_list = await parseGosumData(null); + expect(dep_list).toEqual([]); + dep_list = await parseGosumData( + readFileSync("./test/gomod/go.sum", { encoding: "utf-8" }), + ); + expect(dep_list.length).toEqual(4); + expect(dep_list[0]).toEqual({ + group: "", + name: "google.golang.org/grpc", + version: "v1.21.0", + _integrity: "sha256-oYelfM1adQP15Ek0mdvEgi9Df8B9CZIaU1084ijfRaM=", + "bom-ref": "pkg:golang/google.golang.org/grpc@v1.21.0", + purl: "pkg:golang/google.golang.org/grpc@v1.21.0", + license: [ + { + id: "Apache-2.0", + url: "https://pkg.go.dev/google.golang.org/grpc?tab=licenses", + }, + ], + }); + expect(dep_list[1]).toEqual({ + group: "", + name: "github.com/spf13/cobra", + version: "v1.0.0", + _integrity: "sha256-/6GTrnGXV9HjY+aR4k0oJ5tcvakLuG6EuKReYlHNrgE=", + "bom-ref": "pkg:golang/github.com/spf13/cobra@v1.0.0", + purl: "pkg:golang/github.com/spf13/cobra@v1.0.0", + license: [ + { + id: "Apache-2.0", + url: "https://pkg.go.dev/github.com/spf13/cobra?tab=licenses", + }, + ], + }); + expect(dep_list[2]).toEqual({ + group: "", + name: "github.com/spf13/viper", + version: "v1.0.2", + _integrity: "sha256-A8kyI5cUJhb8N+3pkfONlcEcZbueH6nhAm0Fq7SrnBM=", + "bom-ref": "pkg:golang/github.com/spf13/viper@v1.0.2", + purl: "pkg:golang/github.com/spf13/viper@v1.0.2", + license: [ + { + id: "MIT", + url: "https://pkg.go.dev/github.com/spf13/viper?tab=licenses", + }, + ], + }); + expect(dep_list[3]).toEqual({ + group: "", + name: "github.com/stretchr/testify", + version: "v1.6.1", + _integrity: "sha256-6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=", + "bom-ref": "pkg:golang/github.com/stretchr/testify@v1.6.1", + purl: "pkg:golang/github.com/stretchr/testify@v1.6.1", + license: [ + { + id: "MIT", + url: "https://pkg.go.dev/github.com/stretchr/testify?tab=licenses", + }, + ], + }); + dep_list.forEach((d) => { + expect(d.license); + }); + }, 120000); + + test("parseGoModData with licenses", async () => { + let retMap = await parseGoModData(null); + expect(retMap).toEqual({}); + const gosumMap = { + "google.golang.org/grpc@v1.21.0": + "sha256-oYelfM1adQP15Ek0mdvEgi9Df8B9CZIaU1084ijfRaM=", + "github.com/aws/aws-sdk-go@v1.38.47": "sha256-fake-sha-for-aws-go-sdk=", + "github.com/spf13/cobra@v1.0.0": + "sha256-/6GTrnGXV9HjY+aR4k0oJ5tcvakLuG6EuKReYlHNrgE=", + "github.com/spf13/viper@v1.3.0": + "sha256-A8kyI5cUJhb8N+3pkfONlcEcZbueH6nhAm0Fq7SrnBM=", + "github.com/stretchr/testify@v1.6.1": + "sha256-6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=", + }; + retMap = await parseGoModData( + readFileSync("./test/gomod/go.mod", { encoding: "utf-8" }), + gosumMap, + ); + expect(retMap.pkgList.length).toEqual(6); + expect(retMap.pkgList).toEqual([ + { + group: "", + name: "github.com/aws/aws-sdk-go", + version: "v1.38.47", + _integrity: "sha256-fake-sha-for-aws-go-sdk=", + purl: "pkg:golang/github.com/aws/aws-sdk-go@v1.38.47", + "bom-ref": "pkg:golang/github.com/aws/aws-sdk-go@v1.38.47", + license: [ + { + id: "Apache-2.0", + url: "https://pkg.go.dev/github.com/aws/aws-sdk-go?tab=licenses", + }, + ], + }, + { + group: "", + name: "github.com/spf13/cobra", + version: "v1.0.0", + _integrity: "sha256-/6GTrnGXV9HjY+aR4k0oJ5tcvakLuG6EuKReYlHNrgE=", + purl: "pkg:golang/github.com/spf13/cobra@v1.0.0", + "bom-ref": "pkg:golang/github.com/spf13/cobra@v1.0.0", + license: [ + { + id: "Apache-2.0", + url: "https://pkg.go.dev/github.com/spf13/cobra?tab=licenses", + }, + ], + }, + { + group: "", + name: "github.com/spf13/viper", + version: "v1.0.2", + purl: "pkg:golang/github.com/spf13/viper@v1.0.2", + "bom-ref": "pkg:golang/github.com/spf13/viper@v1.0.2", + license: [ + { + id: "MIT", + url: "https://pkg.go.dev/github.com/spf13/viper?tab=licenses", + }, + ], + }, + { + group: "", + name: "github.com/spf13/viper", + version: "v1.3.0", + _integrity: "sha256-A8kyI5cUJhb8N+3pkfONlcEcZbueH6nhAm0Fq7SrnBM=", + purl: "pkg:golang/github.com/spf13/viper@v1.3.0", + "bom-ref": "pkg:golang/github.com/spf13/viper@v1.3.0", + license: [ + { + id: "MIT", + url: "https://pkg.go.dev/github.com/spf13/viper?tab=licenses", + }, + ], + }, + { + group: "", + name: "google.golang.org/grpc", + version: "v1.21.0", + _integrity: "sha256-oYelfM1adQP15Ek0mdvEgi9Df8B9CZIaU1084ijfRaM=", + purl: "pkg:golang/google.golang.org/grpc@v1.21.0", + "bom-ref": "pkg:golang/google.golang.org/grpc@v1.21.0", + license: [ + { + id: "Apache-2.0", + url: "https://pkg.go.dev/google.golang.org/grpc?tab=licenses", + }, + ], + }, + { + group: "", + name: "google.golang.org/grpc", + version: "v1.32.0", + purl: "pkg:golang/google.golang.org/grpc@v1.32.0", + "bom-ref": "pkg:golang/google.golang.org/grpc@v1.32.0", + license: [ + { + id: "Apache-2.0", + url: "https://pkg.go.dev/google.golang.org/grpc?tab=licenses", + }, + ], + }, + ]); + + retMap.pkgList.forEach((d) => { + expect(d.license); + }); + retMap = await parseGoModData( + readFileSync("./test/data/go-dvwa.mod", { encoding: "utf-8" }), + {}, + ); + expect(retMap.parentComponent).toEqual({ + "bom-ref": "pkg:golang/github.com/sqreen/go-dvwa", + name: "github.com/sqreen/go-dvwa", + purl: "pkg:golang/github.com/sqreen/go-dvwa", + type: "application", + }); + expect(retMap.pkgList.length).toEqual(19); + expect(retMap.rootList.length).toEqual(4); + retMap = await parseGoModData( + readFileSync("./test/data/go-syft.mod", { encoding: "utf-8" }), + {}, + ); + expect(retMap.parentComponent).toEqual({ + "bom-ref": "pkg:golang/github.com/anchore/syft", + name: "github.com/anchore/syft", + purl: "pkg:golang/github.com/anchore/syft", + type: "application", + }); + expect(retMap.pkgList.length).toEqual(239); + expect(retMap.rootList.length).toEqual(84); + }, 120000); +}); + test("parse go list dependencies", async () => { const retMap = await parseGoListDep( readFileSync("./test/data/golist-dep.txt", { encoding: "utf-8" }), diff --git a/types/lib/helpers/utils.d.ts b/types/lib/helpers/utils.d.ts index ff7279198..4e8ff3fc5 100644 --- a/types/lib/helpers/utils.d.ts +++ b/types/lib/helpers/utils.d.ts @@ -1,4 +1,5 @@ export function shouldFetchLicense(): boolean; +export function shouldFetchVCS(): boolean; export function getJavaCommand(): string; export function getPythonCommand(): string; /** diff --git a/types/lib/helpers/utils.d.ts.map b/types/lib/helpers/utils.d.ts.map index 6784776a6..80b83292f 100644 --- a/types/lib/helpers/utils.d.ts.map +++ b/types/lib/helpers/utils.d.ts.map @@ -1 +1 @@ -{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../lib/helpers/utils.js"],"names":[],"mappings":"AAyIA,8CAKC;AAqBD,yCAYC;AAED,2CAQC;AAwMD;;;;;;;GAOG;AACH,4EAiBC;AAED;;;;;;GAMG;AACH,mGAuEC;AAED;;;;;;;;GAQG;AACH,yGASC;AAgBD;;;;;;GAMG;AAC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A6B;AAI7B,2BAA2B;AAI3B,4BAA6B;AAI7B,2BAA2B;AAI3B,6BAA+B;AAI/B,0BAAyB;AAIzB,6BAA+B;AAM/B,2BAA2B;AAK3B,4BAA6B;AAO7B,gDAC2D;AAG3D,kDAWE;AAGF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAgIE;;;;AA0IF,8BAQG;AA85JH,8CAUE"} \ No newline at end of file +{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../lib/helpers/utils.js"],"names":[],"mappings":"AAyIA,8CAKC;AAED,0CAIC;AAqBD,yCAYC;AAED,2CAQC;AAwMD;;;;;;;GAOG;AACH,4EAiBC;AAED;;;;;;GAMG;AACH,mGAuEC;AAED;;;;;;;;GAQG;AACH,yGASC;AAgBD;;;;;;GAMG;AACH,qCAJW,MAAM,WACN,MAAM,2BA8BhB;AAED;;;;;;GAMG;AACH,+CAJW,MAAM,WACN,MAAM,+BAoBhB;AAYD;;;;GAIG;AACH,gCAFa,MAAM,CAIlB;AAED;;;;;;IAMI;AACJ,iDAJW,MAAM,GACJ,OAAO,CAWnB;AAED;;;;;;;;;GASG;AACH,iEA2BC;AAED;;;;;GAKG;AACH,6CAqDC;AAED;;;;;;GAMG;AACH,sEA0DC;AAED;;;;GAIG;AACH,4EAoCC;AAED;;;GAGG;AACH;;EAUC;AAED,sEA0BC;AAED;;;;GAIG;AACH,+DA4CC;AAED;;;;;GAKG;AACH,0CAHW,MAAM,WACN,OAAO,kBAkFjB;AAED;;;;;GAKG;AACH,0CAHW,MAAM,YACN,MAAM;;;GAuVhB;AAED;;;;;;;GAOG;AACH,6CAFW,MAAM,MA2DhB;AAwBD;;;;GAIG;AACH,4CAFW,MAAM;;;GAkOhB;AAED;;;;GAIG;AACH,4CAFW,MAAM,kBAiEhB;AA+DD;;;;;GAKG;AACH,wCAHW,MAAM,oBACN,MAAM;;;;;;;;;;;;;;;;;;GAiiBhB;AAED;;;;GAIG;AACH,8CAFW,MAAM,kBA+ChB;AAED;;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