@snyk/docker-registry-v2-client
Advanced tools
Comparing version 2.3.0 to 2.4.0
@@ -7,5 +7,7 @@ "use strict"; | ||
async function getLayer(registryBase, repo, digest, username, password, options = {}) { | ||
var _a; | ||
const accept = `${(_a = options.acceptLayer) !== null && _a !== void 0 ? _a : contentTypes.LAYER}`; | ||
const endpoint = `/${repo}/blobs/${digest}`; | ||
options = Object.assign({ json: false, encoding: null }, options); | ||
const layerResponse = await registry_call_1.registryV2Call(registryBase, endpoint, contentTypes.LAYER, username, password, options); | ||
const layerResponse = await registry_call_1.registryV2Call(registryBase, endpoint, accept, username, password, options); | ||
// When the content type is wrongly set to text instead of binary, response body is returned as string instead of a buffer | ||
@@ -12,0 +14,0 @@ // This forces a buffer response. |
@@ -20,3 +20,4 @@ "use strict"; | ||
async function getManifest(registryBase, repo, tag, username, password, options = {}, platform) { | ||
let accept = `${contentTypes.MANIFEST_V2}`; | ||
var _a; | ||
let accept = `${(_a = options.acceptManifest) !== null && _a !== void 0 ? _a : contentTypes.MANIFEST_V2}`; | ||
if (shouldAcceptManifestList(tag, platform)) { | ||
@@ -31,3 +32,3 @@ accept += `, ${contentTypes.MANIFEST_LIST_V2}`; | ||
// calling getManifest recursively is safe here, since we got a list of actual manifests (and not a list of manifest-lists) | ||
return await getManifest(registryBase, repo, manifestDigest, username, password, platform, options); | ||
return await getManifest(registryBase, repo, manifestDigest, username, password, options, platform); | ||
} | ||
@@ -34,0 +35,0 @@ return needle_1.parseResponseBody(manifestResponse); |
@@ -23,5 +23,5 @@ { | ||
"devDependencies": { | ||
"@types/jest": "^24.0.15", | ||
"@types/jest": "^27.0.2", | ||
"@types/needle": "^2.0.4", | ||
"@types/node": "^11.13.18", | ||
"@types/node": "^14.14.31", | ||
"@types/tmp": "^0.1.0", | ||
@@ -38,3 +38,3 @@ "@typescript-eslint/eslint-plugin": "^2.24.0", | ||
"ts-jest": "^24.0.2", | ||
"ts-node": "^8.3.0", | ||
"ts-node": "^10.2.1", | ||
"typescript": "^3.5.3" | ||
@@ -47,3 +47,3 @@ }, | ||
}, | ||
"version": "2.3.0" | ||
"version": "2.4.0" | ||
} |
@@ -30,2 +30,3 @@ # snyk/docker-registry-v2-client | ||
export SNYK_DRA_AZURE_REPOSITORY=snykgoof/azure-goof | ||
export SNYK_OCI_AZURE_REPOSITORY=snykgoof/oci-goof | ||
export SNYK_DRA_AZURE_REGISTRY_BASE=snykgoof.azurecr.io | ||
@@ -36,2 +37,3 @@ | ||
export SNYK_DRA_DOCKER_HUB_REPOSITORY=snykgoof/dockerhub-goof | ||
export SNYK_OCI_DOCKER_HUB_REPOSITORY=snykgoof/oci-goof | ||
export SNYK_DRA_DOCKER_HUB_REGISTRY_BASE=registry-1.docker.io | ||
@@ -38,0 +40,0 @@ |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
48187
594
79