From e29a6e928d324f53406b923793e306c3da8fc544 Mon Sep 17 00:00:00 2001 From: samsolaimani Date: Mon, 23 Feb 2026 10:41:55 -0500 Subject: [PATCH 1/5] Add basic auth deprecation warnings for May 3rd retirement Notifies users via terminal whenever basic authentication (network password) is used, directing them to migrate to OAuth2 refresh tokens. Co-Authored-By: Claude Sonnet 4.6 --- src/lib/getAuth.ts | 12 ++++++++++++ src/lib/handlers/alks-developer-login.ts | 11 +++++++++++ src/lib/promptForAuthType.ts | 2 +- 3 files changed, 24 insertions(+), 1 deletion(-) diff --git a/src/lib/getAuth.ts b/src/lib/getAuth.ts index 18b6eb3f..f3459c34 100644 --- a/src/lib/getAuth.ts +++ b/src/lib/getAuth.ts @@ -1,6 +1,8 @@ +import { yellow } from 'cli-color'; import { log } from '../lib/log'; import { Auth } from '../model/auth'; import { promptForPassword } from './promptForPassword'; +import { showBorderedMessage } from './showBorderedMessage'; import { getPassword } from './state/password'; import { getToken } from './state/token'; import { getUserId } from './state/userId'; @@ -23,6 +25,16 @@ export async function getAuth(): Promise { } // If password is not set, ask for a password const password = (await getPassword()) || (await promptForPassword()); + + showBorderedMessage( + 80, + yellow( + '⚠ DEPRECATION WARNING: Basic Authentication (network password) will be\n' + + ' retired on May 3rd. Please run `alks developer configure` to migrate\n' + + ' to OAuth2 (refresh token) authentication.' + ) + ); + const auth = { userid, password }; return auth; } diff --git a/src/lib/handlers/alks-developer-login.ts b/src/lib/handlers/alks-developer-login.ts index 5eb56ced..7cbbc3b4 100644 --- a/src/lib/handlers/alks-developer-login.ts +++ b/src/lib/handlers/alks-developer-login.ts @@ -1,9 +1,11 @@ import commander from 'commander'; +import { yellow } from 'cli-color'; import { checkForUpdate } from '../checkForUpdate'; import { errorAndExit } from '../errorAndExit'; import { log } from '../log'; import { promptForPassword } from '../promptForPassword'; import { promptForUserId } from '../promptForUserId'; +import { showBorderedMessage } from '../showBorderedMessage'; import { setPassword } from '../state/password'; import { setUserId } from '../state/userId'; @@ -11,6 +13,15 @@ export async function handleAlksDeveloperLogin( options: commander.OptionValues ) { try { + showBorderedMessage( + 80, + yellow( + '⚠ DEPRECATION WARNING: Basic Authentication (network password) will be\n' + + ' retired on May 3rd. Please use `alks developer configure` to set up\n' + + ' OAuth2 (refresh token) authentication instead.' + ) + ); + const userId = options.username ?? (await promptForUserId()); log('saving user ID'); await setUserId(userId); diff --git a/src/lib/promptForAuthType.ts b/src/lib/promptForAuthType.ts index b54c3f16..8dd982f0 100644 --- a/src/lib/promptForAuthType.ts +++ b/src/lib/promptForAuthType.ts @@ -18,7 +18,7 @@ export async function promptForAuthType(): Promise { short: REFRESH_TOKEN_AUTH_CHOICE, }, { - name: `[${PASSWORD_AUTH_CHOICE}] Store your network password (not recommended)`, + name: `[${PASSWORD_AUTH_CHOICE}] Store your network password (DEPRECATED - retiring May 3rd, not recommended)`, value: PASSWORD_AUTH_CHOICE, short: PASSWORD_AUTH_CHOICE, }, From 1bdacaa3c827553a73d452f8d393554185088772 Mon Sep 17 00:00:00 2001 From: samsolaimani Date: Tue, 24 Feb 2026 13:08:03 -0500 Subject: [PATCH 2/5] Update changelog for basic auth deprecation warning Co-Authored-By: Claude Sonnet 4.6 --- changelog.txt | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/changelog.txt b/changelog.txt index 14a118ee..c460aec1 100644 --- a/changelog.txt +++ b/changelog.txt @@ -1,3 +1,12 @@ +★ Release Notes: 2026-02-24 ★ +≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡ + +Thanks for upgrading to the latest version of the ALKS CLI! + +* Added deprecation warning for Basic Authentication (US1879500). + - A warning banner now appears whenever a command runs using basic auth (network password) + - Basic Authentication will be retired on May 3rd; please migrate to OAuth2 via `alks developer configure` + ★ Release Notes: 2026-01-29 ★ ≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡ From efc9ce607ae93beb0be05714dd4425077c1c5a47 Mon Sep 17 00:00:00 2001 From: samsolaimani Date: Tue, 24 Feb 2026 13:26:05 -0500 Subject: [PATCH 3/5] Default ALKS server to https://alks.coxautoinc.com/rest Co-Authored-By: Claude Sonnet 4.6 --- src/lib/getAlks.ts | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/src/lib/getAlks.ts b/src/lib/getAlks.ts index 00bfb5e3..a7296cbc 100644 --- a/src/lib/getAlks.ts +++ b/src/lib/getAlks.ts @@ -1,5 +1,6 @@ import ALKS, { AlksProps, create } from 'alks.js'; import { getUserAgentString } from './getUserAgentString'; +import { defaultServer } from './promptForServer'; import { getServer } from './state/server'; interface TokenProps { @@ -23,12 +24,7 @@ export type Props = TokenProps | PasswordProps; * Gets a preconfigured alks.js object */ export async function getAlks(props: Props): Promise { - const server = await getServer(); - if (!server) { - throw new Error( - 'Server URL is not configured. Please run: alks developer configure' - ); - } + const server = (await getServer()) ?? defaultServer; // FYI: for enabled but not enforced we should not send the Test header. const mergedHeaders = { From 8ee049d10f74cbf0ce3564e0575a8b1b6f7f044a Mon Sep 17 00:00:00 2001 From: samsolaimani Date: Tue, 24 Feb 2026 14:42:58 -0500 Subject: [PATCH 4/5] Add "did you mean?" hint for missing /rest in server URL Co-Authored-By: Claude Sonnet 4.6 --- src/lib/getAlks.ts | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) diff --git a/src/lib/getAlks.ts b/src/lib/getAlks.ts index a7296cbc..da85b546 100644 --- a/src/lib/getAlks.ts +++ b/src/lib/getAlks.ts @@ -1,4 +1,5 @@ import ALKS, { AlksProps, create } from 'alks.js'; +import { yellow } from 'cli-color'; import { getUserAgentString } from './getUserAgentString'; import { defaultServer } from './promptForServer'; import { getServer } from './state/server'; @@ -24,7 +25,26 @@ export type Props = TokenProps | PasswordProps; * Gets a preconfigured alks.js object */ export async function getAlks(props: Props): Promise { - const server = (await getServer()) ?? defaultServer; + const server = await getServer(); + if (!server) { + throw new Error( + 'Server URL is not configured. Please run: alks developer configure' + ); + } + + const normalizedServer = server.replace(/\/+$/, ''); + const normalizedDefault = defaultServer.replace(/\/+$/, ''); + const defaultOrigin = defaultServer.replace(/\/rest\/?$/, ''); + if ( + normalizedServer !== normalizedDefault && + normalizedServer.startsWith(defaultOrigin) + ) { + console.error( + yellow( + `Tip: Did you mean ${defaultServer}? Run \`alks developer configure\` to update your server URL.` + ) + ); + } // FYI: for enabled but not enforced we should not send the Test header. const mergedHeaders = { From ca713e62b91a301a0b4fb8acb1e8a44a7d8adddc Mon Sep 17 00:00:00 2001 From: samsolaimani Date: Thu, 26 Feb 2026 13:38:53 -0500 Subject: [PATCH 5/5] Fix deprecation warning showing multiple times per command Add a module-level flag so the basic auth deprecation banner only appears once per process, regardless of how many times getAuth() is called internally. Co-Authored-By: Claude Sonnet 4.6 --- src/lib/getAuth.ts | 21 +++++++++++++-------- 1 file changed, 13 insertions(+), 8 deletions(-) diff --git a/src/lib/getAuth.ts b/src/lib/getAuth.ts index f3459c34..89d5affd 100644 --- a/src/lib/getAuth.ts +++ b/src/lib/getAuth.ts @@ -7,6 +7,8 @@ import { getPassword } from './state/password'; import { getToken } from './state/token'; import { getUserId } from './state/userId'; +let deprecationWarningShown = false; + // TODO: refactor all calls to this function to do their own error handling so that we can just return Auth or undefined export async function getAuth(): Promise { log('checking for refresh token'); @@ -26,14 +28,17 @@ export async function getAuth(): Promise { // If password is not set, ask for a password const password = (await getPassword()) || (await promptForPassword()); - showBorderedMessage( - 80, - yellow( - '⚠ DEPRECATION WARNING: Basic Authentication (network password) will be\n' + - ' retired on May 3rd. Please run `alks developer configure` to migrate\n' + - ' to OAuth2 (refresh token) authentication.' - ) - ); + if (!deprecationWarningShown) { + deprecationWarningShown = true; + showBorderedMessage( + 80, + yellow( + '⚠ DEPRECATION WARNING: Basic Authentication (network password) will be\n' + + ' retired on May 3rd. Please run `alks developer configure` to migrate\n' + + ' to OAuth2 (refresh token) authentication.' + ) + ); + } const auth = { userid, password }; return auth;