- Integrated ACL (Access Control List) functionality into the OAuth guard, enabling permission checks and rate limiting based on ACL configurations. - Updated error responses for token validation and refresh token handling to use standardized error types. - Enhanced error handling for ACL-related issues, providing detailed HTTP responses based on specific ACL error types. - Improved overall security and user experience by ensuring proper authorization checks are enforced during API requests.
12 lines
312 B
Go
12 lines
312 B
Go
package acl
|
|
|
|
import "github.com/gin-gonic/gin"
|
|
|
|
// Enforcer interface is used to enforce access control rules
|
|
type Enforcer interface {
|
|
// Enforce checks if a user has access to a resource
|
|
Enforce(c *gin.Context) (bool, error)
|
|
|
|
// Enabled returns true if the ACL is enabled, otherwise false
|
|
Enabled() bool
|
|
}
|