Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var (
ErrNoAuthInfo = errors.Base("authentication token missing")
)
View Source
var NilMiddleware = Middleware(nilProvider)
NilMiddleware is useful when you need to test your logic without involving real authentication
Functions ¶
func FromRequest ¶
FromRequest retrieves user from http.Request that went through our Middleware
func Middleware ¶
func Middleware(provider Provider) mux.MiddlewareFunc
Middleware tries to authenticate user using request header
func MiddlewareWithProvider ¶ added in v0.14.3
func MiddlewareWithProvider(rt *sdkrouter.Router, internalAPIHost string) mux.MiddlewareFunc
MiddlewareWithProvider is useful when you want to
Types ¶
type Provider ¶
Provider tries to authenticate using the provided auth token
func NewIAPIProvider ¶
NewIAPIProvider authenticates a user by hitting internal-api with the auth token and matching the response to a local user. If auth is successful, the user will have a lbrynet server assigned and a wallet that's created and ready to use.
Click to show internal directories.
Click to hide internal directories.