jasmine/nullauth.go

23 lines
360 B
Go
Raw Normal View History

2024-05-14 11:12:37 +01:00
//go:build nullauth
package jasmine
import (
"context"
"net/http"
)
type nullAuth struct{}
func (n *nullAuth) Middleware(next http.Handler) http.Handler {
return next
}
func (n *nullAuth) CurrentUserPrincipal(ctx context.Context) (string, error) {
return "/jane@example.com/", nil
}
func NullAuth(_ AuthProvider) AuthProvider {
return &nullAuth{}
}