2026-03-19 13:44:45 +00:00
|
|
|
package httpauth_test
|
|
|
|
|
|
|
|
|
|
import (
|
|
|
|
|
"context"
|
|
|
|
|
|
|
|
|
|
"firebase.google.com/go/v4/auth"
|
|
|
|
|
|
|
|
|
|
httpauth "code.nochebuena.dev/go/httpauth-firebase"
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
type mockVerifier struct{}
|
|
|
|
|
|
|
|
|
|
func (m *mockVerifier) VerifyIDTokenAndCheckRevoked(_ context.Context, _ string) (*auth.Token, error) {
|
|
|
|
|
return nil, nil
|
|
|
|
|
}
|
|
|
|
|
|
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.
2026-05-07 21:57:01 -06:00
|
|
|
// Compile-time interface satisfaction check.
|
|
|
|
|
var _ httpauth.TokenVerifier = (*mockVerifier)(nil)
|