Make it clearer what the expectations for isUsernamePassword are

This commit is contained in:
Michael B. Gale
2026-04-30 12:49:49 +01:00
parent 7a6ed56219
commit 549683cee5
6 changed files with 149 additions and 20 deletions
+4 -4
View File
@@ -24,8 +24,8 @@ import {
Address,
Registry,
Credential,
isToken,
isUsernamePassword,
hasToken,
hasUsernameAndPassword,
hasUsername,
RawCredential,
} from "./start-proxy/types";
@@ -331,11 +331,11 @@ export function getCredentials(
const noUsername =
!hasUsername(authConfig) || !isDefined(authConfig.username);
const passwordIsPAT =
isUsernamePassword(authConfig) &&
hasUsernameAndPassword(authConfig) &&
isDefined(authConfig.password) &&
isPAT(authConfig.password);
const tokenIsPAT =
isToken(authConfig) &&
hasToken(authConfig) &&
isDefined(authConfig.token) &&
isPAT(authConfig.token);