service

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Jan 11, 2023 License: AGPL-3.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewAuthenticatorService

func NewAuthenticatorService(uri, databaseName string) (*authenticatorService, error)

Types

type AuthenticatorService

type AuthenticatorService interface {
	// Creates a new user
	Register(user db.User) error
	// Returns a JWT token for a user if exists
	Login(user db.User) (string, error)
}

type TokenClaims

type TokenClaims struct {
	Username string `json:"username"`
	Role     string `json:"role"`
	jwt.StandardClaims
}

TODO move to a common pkg folder TokenClaims contains a basic jwt claim structure

func (TokenClaims) Valid

func (c TokenClaims) Valid() error

Valid overrides StandardClaims validation.

Jump to

Keyboard shortcuts

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