Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CheckPassword ¶
CheckPassword method checks the inputted password against the hashed password to validate their hashed equivalence.
func CreateError ¶
CreateError responds to client requests with error payloads.
func EncryptPassword ¶
EncryptPassword method hashes the inputted password and returns whether or not the operation was successfull. Remark: the higher the hashing cost, the more computing power is required resulting in slower server response times
Types ¶
type BasicAuthorizer ¶
BasicAuthorizer stores the casbin enforcer
func (*BasicAuthorizer) CheckPermission ¶
func (a *BasicAuthorizer) CheckPermission(c *gin.Context) bool
CheckPermission checks the user/method/path combination from the request. Returns true (permission granted) or false (permission forbidden)
func (BasicAuthorizer) GetRoleName ¶
func (BasicAuthorizer) GetRoleName(c *gin.Context) interface{}
GetRoleName gets the user name from the request. Currently, only HTTP basic authentication is supported
func (BasicAuthorizer) RequirePermission ¶
func (BasicAuthorizer) RequirePermission(c *gin.Context)
RequirePermission returns the 403 Forbidden to the client