ccqa 1.8.0 → 1.8.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/bin/ccqa.mjs +20 -3
- package/dist/package.json +1 -1
- package/package.json +1 -1
package/dist/bin/ccqa.mjs
CHANGED
|
@@ -789,10 +789,26 @@ async function runPool(items, concurrency, fn) {
|
|
|
789
789
|
//#endregion
|
|
790
790
|
//#region src/drift/auth.ts
|
|
791
791
|
/**
|
|
792
|
+
* Claude Code can also run against AWS Bedrock / Google Vertex AI, selected by
|
|
793
|
+
* these env toggles. Credentials then come from the cloud SDK's own chain
|
|
794
|
+
* (instance/task roles, gcloud auth, …), so none of the Anthropic-side probes
|
|
795
|
+
* below apply — a set toggle counts as auth being available. ccqa forwards the
|
|
796
|
+
* toggle verbatim; only "0"/"false" (any case) is treated as explicitly off.
|
|
797
|
+
*/
|
|
798
|
+
const CLOUD_PROVIDER_ENV_KEYS = ["CLAUDE_CODE_USE_BEDROCK", "CLAUDE_CODE_USE_VERTEX"];
|
|
799
|
+
function cloudProviderEnabled() {
|
|
800
|
+
return CLOUD_PROVIDER_ENV_KEYS.some((key) => {
|
|
801
|
+
const value = process.env[key]?.trim().toLowerCase();
|
|
802
|
+
return value !== void 0 && value !== "" && value !== "0" && value !== "false";
|
|
803
|
+
});
|
|
804
|
+
}
|
|
805
|
+
/**
|
|
792
806
|
* Probe whether the host has any credential the Anthropic SDK can pick up:
|
|
793
807
|
* 1. ANTHROPIC_API_KEY env var (CI / scripted use)
|
|
794
|
-
* 2.
|
|
795
|
-
*
|
|
808
|
+
* 2. CLAUDE_CODE_USE_BEDROCK / CLAUDE_CODE_USE_VERTEX (cloud-provider
|
|
809
|
+
* endpoints authenticated by the cloud SDK's credential chain)
|
|
810
|
+
* 3. ~/.claude/.credentials.json (Claude Code login, file-based platforms)
|
|
811
|
+
* 4. macOS Keychain item "Claude Code-credentials" (Claude Code login on
|
|
796
812
|
* darwin stores the OAuth credentials in the Keychain, not on disk)
|
|
797
813
|
*
|
|
798
814
|
* Claude-driven hooks are opt-in, so the caller only consults this after the
|
|
@@ -802,11 +818,12 @@ async function runPool(items, concurrency, fn) {
|
|
|
802
818
|
function driftAuthAvailable() {
|
|
803
819
|
const key = process.env["ANTHROPIC_API_KEY"];
|
|
804
820
|
if (typeof key === "string" && key.length > 0) return { ok: true };
|
|
821
|
+
if (cloudProviderEnabled()) return { ok: true };
|
|
805
822
|
if (existsSync(join(homedir(), ".claude", ".credentials.json"))) return { ok: true };
|
|
806
823
|
if (process.platform === "darwin" && keychainHasClaudeCredentials()) return { ok: true };
|
|
807
824
|
return {
|
|
808
825
|
ok: false,
|
|
809
|
-
reason: "no ANTHROPIC_API_KEY / claude login"
|
|
826
|
+
reason: "no ANTHROPIC_API_KEY / Bedrock or Vertex env / claude login"
|
|
810
827
|
};
|
|
811
828
|
}
|
|
812
829
|
/**
|
package/dist/package.json
CHANGED