Documentation
¶
Index ¶
Constants ¶
View Source
const ( HeaderAPIKey = "X-API-Key" HeaderRateLimitBurst = "X-Rate-Limit-Burst" HeaderRateLimitDaily = "X-Rate-Limit-Daily" HeaderRateLimitMonthly = "X-Rate-Limit-Monthly" // Error messages ErrMsgAPIKeyRequired = "API key is required" ErrMsgInternalServer = "Internal server error" )
Variables ¶
This section is empty.
Functions ¶
func RedirectIfNotLoggedIn ¶
func RedirectIfNotLoggedIn(authService *authz.Service) gin.HandlerFunc
RedirectIfNotLoggedIn is a simpler middleware that redirects to a specified URL if the user is not logged in, instead of returning a JSON error.
func RequireAdmin ¶
func RequireAdmin(authService *authz.Service) gin.HandlerFunc
RequireAdmin is middleware that ensures only admin users can access certain routes
func UserSession ¶
func UserSession(authService *authz.Service) gin.HandlerFunc
UserSession is middleware that handles user session validation and setup.
func ValidateRequest ¶
func ValidateRequest(service, permission string, conn *grpc.ClientConn) gin.HandlerFunc
ValidateRequest returns a middleware that validates API requests against the dev service
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.