Documentation ¶
Index ¶
- Variables
- type AccessTokenCreator
- type AccessTokenParser
- type LogOutRequestHandler
- type RefreshRequest
- type RefreshRequestHandler
- type RefreshResponse
- type RefreshTokenCreator
- type RefreshTokenDeleter
- type RefreshTokenGetter
- type RefreshTokenParser
- type RefreshTokenSaver
- type RefreshTokensDeleter
- type SignInRequest
- type SignInRequestHandler
- type SignInResponse
- type SignOutRequest
- type SignOutResponse
- type SignUpRequest
- type SignUpRequestHandler
- type SignUpResponse
- type UserFinder
- type UserSaver
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrSignInInvalidUsername = errSignInInvalidUsername() ErrSignInInvalidPassword = errSignInInvalidPassword() ErrSignInUserNotFound = errSignInUserNotFound() )
View Source
var ( ErrSignUpInvalidUsername = errSignUpInvalidUsername() ErrSignUpInvalidPassword = errSignUpInvalidPassword() ErrSignUpUserAlreadyExists = errSignUpUserAlreadyExists() )
View Source
var (
ErrRefreshInvalidOrExpiredToken = errRefreshInvalidOrExpiredToken()
)
View Source
var ErrSignOutInvalidOrExpiredToken = errSignOutInvalidOrExpiredToken()
Functions ¶
This section is empty.
Types ¶
type AccessTokenCreator ¶
type AccessTokenCreator interface {
New(claims jwt.AccessTokenClaims) (string, error)
}
type AccessTokenParser ¶
type AccessTokenParser interface {
Parse(token string) (jwt.AccessTokenClaims, error)
}
type LogOutRequestHandler ¶
type LogOutRequestHandler interface {
Handle(ctx context.Context, request SignOutRequest) (SignOutResponse, error)
}
func NewSignOutRequestHandler ¶
func NewSignOutRequestHandler( accessTokenParser AccessTokenParser, refreshTokensDeleter RefreshTokensDeleter, refreshTokenGetter RefreshTokenGetter, ) LogOutRequestHandler
type RefreshRequest ¶
type RefreshRequest struct {
RefreshToken string
}
type RefreshRequestHandler ¶
type RefreshRequestHandler interface {
Handle(ctx context.Context, request RefreshRequest) (RefreshResponse, error)
}
func NewRefreshRequestHandler ¶
func NewRefreshRequestHandler( accessTokenCreator AccessTokenCreator, accessTokenParser AccessTokenParser, accessTokenExpiresIn time.Duration, refreshTokenCreator RefreshTokenCreator, refreshTokenParser RefreshTokenParser, refreshTokenExpiresIn time.Duration, refreshTokenSaver RefreshTokenSaver, refreshTokenDeleter RefreshTokenDeleter, refreshTokenGetter RefreshTokenGetter, ) RefreshRequestHandler
type RefreshResponse ¶
type RefreshTokenCreator ¶
type RefreshTokenCreator interface {
New(claims jwt.RefreshTokenClaims) (string, error)
}
type RefreshTokenDeleter ¶
type RefreshTokenGetter ¶
type RefreshTokenParser ¶
type RefreshTokenParser interface {
Parse(token string) (jwt.RefreshTokenClaims, error)
}
type RefreshTokenSaver ¶
type RefreshTokensDeleter ¶
type SignInRequest ¶
type SignInRequestHandler ¶
type SignInRequestHandler interface {
Handle(ctx context.Context, request SignInRequest) (SignInResponse, error)
}
func NewSignInRequestHandler ¶
func NewSignInRequestHandler( accessTokenCreator AccessTokenCreator, accessTokenExpiresIn time.Duration, refreshTokenCreator RefreshTokenCreator, refreshTokenExpiresIn time.Duration, refreshTokenSaver RefreshTokenSaver, userFinder UserFinder, ) SignInRequestHandler
type SignInResponse ¶
type SignOutRequest ¶
type SignOutRequest struct {
AccessToken string
}
type SignOutResponse ¶
type SignOutResponse struct{}
type SignUpRequest ¶
type SignUpRequestHandler ¶
type SignUpRequestHandler interface {
Handler(ctx context.Context, request SignUpRequest) (SignUpResponse, error)
}
func NewSignUpRequestHandler ¶
func NewSignUpRequestHandler( userSaver UserSaver, ) SignUpRequestHandler
type SignUpResponse ¶
type SignUpResponse struct{}
type UserFinder ¶
Click to show internal directories.
Click to hide internal directories.