-
Release v1.0.0 Stable
released this
2026-05-07 23:50:39 -06:00 | 1 commits to main since this releasev1.0.0
code.nochebuena.dev/go/httpauth-firebaseOverview
httpauth-firebasev1.0.0 finalizes the module's scope: Firebase JWT verification
only. Identity enrichment, RBAC authorization, and permission providers have moved
tocode.nochebuena.dev/go/httpauth— the provider-agnostic middleware layer shared
acrosshttpauth-firebase,httpauth-jwt, and any future auth provider.AuthMiddlewarenow callshttpauth.SetTokenDatato inject uid and claims into
context, fulfilling the integration contract that all provider-specific auth modules
share. The rest of the stack (EnrichmentMiddleware,AuthzMiddleware, etc.) is
consumed directly fromhttpauth.Breaking Changes
The following identifiers are no longer exported from this package. Import
code.nochebuena.dev/go/httpauthinstead.Removed from httpauth-firebaseNow in httpauthIdentityEnricherhttpauth.IdentityEnricherPermissionProviderrbac.PermissionProviderEnrichmentMiddlewarehttpauth.EnrichmentMiddlewareAuthzMiddlewarehttpauth.AuthzMiddlewareWithTenantHeaderhttpauth.WithTenantHeaderEnrichOpthttpauth.EnrichOptTokenVerifierandAuthMiddlewareremain unchanged.Migration Guide
Before (v0.9.0):
import httpauth "code.nochebuena.dev/go/httpauth-firebase" r.Use(httpauth.AuthMiddleware(firebaseClient, publicPaths)) r.Use(httpauth.EnrichmentMiddleware(myEnricher)) r.With(httpauth.AuthzMiddleware(permProvider, "orders", rbac.Write)).Post("/orders", h)After (v1.0.0):
import ( httpauthfirebase "code.nochebuena.dev/go/httpauth-firebase" httpauthmw "code.nochebuena.dev/go/httpauth" ) r.Use(httpauthfirebase.AuthMiddleware(firebaseClient, publicPaths)) r.Use(httpauthmw.EnrichmentMiddleware(myEnricher)) r.With(httpauthmw.AuthzMiddleware(permProvider, "orders", rbac.Write)).Post("/orders", h)The package identifier changes from
httpauthtohttpauthfirebase— update the
import alias (or remove it if you now import using the natural package name).
No behavior changes.What's Included
AuthMiddleware(verifier TokenVerifier, publicPaths []string) func(http.Handler) http.HandlerVerifies the
Authorization: Bearer <token>header via Firebase JWT verification
and injects uid + raw claims into the request context viahttpauth.SetTokenData.
Requests matching any pattern inpublicPathsare passed through without token
verification. Returns 401 on missing or invalid tokens.TokenVerifierinterfaceAbstracts
*auth.Clientfor unit-test mockability. Production code passes the
Firebase auth client directly.Installation
go get code.nochebuena.dev/go/httpauth-firebase@v1.0.0 go get code.nochebuena.dev/go/httpauth@v1.0.0Design Highlights
Single responsibility. This module verifies Firebase tokens. Everything else
lives inhttpauth. The boundary is enforced by the module graph:httpauth-firebase
importshttpauth, never the reverse.httpauth.SetTokenDataas the integration contract. All provider-specific auth
modules (httpauth-firebase,httpauth-jwt, etc.) callhttpauth.SetTokenDataafter
verifying their token. Generic middleware (EnrichmentMiddleware,AuthzMiddleware)
reads from those same context keys — no provider knowledge required.No behavior changes. The token verification logic, public path bypass, and 401
response behavior are identical to v0.9.0.Downloads