Documentation ¶
Overview ¶
Package login contains methods for obtaining structure of the user data and its validation.
Index ¶
Constants ¶
View Source
const ( KeyAuthDate = "auth_date" KeyFirstName = "first_name" KeyHash = "hash" KeyID = "id" KeyLastName = "last_name" KeyPhotoURL = "photo_url" KeyUsername = "username" )
Key... represents available and supported data keys
Variables ¶
View Source
var ErrUserNotDefined = errors.New("user is not defined")
ErrUserNotDefined describes error of an unassigned structure of user
Functions ¶
This section is empty.
Types ¶
type App ¶
type App struct {
SecretKey string
}
App represents a widget which get and validate users authorizations.
func (*App) CheckAuthorization ¶
CheckAuthorization verify the authentication and the integrity of the data received by comparing the received hash parameter with the hexadecimal representation of the HMAC-SHA-256 signature of the data-check-string with the SHA256 hash of the bot's token used as a secret key.
type User ¶
type User struct { AuthDate int64 `json:"auth_date"` FirstName string `json:"first_name"` Hash string `json:"hash"` ID int `json:"id"` LastName string `json:"last_name,omitempty"` PhotoURL string `json:"photo_url,omitempty"` Username string `json:"username,omitempty"` }
User contains data about authenticated user.
Click to show internal directories.
Click to hide internal directories.