Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetRolesForPath ¶
func GetRolesForPath[T goservectx.Principal](ctx goservectx.Request[T]) ([]string, bool)
GetRolesForPath retrieves the roles associated with a request path.
This function takes the API request context and determines the roles required for accessing the specified path. The roles are matched based on predefined patterns or exact path matches.
Parameters:
ctx - The API request context containing request metadata.
Returns:
[]string - A slice of required roles for the path or nil if no roles are defined. bool - True if roles are required for the path, false otherwise.
func IsPublicPath ¶
func IsPublicPath[T goservectx.Principal](ctx goservectx.Request[T]) bool
IsPublicPath checks if the provided path is registered as a public route.
This function takes the API request context and verifies whether the current request path matches any registered public routes. Public routes are those that do not require any roles to access.
Parameters:
ctx - The API request context containing request metadata.
Returns:
bool - True if the path is a public route, false otherwise.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.