Update cli to use firestore token service #17
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This pull request significantly refactors the onboarding process to improve reliability, user experience, and security. The most important changes are a switch from fetching tokens via Secret Manager to using a dedicated token service, enhanced checks for onboarding status, and improved handling of the
.envfile. The CLI now provides clearer feedback to users and supports a--forceoption for re-onboarding.Authentication and Token Fetching:
fetch_token_from_secret_managermethod withfetch_token_from_service, which retrieves a fresh Firebase token from a Cloud Run token service using authenticated identity tokens, ensuring tokens are always up-to-date and reducing dependency on Secret Manager. [1] [2] [3]Onboarding Status and User Experience:
check_onboarded_statusutility and integrated it into the CLI to check Firestore for existing onboarding status, allowing the CLI to skip redundant onboarding steps unless--forceis specified. [1] [2]--forceflag to the CLI to allow users to re-onboard even if already marked as onboarded. [1] [2]Environment File Handling:
validate_env_fileutility and related CLI logic to check if the.envfile is present and complete before proceeding, providing clear instructions to the user and avoiding unnecessary steps if the environment is already set up. [1] [2]Testing Improvements:
pytestvia the Python module interface for improved test execution consistency.Code Quality and Minor Fixes: