Class AuthScope
java.lang.Object
com.peterphi.std.guice.common.auth.AuthScope
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptiongetRoles
(AuthConstraint annotation) Determine the required role for a given (optionally annotated) method.boolean
getSkip
(AuthConstraint annotation) Determine the value of "skip" for a given (optionally annotated) method.toString()
-
Constructor Details
-
AuthScope
-
-
Method Details
-
getSkip
Determine the value of "skip" for a given (optionally annotated) method. The rule for this is:- If config contains force-skip, use that value
- If AuthConstraint annotation is present and skip is true, the result is true (e.g. for login pages and other open resources)
- Otherwise, if there's a value in config for "skip", use that
- Otherwise, if the AuthConstraint annotation is present, use the skip value from that
- Otherwise (e.g. for no AuthConstraint annotated REST methods), the default is not to skip
- Parameters:
annotation
-- Returns:
-
getRoles
Determine the required role for a given (optionally annotated) method. The rule for this is simple priority:- Roles specified in config for this scope id
- Annotated roles
- If no annotation and no configured roles, throw an IllegalArgumentException
- Parameters:
annotation
-- Returns:
- Throws:
IllegalArgumentException
- If no annotation and no configured role
-
toString
-