Documentation ¶
Index ¶
Constants ¶
View Source
const BasicToken = "BasicToken"
BasicToken is the name of the token on the Gin Context if Basic Auth is used
View Source
const BearerToken = "BearerToken"
BearerToken is the name of the token on the Gin Context if Basic Auth is used
Variables ¶
This section is empty.
Functions ¶
func BasicHandler ¶
func BasicHandler(parser BasicParser) gin.HandlerFunc
BasicHandler extracts the Basic Token and verifies it via the BasicParser
func BearerHandler ¶
func BearerHandler(parser BearerParser) gin.HandlerFunc
BearerHandler extracts the Bearer Token and verifies it via the BearerParser
Types ¶
type BasicParser ¶
type BasicParser interface { Realm() string ParseAndVerify(user, password string) (interface{}, error) }
BasicParser is the interface for something that can parse and verify a Basic Token
type BearerParser ¶
type BearerParser interface { Realm() string ParseAndVerify(bearerToken string) (interface{}, error) }
BearerParser is the interface for something that can parse and verify a Bearer Token
Click to show internal directories.
Click to hide internal directories.