refactor(httpauth-firebase)!: delegate enrichment and authz to httpauth v0.1.0

EnrichmentMiddleware, AuthzMiddleware, IdentityEnricher, PermissionProvider,
and related types are removed from this module. They now live in
code.nochebuena.dev/go/httpauth, the provider-agnostic middleware layer.

AuthMiddleware is updated to call httpauth.SetTokenData, fulfilling the
integration contract between provider-specific auth and generic middleware.
This module now has a single responsibility: Firebase JWT verification.

BREAKING CHANGE: IdentityEnricher, PermissionProvider, EnrichmentMiddleware,
AuthzMiddleware, and WithTenantHeader are no longer exported from this package.
Import code.nochebuena.dev/go/httpauth for those identifiers.
This commit is contained in:
2026-05-07 21:57:01 -06:00
parent d1de096c72
commit 2c90fe22bf
10 changed files with 65 additions and 358 deletions

View File

@@ -6,7 +6,6 @@ import (
"firebase.google.com/go/v4/auth"
httpauth "code.nochebuena.dev/go/httpauth-firebase"
"code.nochebuena.dev/go/rbac"
)
type mockVerifier struct{}
@@ -15,19 +14,5 @@ func (m *mockVerifier) VerifyIDTokenAndCheckRevoked(_ context.Context, _ string)
return nil, nil
}
type mockEnricher struct{}
func (m *mockEnricher) Enrich(_ context.Context, _ string, _ map[string]any) (rbac.Identity, error) {
return rbac.Identity{}, nil
}
type mockProvider struct{}
func (m *mockProvider) ResolveMask(_ context.Context, _, _ string) (rbac.PermissionMask, error) {
return 0, nil
}
// Compile-time interface satisfaction checks.
var _ httpauth.TokenVerifier = (*mockVerifier)(nil)
var _ httpauth.IdentityEnricher = (*mockEnricher)(nil)
var _ httpauth.PermissionProvider = (*mockProvider)(nil)
// Compile-time interface satisfaction check.
var _ httpauth.TokenVerifier = (*mockVerifier)(nil)