Skip to content

Token Auto-Refresh - Expired Token During Command #388

@najuna-brian

Description

@najuna-brian

Description

Verifies that the CLI automatically refreshes an expired authentication token before executing a command, so the operator does not need to manually re-login after token expiry.

Steps

  1. Log in: run synk login with valid credentials
  2. Locate the CLI config file (typically .synkronus.yaml in the home directory or working directory)
  3. Manually edit the config file and set the expiresAt field to a timestamp in the past (e.g. one hour ago)
  4. Save the config file
  5. Run any CLI command, for example: synk app-bundle versions
  6. Observe whether the command succeeds or prompts for re-login
  7. Open the config file again and check whether expiresAt has been updated to a future time

Expected Result

The CLI detects the expired token automatically, refreshes it using the stored refresh token, updates the config file with the new token, and completes the command successfully - all without prompting the operator to log in again. No authentication error is shown.

Note during testing: Also check the terminal output for any DEBUG - Raw API response: lines. If this appears, it is a known bug (synkronus-cli/internal/auth/auth.go:64) that must be fixed before release as it may leak sensitive data in logs.

Actual Result

(To be filled during testing)

Priority

Medium

Metadata

Metadata

Assignees

No one assigned

    Labels

    testIssues related to tests, test coverage, or test infrastructuretest:CLITest case related to the CLI

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions