
External Policy InterfaceScrambls policy can be configured to reference an external server. This allows the owner of a group to divert policy decisions to his or her own server. When a user tries to view a post configured with such a policy, scrambls makes a real-time request to the server has group owner has specified. The request can be contain attribute tokens that scrambls will populate from the current context. The external server is responsible for responding with a boolean that determines whether the policy term is satisfied or not.
Creating a Group Policy with an External Server Term
Post Protocol
Scrambls issues an HTTP "GET" request with the given URL. The external server should be configured to conduct the conversation over SSL, but this is not required. The response header should identify the content as: The response is a JSON structure containing the following attributes:
Scrambls Attribute TokensScrambls attribute tokens allow you to configure the URL of your policy test with information from the current context. Currently only one attribute is supported, email address. Other attributes and identifiers will become available over time.
ExamplesThe following url configured as an external service will post a request to inlist on policy.myserver.com along with the paramter email http://policy.myserver.com/TestPolicy/inlist?email=$(email) If the current user is, say [email protected], then the call received by the external server from scrambls would be http://policy.myserver.com/TestPolicy/[email protected] The server configures it's response in JSON, and assuming [email protected] is to be granted access, returns: {"item":"[email protected]","inlist":true,"cache":0}
Sample CodePolicyInterfacePerl - an implementation in Perl for use with TWiki | |||||||||||||||||