Documentation ¶
Overview ¶
Package auth provides functions to generate and check Centrifugo auth signs.
Index ¶
- Constants
- func CheckChannelSign(secret, client, channel, channelData, providedSign string) bool
- func CheckClientSign(secret, user, exp, info, opts, providedToken string) bool
- func GenerateChannelSign(secret, client, channel, channelData string) string
- func GenerateClientSign(secret, user, exp, info, opts string) string
Constants ¶
const (
HMACLength = 64
)
HMACLength used to validate length of token string we received. Centrifugo uses sha256 as digest algorithm for HMAC tokens and signs so all correct tokens must be of fixed length set by this const.
Variables ¶
This section is empty.
Functions ¶
func CheckChannelSign ¶
CheckChannelSign validates a correctness of provided (in subscribe client command) sign comparing it with generated one.
func CheckClientSign ¶
CheckClientSign validates correctness of sign provided by client connection comparing it with generated correct one.
func GenerateChannelSign ¶
GenerateChannelSign generates sign which is used to prove permission of client to subscribe on private channel.
func GenerateClientSign ¶
GenerateClientSign generates client connection sign based on secret key and provided connection parameters such as user ID, exp, info and opts.
Types ¶
This section is empty.