Package org.faceless.publisher.web
Class Authority
java.lang.Object
org.faceless.publisher.web.Authority
An Authority authorizes "grants" on a ServiceEngine to be run remotely.
One or more are required to allow normal use. At a minimum they require
a Key (public or secret) and one or more grants which they can approve.
Requests made to the service engine will be tested against each
authority and the first one that matches will be used to configure the job.
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionJson
Return the the set of Json "defaults" for this AuthorityReturn the a read-only list of "grants" from this AuthoritygetKey()
Return the the public or secret key for this AuthorityReturn the a read-only list of "matches" from this Authoritylong
Return the the max-buffer-size from this AuthorityJson
Return the the set of Json "overrides" for this Authorityboolean
matches
(InetAddress ip) Return true of this authority matches the specified IP addressboolean
originMatches
(String origin, StringBuilder header) Return true of this authority matches the specified HTTP Origin headersetGrants
(Collection<String> grants) Set the the list of grants approved by this AuthoritySet the the Key for this AuthoritysetMaxBufferSize
(long limit) Set the the maximum buffer size for network traffic claiming this authoritytoString()
-
Field Details
-
ALLOWALL
A generic authority that allows all operations without restriction
-
-
Constructor Details
-
Authority
public Authority()Create a new Authority -
Authority
public Authority(Json json) Create a new Authority by parsing the supplied Json- Parameters:
json
- the json decsribing the Authority
-
-
Method Details
-
setKey
Set the the Key for this Authority- Parameters:
key
- the PublicKey or SecretKey
-
setGrants
Set the the list of grants approved by this Authority- Parameters:
grants
- the grants
-
setMaxBufferSize
Set the the maximum buffer size for network traffic claiming this authority- Parameters:
limit
- the limit, or 0 for no limit
-
matches
Return true of this authority matches the specified IP address- Parameters:
ip
- the address- Returns:
- true if this authority applies
-
originMatches
Return true of this authority matches the specified HTTP Origin header- Parameters:
origin
- the originheader
- if not null, the StringBuffer will be populated with the values for the "Access-Control-Allow-Origin" header- Returns:
- true if this authority applies
-
getMatches
Return the a read-only list of "matches" from this Authority -
getGrants
Return the a read-only list of "grants" from this Authority -
getMaxBufferSize
public long getMaxBufferSize()Return the the max-buffer-size from this Authority -
getDefaults
public Json getDefaults()Return the the set of Json "defaults" for this Authority -
getOverrides
public Json getOverrides()Return the the set of Json "overrides" for this Authority -
getKey
Return the the public or secret key for this Authority -
toString
-