You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* refactor: rename get_default_user_id to get_default_account_id and add 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.
* refactor: update keyring service name to use account ID
- 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.
* fix: handle missing email for default user in whoami command
- 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.
* refactor: update user switch functionality for consistency
- 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.
* refactor: replace user ID references with account ID in logout functionality
- 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.
* refactor: remove unused user ID reference in import_env.py
- 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.
* refactor: enhance token-based authentication flow
- 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.
* refactor: enhance authentication flow for Personal Access Tokens
- 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.
* chore(deps): add boto3 and botocore dependencies
- Added boto3 and botocore to requirements.txt to support AWS service integration.
- Specified minimum versions for both libraries to ensure compatibility.
* feat(auth): implement web-based and token-based authentication
- Introduced a new authentication module with support for web-based and token-based authentication methods.
- Added an HTTP server to handle authentication requests and process user credentials securely.
- Enhanced user experience by providing clear prompts for both Personal Access Tokens and AWS IAM credentials.
- Integrated error handling and logging for improved feedback during the authentication process.
* refactor: remove print_phase_links function from misc.py
- Eliminated the print_phase_links function to streamline the codebase and improve clarity.
- This function was previously responsible for displaying a welcome message and links to community resources.
* feat(auth): add AWS IAM authentication module
- Introduced a new module for AWS IAM authentication, enabling integration with Phase API.
- Implemented functions to sign requests and authenticate using AWS credentials.
- Added support for custom STS endpoints and region resolution.
- Enhanced error handling for missing AWS credentials and authentication failures.
* feat(auth): enhance authentication options with AWS IAM support
- Updated the authentication command to include AWS IAM as a mode of authentication.
- Added a new argument for Service Account ID, required when using AWS IAM mode.
- Adjusted the phase_auth function call to accommodate the new service_account_id parameter.
* chore(deps): update botocore version in requirements.txt
- Changed the minimum version of botocore to 1.40.17 for improved compatibility with AWS services.
- Removed the specific version constraint for boto3 to allow for more flexibility in dependency resolution.
* refactor(auth): streamline AWS session handling in authentication module
- Replaced boto3 session initialization with botocore's get_session for improved compatibility and flexibility.
- Enhanced region resolution by incorporating environment variable support for AWS_DEFAULT_REGION.
- Updated credential retrieval to ensure consistent handling of AWS credentials across the authentication process.
* refactor(auth): simplify region and endpoint resolution in AWS authentication
- Refactored the `resolve_region_and_endpoint` function to eliminate unnecessary parameters and improve clarity.
- Integrated botocore's `Config` for better handling of AWS region detection.
- Removed the custom STS endpoint parameter from the `perform_aws_iam_auth` function to streamline the authentication process.
* feat(auth): add optional TTL parameter for AWS IAM authentication
- Updated the `phase_auth` function to include an optional `ttl` parameter for specifying token time-to-live in seconds when using AWS IAM mode.
- Adjusted the call to `perform_aws_iam_auth` to pass the new `ttl` argument, enhancing flexibility in token management.
* refactor(logout): replace print statements with rich console output
- Updated the logout functionality to use the rich console for better error handling and user feedback.
- Enhanced messages for logging out, purging data, and configuration errors to improve clarity and user experience.
* feat(auth): update authentication command to support external identities and TTL
- Modified the `auth` command to include a new argument for Service Account ID, clarifying its use for external identities.
- Added an optional `ttl` parameter for specifying token time-to-live, enhancing flexibility in token management during authentication.
- Updated the `phase_auth` function call to accommodate the new `ttl` argument.
* feat(auth): add no-login option to phase_auth function
- Introduced a new `no_login` parameter to the `phase_auth` function, allowing users to bypass the login process and print raw AWS IAM authentication results directly.
- Updated the function's logic to handle the new parameter, enhancing flexibility for users who may want to view authentication results without logging in.
* feat(auth): enhance authentication command with no-login option
- Added a `--no-login` argument to the authentication command, allowing users to print authentication tokens directly to stdout without logging in, specifically for external identity modes like aws-iam.
- Updated the `phase_auth` function call to incorporate the new `no_login` parameter, improving user experience and flexibility in authentication processes.
* chore: bump version to 1.20.0 in APKBUILD and const.py
* feat(auth): rename no-login option to no-store for clarity
- Updated the `--no-login` argument to `--no-store` in the authentication command, clarifying its purpose to print authentication token responses without storing credentials.
- Adjusted the `phase_auth` function to reflect this change, enhancing the user experience and understanding of the authentication process.
* chore: reset changes from bad rebase
* feat: use consistent routing pattern
* chore: remove phase cloud / self-hosted host switcher
* feat: add AWS IAM authentication support to Phase API
- Introduced a new function `external_identity_auth_aws` for authenticating with Phase using AWS IAM credentials.
- Added a utility function `b64_str` for Base64 encoding strings, used in the authentication payload.
- Enhanced error handling for SSL and connection errors during the authentication process.
* refactor: streamline AWS IAM authentication flow
- Removed the `authenticate_with_phase` function and replaced it with `external_identity_auth_aws` for improved clarity and modularity.
- Updated parameter names in `perform_aws_iam_auth` for consistency.
- Simplified the authentication process by leveraging the new utility function for AWS IAM credentials.
* fix: update parameter naming in AWS IAM authentication call
- Changed the parameter name in the `perform_aws_iam_auth` function call for clarity and consistency, aligning with recent refactoring efforts.
* chore: bump version to 1.21.0 in APKBUILD and const.py
* fix: remove unused import of PHASE_CLOUD_PUBLIC_API_HOST from misc.py
* feat: add AWS configuration constants for STS endpoint and region
- Introduced AWS_DEFAULT_GLOBAL_STS_ENDPOINT and AWS_DEFAULT_GLOBAL_STS_REGION constants to facilitate AWS service integration.
- Updated PHASE_CLOUD_API_HOST for clarity in configuration management.
* refactor: replace hardcoded STS endpoint and region with constants
- Updated the `resolve_region_and_endpoint` function to utilize the newly introduced `AWS_DEFAULT_GLOBAL_STS_ENDPOINT` and `AWS_DEFAULT_GLOBAL_STS_REGION` constants for improved maintainability and clarity.
* fix: update AWS IAM authentication URL for external identities
- Changed the endpoint in the `external_identity_auth_aws` function to reflect the correct routing for external identity authentication with AWS IAM.
* fix: add trailing slash
Signed-off-by: rohan <[email protected]>
* fix: ensure CLI exits successfully with no arguments
- Added a check to display top-level help and exit with code 0 when no arguments are provided to the CLI.
- This serves as a temporary fix to improve user experience.
* fix: improve error handling in phase_auth function
- Updated the phase_auth function to exit with code 2 when required parameters are missing or invalid, enhancing user experience and preventing further execution in error scenarios.
---------
Signed-off-by: rohan <[email protected]>
Co-authored-by: rohan <[email protected]>
Handles authentication for the Phase CLI using either web-based or token-based authentication.
99
+
Handles authentication for the Phase CLI using web-based, token-based, or AWS IAM authentication.
99
100
100
101
If a user is already authenticated, the function will notify the user of their logged-in status and provide instructions for logging out and logging back in.
0 commit comments