@candledottv/cli 0.6.0 → 0.6.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +10 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -5384,7 +5384,7 @@ async function resolveApiKey(deps, profile) {
|
|
|
5384
5384
|
}
|
|
5385
5385
|
|
|
5386
5386
|
// src/version.ts
|
|
5387
|
-
var CLI_VERSION = "0.6.
|
|
5387
|
+
var CLI_VERSION = "0.6.1";
|
|
5388
5388
|
|
|
5389
5389
|
// src/commands/auth.ts
|
|
5390
5390
|
var DEVICE_CODE_PATH = "/api/v1/agent/device/code";
|
|
@@ -6762,6 +6762,13 @@ function getVerifier() {
|
|
|
6762
6762
|
return verifier;
|
|
6763
6763
|
}
|
|
6764
6764
|
var IN_TOTO_PAYLOAD_TYPE = "application/vnd.in-toto+json";
|
|
6765
|
+
function isLegacyCosignBundle(bundleJson) {
|
|
6766
|
+
if (typeof bundleJson !== "object" || bundleJson === null)
|
|
6767
|
+
return false;
|
|
6768
|
+
const candidate = bundleJson;
|
|
6769
|
+
return "base64Signature" in candidate && "rekorBundle" in candidate && !("mediaType" in candidate);
|
|
6770
|
+
}
|
|
6771
|
+
var LEGACY_BUNDLE_REASON = "legacy cosign bundle (base64Signature/rekorBundle); Candle releases are signed with cosign --new-bundle-format, so this is not a Candle release bundle or the release workflow regressed";
|
|
6765
6772
|
function exactIdentity(identityUri) {
|
|
6766
6773
|
return new RegExp(`^${identityUri.replace(/[.*+?^${}()|[\]\\]/g, "\\$&")}$`);
|
|
6767
6774
|
}
|
|
@@ -6772,6 +6779,8 @@ function withTrustRootHint(reason) {
|
|
|
6772
6779
|
return `${reason}; the trust root embedded in this candle may be out of date; reinstall with curl -fsSL https://candle.tv/install.sh | bash`;
|
|
6773
6780
|
}
|
|
6774
6781
|
function verifyReleaseAsset(bytes, bundleJson, identityUri, issuer) {
|
|
6782
|
+
if (isLegacyCosignBundle(bundleJson))
|
|
6783
|
+
return { ok: false, reason: LEGACY_BUNDLE_REASON };
|
|
6775
6784
|
try {
|
|
6776
6785
|
const bundle = import_bundle.bundleFromJSON(bundleJson);
|
|
6777
6786
|
const digest = createHash("sha256").update(bytes).digest();
|
package/package.json
CHANGED