Documentation ¶
Overview ¶
Package auth determines and asserts client permissions to access and modify server resources.
Index ¶
- Variables
- func AuthenticateCaptcha(captcha string) bool
- func BcryptCompare(password string, hash []byte) error
- func BcryptHash(password string, rounds int) ([]byte, error)
- func GetIP(req *http.Request) string
- func IsBanned(board, ip string) bool
- func IsBoard(board string) bool
- func IsNonMetaBoard(b string) bool
- func RandomID(length int) (string, error)
- func SetBans(b ...Ban)
- type Ban
- type BanRecord
- type SessionCreds
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // IsReverseProxied specifies, if the server is deployed behind a reverse // proxy. IsReverseProxied bool // ReverseProxyIP specifies the IP of a non-localhost reverse proxy. Used // for filtering in XFF IP determination. ReverseProxyIP string )
Functions ¶
func AuthenticateCaptcha ¶
AuthenticateCaptcha posts a request to the SolveMedia API to authenticate a captcha
func BcryptCompare ¶
BcryptCompare compares a bcrypt hash with a user-supplied string
func BcryptHash ¶
BcryptHash generates a bcrypt hash from the passed string
func IsNonMetaBoard ¶
IsNonMetaBoard returns whether a valid board is a classic board and not some other path that emulates a board
Types ¶
type Ban ¶
type Ban struct {
IP, Board string
}
Ban holdsan entry of an IP being banned from a board
type SessionCreds ¶
type SessionCreds struct {
UserID, Session string
}
SessionCreds is embed in every request that needs logged in authentication
Click to show internal directories.
Click to hide internal directories.