Documentation ¶
Index ¶
- Constants
- Variables
- func BakeCookieWithJWT(jwt string) *http.Cookie
- func BcryptString(input string) string
- func DecryptPassword(r *http.Request, pass *models.Password, clientNonce *models.Nonce) (string, error)
- func EncodeJWT(payload PayloadJWT) string
- func GetServerNonce(r *http.Request) ([]byte, error)
- func IssueJWT(name string) string
- func ParseJWTCookie(r *http.Request) (string, error)
- func ServerNonceHandler(w http.ResponseWriter, r *http.Request)
- func ValidateJWT(r *http.Request) error
- type HeaderJWT
- type PayloadJWT
Constants ¶
View Source
const COOKIE_TOKEN_NAME = "token"
View Source
const HeaderAuthReqId = "Authentication-Request-ID"
View Source
const HeaderAuthServerNonce = "Authentication-Server-Nonce"
View Source
const JWT_ALG = "HS256"
View Source
const JWT_TYP = "JWT"
View Source
const MAX_TOKEN_AGE = 60
View Source
const REQID_SIZE = 8
View Source
const SNONCE_SIZE = 16
View Source
const WAIT_TIME = 20 * time.Second
Variables ¶
View Source
var AuthRequests = make(map[string][SNONCE_SIZE]byte)
Functions ¶
func BakeCookieWithJWT ¶
func BcryptString ¶
func DecryptPassword ¶
func EncodeJWT ¶
func EncodeJWT(payload PayloadJWT) string
func ServerNonceHandler ¶
func ServerNonceHandler(w http.ResponseWriter, r *http.Request)
func ValidateJWT ¶
Types ¶
type PayloadJWT ¶
func ParseLoadFromJWT ¶
func ParseLoadFromJWT(jwtString string) (PayloadJWT, error)
Click to show internal directories.
Click to hide internal directories.