mirror of
https://github.com/1f349/daisy.git
synced 2024-11-09 22:22:54 +00:00
23 lines
358 B
Go
23 lines
358 B
Go
//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{}
|
|
}
|