Package org.faceless.publisher.web
Class Authorization
java.lang.Object
org.faceless.publisher.web.Authorization
An Authorization is granted by an Authority in response to an access token.
-
Field Summary
Modifier and TypeFieldDescriptionstatic final Authorization
An Authorization that disallows everything -
Constructor Summary
ConstructorDescriptionAuthorization
(String name, Collection<String> grants, long maxBufferSize, String accessToken, Json defaults, Json overrides) Create a new Authorization -
Method Summary
Modifier and TypeMethodDescriptionvoid
applyDefaultsAndOverrides
(String type, Json data) Apply the defaults for this type under the supplied json object, and the overrides over itReturn the full access-token, which may be empty but will never be nulllong
getName()
boolean
isAuthorized
(String... required) Check if this Authorization allows all the specified requirements Requirements can be of the form "ws", "admin/pause" - no wildcards.toString()
-
Field Details
-
UNAUTHORIZED
An Authorization that disallows everything
-
-
Constructor Details
-
Authorization
public Authorization(String name, Collection<String> grants, long maxBufferSize, String accessToken, Json defaults, Json overrides) Create a new Authorization- Parameters:
name
- the user namegrants
- the grants this Authorization has - may include wildcards, * eg "*" or "**" or "admin/*". "*" matches one, "**" matches any segmentsmaxBufferSize
- the maximum buffer size allowed with this AuthorizationaccessToken
- the bearer tokendefaults
- the Authorization defaultsoverrides
- the Authorization overrides
-
-
Method Details
-
isAuthorized
Check if this Authorization allows all the specified requirements Requirements can be of the form "ws", "admin/pause" - no wildcards.- Returns:
- true if all specified requiremnts are met, false otherwise
-
getMaxBufferSize
public long getMaxBufferSize() -
getAccessToken
Return the full access-token, which may be empty but will never be null -
getName
-
applyDefaultsAndOverrides
Apply the defaults for this type under the supplied json object, and the overrides over it -
toString
-