azdo-cli 0.5.0-030-auth-diagnostics.539 → 0.5.0-030-auth-diagnostics.541
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 -2
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1705,7 +1705,8 @@ async function diagnoseAuth(org, project, resolveCredential) {
|
|
|
1705
1705
|
};
|
|
1706
1706
|
}
|
|
1707
1707
|
const connectivity = await runConnectivityTest(org, cred);
|
|
1708
|
-
const
|
|
1708
|
+
const envVarName = process.env.AZDO_PAT ? "AZDO_PAT" : "dotenv";
|
|
1709
|
+
const sourceLabel = cred.source === "env" ? `env:${envVarName}` : "credential-store";
|
|
1709
1710
|
return {
|
|
1710
1711
|
authType: cred.kind ?? "pat",
|
|
1711
1712
|
credentialSource: sourceLabel,
|
|
@@ -1719,7 +1720,14 @@ function formatDiagnosticReport(report, json) {
|
|
|
1719
1720
|
if (json) {
|
|
1720
1721
|
return JSON.stringify(report, null, 2);
|
|
1721
1722
|
}
|
|
1722
|
-
|
|
1723
|
+
let connectivityLine;
|
|
1724
|
+
if (report.connectivityStatus === "ok") {
|
|
1725
|
+
connectivityLine = "OK";
|
|
1726
|
+
} else if (report.connectivityStatus === "no-credentials") {
|
|
1727
|
+
connectivityLine = "no credentials found";
|
|
1728
|
+
} else {
|
|
1729
|
+
connectivityLine = "FAILED";
|
|
1730
|
+
}
|
|
1723
1731
|
const lines = [
|
|
1724
1732
|
`Auth type: ${report.authType}`,
|
|
1725
1733
|
`Source: ${report.credentialSource ?? "(none)"}`,
|