Skip to content

Conversation

@nimish-ks
Copy link
Member

This PR adds the ability to use Service Account Token with phase auth.

Changes:

  • Added support for Service Account in phase auth
  • In phase auth if PHASE_HOST is available, the user will not be prompted for selecting instance type. A message with log this.
  • Updated phase users sub-sub commands to support Service Accounts
  • Updated misc utils to use Service Account id contexts whenever applicable

…d deprecation notice

- Renamed the function `get_default_user_id` to `get_default_account_id` for clarity and to better reflect its purpose.
- Updated the function's docstring to indicate it now handles both user accounts and service accounts.
- Added a deprecated version of `get_default_user_id` that calls the new function for backward compatibility.
- Replaced the usage of `get_default_user_id` with `get_default_account_id` in the keyring service name generation for improved clarity and consistency with recent changes.
- Updated the whoami command to display 'N/A (Service Account)' if the default user's email is not available, improving clarity for service accounts.
- Renamed 'User ID' to 'Account ID' for consistency with recent changes.
- Changed terminology from 'User ID' to 'Account ID' for clarity.
- Updated email handling to display 'Service Account' when applicable.
- Adjusted prompts and error messages to reflect the new account terminology.
…onality

- Updated the logout functionality to use `get_default_account_id` instead of `get_default_user_id` for consistency with recent changes.
- Adjusted keyring password deletion and configuration updates to reflect the new account terminology.
- Eliminated the import of `get_default_user_id` from `phase_cli.utils.misc` as it is no longer needed, streamlining the code for better clarity and consistency.
- Updated the authentication process to support both Personal Access Tokens (PATs) and Service Account Tokens, improving flexibility.
- Introduced checks for the PHASE_HOST environment variable to allow headless operation.
- Replaced user ID references with account ID for consistency across the authentication flow.
- Enhanced error handling and user prompts to accommodate service accounts and ensure clarity in user interactions.
@nimish-ks nimish-ks self-assigned this Aug 26, 2025
@nimish-ks nimish-ks changed the title feat: phase auth svc account feat: add service account login support to phase auth Aug 26, 2025
- Added support for Personal Access Tokens (PATs) by prompting for user email when a PAT is detected.
- Improved handling of unknown token formats to ensure user email is requested for clarity and safety.
- Streamlined the authentication process to accommodate both PATs and Service Account Tokens.
@cloudflare-workers-and-pages
Copy link

cloudflare-workers-and-pages bot commented Aug 26, 2025

Deploying phase-cli-install-script with  Cloudflare Pages  Cloudflare Pages

Latest commit: f97b535
Status: ✅  Deploy successful!
Preview URL: https://71c28656.phase-cli-install-script.pages.dev
Branch Preview URL: https://feat--phase-auth-svc-account.phase-cli-install-script.pages.dev

View logs

@nimish-ks
Copy link
Member Author

@cursor review

Copy link

@cursor cursor bot left a comment

Choose a reason for hiding this comment

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

✅ Bugbot reviewed your changes and found no bugs!


@nimish-ks nimish-ks merged commit 8600541 into main Oct 1, 2025
16 checks passed
@nimish-ks nimish-ks deleted the feat--phase-auth-svc-account branch October 1, 2025 13:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants