Changelog for firebase-hs-0.1.1.0
Changelog
0.1.1.0
Fixed
- Import
throwErrorfromControl.Monad.Except(mtl) instead ofServant.Serverre-export for compatibility with newer servant versions - Add explicit
mtldependency underservantflag
0.1.0.0
Initial release.
Auth
- Firebase ID token (JWT) verification against Google's public keys
- RS256 signature validation via jose's polymorphic
verifyJWTwith custom claims subtype - JWK-based key fetching with
Cache-Control: max-agecaching - STM-backed
KeyCachefor thread-safe concurrent verification - Strict JWKSet evaluation on fetch (zero deferred parse cost on hot path)
- Convenience
newTlsKeyCacheconstructor - Full claims validation: issuer, audience, expiry, issued-at, subject
- Configurable clock skew (default 300s)
Firestore REST API Client
- CRUD operations:
getDocument,createDocument,updateDocument,deleteDocument - Structured query DSL with composable builder pattern (
query,where_,orderBy,limit) - Composite filters (
compositeAnd,compositeOr) for complex query conditions FirestoreValueADT with custom JSON instances matching Firestore's tagged wire formatDocumenttype with automatic JSON decoding from Firestore responses
Atomic Transactions
beginTransaction,commitTransaction,rollbackTransactionfor manual controlrunTransactionfor automatic begin/commit/rollback with callbackTransactionModesum type:ReadWrite,RetryWith,ReadOnlyTransactionAbortederror variant for contention detection
WAI Auth Middleware (optional)
requireAuth— simple gate middleware, rejects unauthenticated requestsfirebaseAuth— vault-based middleware, propagatesFirebaseUserto handlerslookupFirebaseUser— retrieve authenticated user from WAI vault- Gated behind
waicabal flag (default off) - Works with Warp, Scotty, Yesod, Spock, and any WAI-based framework
Servant Auth Combinator (optional)
firebaseAuthHandler— one-liner Firebase auth for Servant servers- Gated behind
servantcabal flag (default off, zero extra deps) - Pure helpers:
extractBearerToken,authErrorToBody
Internal
- Pure URL builders and error parsers in
Firebase.Firestore.Internal(fully testable) - Redacted
Showinstances forAccessTokenandTransactionId(no credential leakage) - 40 pure tests: value roundtrips, document decoding, URL construction, query DSL, transaction encoding, error parsing