Documentation
¶
Index ¶
- func IsNativeRBACGuard(name string) bool
- func Redirect(url string, status int) error
- func RedirectTo(url string) error
- func Respond(result response.Response) error
- func ResponseResult(err error) (response.Response, bool)
- func RunGuards(ctx Context, names []string, registry Registry) error
- func RunGuardsWithAuth(ctx Context, names []string, registry Registry, provider auth.Provider) error
- func WriteNoStoreFailure(writer http.ResponseWriter, err error)
- type Context
- type Func
- type RedirectError
- type Registry
- type ResponseError
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func IsNativeRBACGuard ¶
IsNativeRBACGuard reports whether name is a built-in role or permission guard.
func Redirect ¶ added in v0.5.0
Redirect returns an error that generated guard handling translates into a no-store local redirect with the provided 3xx status.
func RedirectTo ¶ added in v0.5.0
RedirectTo returns an error that generated guard handling translates into a no-store local redirect.
func Respond ¶ added in v0.5.0
Respond returns an error that generated guard handling translates into a no-store runtime response.
func ResponseResult ¶ added in v0.5.0
ResponseResult extracts a generated guard response error.
func RunGuardsWithAuth ¶
func RunGuardsWithAuth(ctx Context, names []string, registry Registry, provider auth.Provider) error
RunGuardsWithAuth executes guard IDs in declaration order and resolves native RBAC guard IDs such as role:admin and permission:posts.write through provider.
func WriteNoStoreFailure ¶ added in v0.5.0
func WriteNoStoreFailure(writer http.ResponseWriter, err error)
WriteNoStoreFailure writes a generated guard failure response. Ordinary guard errors fail closed with 403; guard response helpers keep the same no-store cache policy while allowing explicit redirects or response shapes.
Types ¶
type RedirectError ¶ added in v0.5.0
RedirectError asks generated guard handling to issue a safe local redirect.
func (RedirectError) Error ¶ added in v0.5.0
func (err RedirectError) Error() string
type ResponseError ¶ added in v0.5.0
ResponseError asks generated guard handling to write a runtime response.
func (ResponseError) Error ¶ added in v0.5.0
func (err ResponseError) Error() string