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
Improve secret parameter support for firebase functions. (#9335)
* Improve secret parameter support for firebase functions.
Key changes:
- Added --format flag to functions:secrets:set command
- Auto-detect JSON format from .json file extensions
- Added format field to SecretParam interface for deploy-time handling
- Use visible input() prompt for JSON secrets vs password() for regular secrets
- Validate JSON format before storing in Secret Manager
- Improved error messages with actionable commands for developers
- Added non-interactive mode check with helpful error for missing secrets
Example usage:
firebase functions:secrets:set STRIPE_CONFIG --format=json --data-file config.json
cat config.json | firebase functions:secrets:set STRIPE_CONFIG --format=json
* Address code review feedback for functions-secrets-set command
- Include parse error message in JSON validation errors for better debugging
- Remove redundant --format=json flag from error suggestions (auto-detected from .json extension)
- Use consistent <file.json> placeholder instead of config.json in examples
- Implement custom secret reading logic to handle file/stdin/interactive input
- Keep all interactive secrets hidden using password() for security (including JSON)
* Address code review feedback for deploy-time secret params
- Include parse error message in JSON validation errors for better debugging
- Remove redundant --format=json flag from error suggestions (auto-detected from .json extension)
- Use consistent <file.json> placeholder instead of config.json in examples
- Keep all interactive secrets hidden using password() for security (including JSON)
* Formatting.
* Add CHANGELOG entry for JSON secrets support
* Extract JSON secret validation to shared function
Move validateJsonSecret to src/functions/secrets.ts to adhere to DRY principle and improve maintainability. This avoids duplicating the same validation logic and error messages across multiple files.
* formatting.
* make better use of existing utiliyt.
* nit: organize import.
0 commit comments