daisy/nullauth.go

23 lines
358 B
Go
Raw Normal View History

2024-05-14 11:11:02 +01:00
//go:build nullauth
package daisy
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{}
}