Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
  * Licensed to the Apache Software Foundation (ASF) under one
  * or more contributor license agreements.  See the NOTICE file
  * distributed with this work for additional information
  * regarding copyright ownership.  The ASF licenses this file
  * to you under the Apache License, Version 2.0 (the
  * "License"); you may not use this file except in compliance
  * with the License.  You may obtain a copy of the License at
 * Unless required by applicable law or agreed to in writing,
 * software distributed under the License is distributed on an
 * KIND, either express or implied.  See the License for the
 * specific language governing permissions and limitations
 * under the License.
package org.apache.shindig.gadgets;

Interface for locked domain, a security mechanism that ensures that a gadget is always registered on a fixed, unique domain. This prevents attacks from other gadgets that are rendered on the same domain, since all modern web browsers implement a same origin policy that prevents pages served from different hosts from accessing each other's data.
public interface LockedDomainService {

True if the host is safe for use with the open proxy.
  boolean isSafeForOpenProxy(String host);

Check whether a gadget should be allowed to render on a particular host.

host host name for the content
gadget URL of the gadget
container container
true if the gadget can render
  boolean gadgetCanRender(String hostGadget gadgetString container);

Calculate the locked domain for a particular gadget on a particular container.

gadget URL of the gadget
container name of the container page
the host name on which the gadget should render, or null if locked domain should not be used to render this gadget.
  public String getLockedDomainForGadget(Gadget gadgetString container);
New to GrepCode? Check out our FAQ X