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