Skip to content

Add basic auth deprecation warnings for May 3rd retirement#295

Open
samsolaimani wants to merge 4 commits intomasterfrom
basic-auth-dep-announce
Open

Add basic auth deprecation warnings for May 3rd retirement#295
samsolaimani wants to merge 4 commits intomasterfrom
basic-auth-dep-announce

Conversation

@samsolaimani
Copy link

@samsolaimani samsolaimani commented Feb 24, 2026

Summary

  • Displays a yellow bordered warning banner every time a command runs using basic auth (password), directing users to migrate to OAuth2
  • Adds the same deprecation warning at the start of alks developer login
  • Updates the password choice label in alks developer configure to reflect the May 3rd retirement date
  • Adds a "did you mean?" tip when a user has configured https://alks.coxautoinc.com without the required /rest path

Test plan

Basic auth deprecation warning

  • Run any alks command (e.g. sessions open) configured with basic auth — confirm the yellow deprecation warning banner appears in the terminal
  • Run alks developer login — confirm warning appears before credential prompts
  • Run alks developer configure — confirm password choice shows "(DEPRECATED - retiring May 3rd, not recommended)"
  • Run any command configured with OAuth2 (refresh token) — confirm no warning appears

"Did you mean?" server URL hint

  • Set ALKS_SERVER=https://alks.coxautoinc.com and run alks sessions open — confirm the yellow tip appears: "Did you mean https://alks.coxautoinc.com/rest?"
  • Set ALKS_SERVER=https://alks.coxautoinc.com/ (trailing slash) and run alks sessions open — confirm tip still appears
  • Set ALKS_SERVER=https://alks.coxautoinc.com/rest and run alks sessions open — confirm no tip appears
  • Set a completely different server URL — confirm no tip appears

Rally

US1879500: Create warning for ALKS CLI basic auth deprecation

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 <noreply@anthropic.com>
@samsolaimani samsolaimani added the release/patch Indicates an update without breaking changes or new features label Feb 24, 2026
samsolaimani and others added 3 commits February 24, 2026 13:08
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@DevOpsDave
Copy link
Contributor

@samsolaimani looking at this now

@DevOpsDave
Copy link
Contributor

Bug: Deprecation warning shows 3 times per command

When running alks session open with password auth, the bordered deprecation warning appears 3 times because getAuth() is called multiple times during a single command invocation:

  1. ensureConfigured()getAuthButDontThrow()getAuth()
  2. getIamKey()getAuth()
  3. promptForAlksAccountAndRole()getAlksAccounts()getAuth()

Each call hits the password path and triggers showBorderedMessage.

Suggested fix: Add a module-level flag in getAuth.ts to only show the warning once per process:

let deprecationWarningShown = false;

// ... inside the password branch:
if (!deprecationWarningShown) {
  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.'
    )
  );
  deprecationWarningShown = true;
}

Reproduced with: node dist/src/bin/alks.js session open -a awsmarvenintnp -r Admin -o env -N -D 1

@DevOpsDave
Copy link
Contributor

DevOpsDave commented Feb 25, 2026

@samsolaimani Do we want to show the Deprecation warnings 3 times?
Screenshot 2026-02-25 at 14 56 55

One time when we pick basic auth and then one time when we make a session I think is good. In the PR I have a suggestion on how to fix.

Copy link
Contributor

@DevOpsDave DevOpsDave left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@samsolaimani see my comments.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

release/patch Indicates an update without breaking changes or new features

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants