auth

package
v0.54.1 Latest Latest
Warning

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

Go to latest
Published: Jun 15, 2024 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetUserId

func GetUserId(c echo.Context) string

func HasAccount

func HasAccount(c echo.Context) bool

func HasAuth

func HasAuth(c echo.Context) bool

Types

type Backend

type Backend interface {
	BuildMiddleware() echo.MiddlewareFunc
	RegisterRoutes(group EchoRouter)
}

type EchoRouter added in v0.19.2

type EchoRouter interface {
	GET(path string, h echo.HandlerFunc, m ...echo.MiddlewareFunc) *echo.Route
	POST(path string, h echo.HandlerFunc, m ...echo.MiddlewareFunc) *echo.Route
}

type OryBackend

type OryBackend struct {
	// contains filtered or unexported fields
}

OryBackend is used for the Kratos auth method. It is used by the official instance with Ory Cloud. It should work with a self-hosted Kratos, but this has not been tested.

func NewOryBackend

func NewOryBackend(rootUrl string, renderer renderer, statsd statsd.ClientInterface, sunset bool) *OryBackend

func (*OryBackend) BuildMiddleware

func (o *OryBackend) BuildMiddleware() echo.MiddlewareFunc

BuildMiddleware tries to resolve an Ory Cloud session from the cookies. If it succeeds, a "user" value is added to the context for use by handlers.

func (*OryBackend) RegisterRoutes

func (o *OryBackend) RegisterRoutes(group EchoRouter)

type Proxy

type Proxy struct {
	// contains filtered or unexported fields
}

Proxy is used to run the server being an authenticating proxy. It expects an HTTP header to be set by the proxy, and uses its value as the unique user ID.

func NewProxy

func NewProxy(headerName string) *Proxy

func (*Proxy) BuildMiddleware

func (e *Proxy) BuildMiddleware() echo.MiddlewareFunc

func (*Proxy) RegisterRoutes

func (e *Proxy) RegisterRoutes(_ EchoRouter)

Jump to

Keyboard shortcuts

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