Documentation ¶
Index ¶
- type AuthProvider
- type AuthProviderImpl
- func (a *AuthProviderImpl) GenerateToken(ctx context.Context, user *entities.User) (string, error)
- func (a *AuthProviderImpl) HandleLogin(ctx context.Context, username, password string) (user *entities.User, token string, err error)
- func (a *AuthProviderImpl) NewTokenAuth() *jwtauth.JWTAuth
- func (a *AuthProviderImpl) RefreshToken(ctx context.Context, token string) (string, error)
- func (a *AuthProviderImpl) ValidateToken(ctx context.Context, token string) (bool, error)
- func (a *AuthProviderImpl) ValidateUserPassword(ctx context.Context, username, password string) (user *entities.User, valid bool, err error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AuthProvider ¶
type AuthProvider interface { // HandleLogin is a method that will be implemented by the auth provider HandleLogin(ctx context.Context, username, password string) (*entities.User, string, error) // ValidateToken is a method that will be implemented by the auth provider ValidateToken(ctx context.Context, token string) (bool, error) // ValidateUserPassword is a method that will be implemented by the auth provider ValidateUserPassword(ctx context.Context, username, password string) (user *entities.User, valid bool, err error) // RefreshToken is a method that will be implemented by the auth provider RefreshToken(ctx context.Context, token string) (string, error) // GenerateToken is a method that will be implemented by the auth provider GenerateToken(ctx context.Context, user *entities.User) (string, error) // NewTokenAuth is a method that will be implemented by the auth provider NewTokenAuth() *jwtauth.JWTAuth }
func NewAuthProvider ¶
func NewAuthProvider(service *services.OrganizationService) (AuthProvider, error)
NewAuthProvider creates a new AuthProvider
type AuthProviderImpl ¶
type AuthProviderImpl struct { JWTSecret string JWTAuth *jwtauth.JWTAuth Service *services.OrganizationService }
AuthProviderImpl is the default implementation of the AuthProvider interface
func (*AuthProviderImpl) GenerateToken ¶
GetToken is a method that will be implemented by the auth provider
func (*AuthProviderImpl) HandleLogin ¶
func (a *AuthProviderImpl) HandleLogin(ctx context.Context, username, password string) (user *entities.User, token string, err error)
HandleLogin is a method that will be implemented by the auth provider
func (*AuthProviderImpl) NewTokenAuth ¶
func (a *AuthProviderImpl) NewTokenAuth() *jwtauth.JWTAuth
NewTokenAuth is a method that will be implemented by the auth provider
func (*AuthProviderImpl) RefreshToken ¶
RefreshToken is a method that will be implemented by the auth provider
func (*AuthProviderImpl) ValidateToken ¶
ValidateToken is a method that will be implemented by the auth provider
func (*AuthProviderImpl) ValidateUserPassword ¶
func (a *AuthProviderImpl) ValidateUserPassword(ctx context.Context, username, password string) (user *entities.User, valid bool, err error)
ValidateUserPassword is a method that will be implemented by the auth provider
Click to show internal directories.
Click to hide internal directories.