auth

package
v0.0.0-...-c5e0fe0 Latest Latest
Warning

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

Go to latest
Published: Mar 14, 2024 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const (
	StatusTokenInvalid     = "invalid-token"
	StatusTokenExpired     = "expired-token"
	StatusInternal         = "internal-auth-error"
	StatusNotAuthenticated = "not-authenticated"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type AdminAuth

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

func (*AdminAuth) Signin

func (a *AdminAuth) Signin(name, password *string) (state.Error, *string)

type Auth

type Auth struct {
	Admin    *AdminAuth
	UserAuth *UserAuth
	UserJWT  *JWT
	AdminJWT *JWT
	// contains filtered or unexported fields
}

func Instance

func Instance() *Auth

type AuthState

type AuthState = state.AppState

type Claims

type Claims struct {
	UID string
	jwt.RegisteredClaims
}

type JWT

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

func (*JWT) GetToken

func (j *JWT) GetToken(uid string) (*string, *AuthState)

func (*JWT) RenewToken

func (j *JWT) RenewToken(token *string) (*string, *AuthState)

func (*JWT) Validate

func (j *JWT) Validate(token *string) *AuthState

type UserAuth

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

func (*UserAuth) Signin

func (a *UserAuth) Signin(name, password *string) (state.Error, *string)

func (*UserAuth) Signup

func (a *UserAuth) Signup(name, password *string) (state.Error, *profiles.User)

Jump to

Keyboard shortcuts

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