auth

package
v0.14.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 21, 2020 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrNoAuthInfo = errors.Base("unauthorized")

Functions

func FromRequest

func FromRequest(r *http.Request) (*models.User, error)

func Middleware

func Middleware(provider Provider) mux.MiddlewareFunc

func SDKAddress added in v0.13.7

func SDKAddress(u *models.User) string

Types

type Provider

type Provider func(token, metaRemoteIP string) (*models.User, error)

Provider tries to authenticate using the provided auth token

func NewIAPIProvider

func NewIAPIProvider(rt *sdkrouter.Router, internalAPIHost string) Provider

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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL