Files
firebase/CHANGELOG.md

30 lines
2.1 KiB
Markdown
Raw Permalink Normal View History

# Changelog
All notable changes to this module will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this module adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
## [0.9.0] - 2026-03-18
### Added
- `Config` struct — Firebase connection settings loaded from environment variables: `FIREBASE_PROJECT_ID` (required, Google Cloud project ID); credentials are resolved via Application Default Credentials (ADC)
- `Provider` interface — `App() *firebase.App`; for consumers that only need the Firebase Admin SDK entry point
- `Component` interface — embeds `launcher.Component`, `health.Checkable`, and `Provider`; the full lifecycle-managed surface registered with the launcher
- `New(logger logz.Logger, cfg Config) Component` — constructor; returns a `Component` ready for `lc.Append`
- `OnInit` — validates `ProjectID`, then calls `fb.NewApp` to construct the Admin SDK `*firebase.App`
- `OnStart` — no-op beyond logging; connectivity is verified by `HealthCheck`
- `OnStop` — no-op log statement; the Firebase Admin SDK exposes no `Close` method
- `HealthCheck(ctx context.Context) error` — calls `GetUser("health-probe-non-existent")` on the Auth client; treats `auth.IsUserNotFound` as healthy (confirms the service is reachable); any other error is a health failure
- `Name() string` — returns `"firebase"`
- `Priority() health.Level` — returns `health.LevelCritical`; a Firebase Auth outage is treated as a critical failure
### Design Notes
- The native `*firebase.App` is exposed directly via `App()`; callers obtain service-specific clients themselves (e.g. `app.Auth(ctx)`, `app.Firestore(ctx)`), keeping this module free of service proliferation.
- The health check uses a sentinel UID (`"health-probe-non-existent"`) rather than string-matching error messages, making it robust against Firebase error message changes.
- `Provider` / `Component` split follows the framework pattern: inject `Provider` into services that only need `App()`, inject `Component` only at the lifecycle registration site.
[0.9.0]: https://code.nochebuena.dev/go/firebase/releases/tag/v0.9.0