Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var (
ErrInvalidCredentials = echo.NewHTTPError(http.StatusUnauthorized, "Username or password does not exist")
)
Custom errors
Functions ¶
This section is empty.
Types ¶
type Auth ¶
type Auth struct {
// contains filtered or unexported fields
}
Auth represents auth application service
func Initialize ¶
func Initialize(db *pg.DB, j TokenGenerator, sec Securer, rbac RBAC) Auth
Initialize initializes auth application service
func New ¶
func New(db *pg.DB, udb UserDB, j TokenGenerator, sec Securer, rbac RBAC) Auth
New creates new iam service
func (Auth) Authenticate ¶
Authenticate tries to authenticate the user provided by username and password
type RBAC ¶
type RBAC interface {
User(echo.Context) homeschooling.AuthUser
}
RBAC represents role-based-access-control interface
type Service ¶
type Service interface { Authenticate(echo.Context, string, string) (homeschooling.AuthToken, error) Refresh(echo.Context, string) (string, error) Me(echo.Context) (homeschooling.User, error) }
Service represents auth service interface
type TokenGenerator ¶
type TokenGenerator interface {
GenerateToken(homeschooling.User) (string, error)
}
TokenGenerator represents token generator (jwt) interface
Click to show internal directories.
Click to hide internal directories.