protect mustache resources

This commit is contained in:
Sebastian Sdorra
2013-02-17 13:59:00 +01:00
parent dbc081c73a
commit 99063821d5

View File

@@ -30,14 +30,19 @@
*/
package sonia.scm;
//~--- non-JDK imports --------------------------------------------------------
import com.google.inject.name.Names;
import org.apache.shiro.guice.web.ShiroWebModule;
import sonia.scm.security.ScmRealm;
import static org.apache.shiro.guice.web.ShiroWebModule.ROLES;
//~--- JDK imports ------------------------------------------------------------
import javax.servlet.ServletContext;
@@ -69,6 +74,15 @@ public class ScmSecurityModule extends ShiroWebModule
@Override
protected void configureShiroWeb()
{
// bind realm
bindRealm().to(ScmRealm.class);
// bind constant
bindConstant().annotatedWith(Names.named("shiro.loginUrl")).to(
"/index.html");
// disable access to mustache resources
addFilterChain("/**.mustache", config(ROLES, "nobody"));
}
}