[ 
https://issues.apache.org/jira/browse/SHINDIG-489?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Neil updated SHINDIG-489:
-------------------------

    Attachment:     (was: whitelist.patch)

> Whitelist functionality
> -----------------------
>
>                 Key: SHINDIG-489
>                 URL: https://issues.apache.org/jira/browse/SHINDIG-489
>             Project: Shindig
>          Issue Type: New Feature
>          Components: Gadget Rendering Server (Java)
>            Reporter: Neil
>         Attachments: whitelist_tests.patch
>
>
> I have a requirement for a gadget whitelist - so that Shindig cannot be 
> easily used as a proxy onto a protected network.  The current black list 
> functionality provided is not enough, as I require the ability to only allow 
> a small set of gadgets and/or domains.  Blacklisting then entire internet bar 
> a single domain isn't really an option!
> I have provided a default implementation, based on the current 
> BasicGadgetBlacklist implementation.
> It is driven by a text file.  The file can contain exact URLs (to XML 
> gadgets) to whitelist or it can contain regular expressions, denoting whole 
> domains that are allowed.  These entries must be prefixed with REGEX.  The 
> file is read only on application startup.
> The whitelist can be turned on or off by specifying the file in the 
> shindig/java/gadgets/conf/gadget.properties  next to the property 
> whitelist.file.  If the entry is blank then no whitelist is applied - which 
> allows all gadgets through - except those on the blacklist.
> If a gadget URL matches the whitelist then it is allowed to be rendered.  If 
> not, then the gadget is rendered with the error message NOT_IN_WHITELIST.
> Changes for the build
> The following changes were made to provide this build:
>     * shindig/java/gadget/conf/gadget.properties - entry whitelist.file 
> added, and default value for blacklist.file updated
>     * in java/gadgets
>           o org.apache.shindig.gadgets.GadgetWhitelist - new Interface for 
> the whitelist added.  Contains one method: isWhitelisted(URI)
>           o org.apache.shindig.gadgets.BasicGadgetWhitelist - default 
> implementation of GadgetWhitelist.  Essentially a copy of existing 
> BasicGadgetBlacklist
>           o org.apache.shindig.gadgets.GadgetServer - constructor changed to 
> accept new GadgetWhitelist object (injected automatically using Guice).  
> processGadget(GadgetContext) method altered to add call to whitelist object 
> isWhitelisted(URI) method.  This is after black list check.
>           o org.apache.shindig.gadgets.GadgetException - Code enum extended 
> to add NOT_IN_WHITELIST value.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply via email to