auth

package
v0.2.2 Latest Latest
Warning

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

Go to latest
Published: Jun 29, 2022 License: Apache-2.0 Imports: 26 Imported by: 0

Documentation

Index

Constants

View Source
const (
	JWT_AUTH_KEY           = "JWT_AUTH"
	AuthorizationHeaderKey = "Authorization"
)
View Source
const (
	AccessCookieMaxAge  = int(time.Second * 3600)
	RefreshCookieMaxAge = int(AccessCookieMaxAge * 3600)
)
View Source
const (
	AccessCookieKey = "access"
	RefreshCookKey  = "refresh"
	QueryToken      = "token"
)

Variables

This section is empty.

Functions

func BasicAuthWithConfig

func BasicAuthWithConfig(config middleware.BasicAuthConfig) echo.MiddlewareFunc

BasicAuthConfig is a local copy of echo's middleware.BasicAuthWithConfig

Types

type AccessList

type AccessList []struct {
	Type    string   `json:"type"`
	Name    string   `json:"name"`
	Actions []string `json:"actions"`
}

type Authentication

type Authentication interface {
	SignUp(ctx echo.Context) error
	SignIn(ctx echo.Context) error
	BasicAuth() echo.MiddlewareFunc
	Token(ctx echo.Context) error
	JWT() echo.MiddlewareFunc
	JWTRest() echo.MiddlewareFunc
	ACL() echo.MiddlewareFunc
	LoginWithGithub(ctx echo.Context) error
	GithubLoginCallbackHandler(ctx echo.Context) error
	ExpireSessions(ctx echo.Context) error
	SignOut(ctx echo.Context) error
	ReadUserWithSession(ctx echo.Context) error
	RenewAccessToken(ctx echo.Context) error
	VerifyEmail(ctx echo.Context) error
	ResetPassword(ctx echo.Context) error
	ResetForgottenPassword(ctx echo.Context) error
	ForgotPassword(ctx echo.Context) error
	Invites(ctx echo.Context) error
}

Authentication interface defines the behaviour for container registry and general authentication for the backend

func New

New is the constructor function returns an Authentication implementation

type Claims

type Claims struct {
	jwt.StandardClaims
	Type   string
	Access AccessList
}

type List

type List struct {
	Emails string
}

type PlatformClaims

type PlatformClaims struct {
	OauthPayload *oauth2.Token `json:"oauth2_token,omitempty"`
	jwt.StandardClaims
	Type string
}

type RefreshClaims

type RefreshClaims struct {
	ID string
	jwt.StandardClaims
}

type Scope

type Scope struct {
	Type    string
	Name    string
	Actions map[string]bool
}

type ServiceClaims

type ServiceClaims struct {
	jwt.StandardClaims
	Access AccessList
}

Jump to

Keyboard shortcuts

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