Documentation ¶
Index ¶
- Constants
- Variables
- func GetTelegramUsername(ctx context.Context) (string, error)
- func GetUserInfo(ctx context.Context) (*userInfo, error)
- func HashPassword(password, salt string) string
- func NewAuthorizer(key string, expireDuration time.Duration) *authorizer
- func ParseToken(accessToken string, signingKey []byte) (string, string, int64, error)
- type Claims
Constants ¶
View Source
const ( UserKey = "X-Auth-User" TokenKey = "X-Auth-Token" TelegramKey = "X-Auth-Telegram" )
Variables ¶
View Source
var ErrInvalidAccessToken = errors.New("invalid auth token")
View Source
var ErrUserAlreadyExists = errors.New("user with such credentials already exist")
View Source
var ErrUserDoesNotExist = errors.New("user does not exist")
Functions ¶
func GetTelegramUsername ¶ added in v1.0.3
func GetUserInfo ¶
func HashPassword ¶
func NewAuthorizer ¶
Types ¶
Click to show internal directories.
Click to hide internal directories.