mirror of
https://github.com/scm-manager/scm-manager.git
synced 2025-11-09 23:15:43 +01:00
protect mustache resources
This commit is contained in:
@@ -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"));
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user