mirror of
https://github.com/scm-manager/scm-manager.git
synced 2025-11-10 15:35:49 +01:00
protect mustache resources
This commit is contained in:
@@ -30,14 +30,19 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
package sonia.scm;
|
package sonia.scm;
|
||||||
|
|
||||||
//~--- non-JDK imports --------------------------------------------------------
|
//~--- non-JDK imports --------------------------------------------------------
|
||||||
|
|
||||||
|
import com.google.inject.name.Names;
|
||||||
|
|
||||||
import org.apache.shiro.guice.web.ShiroWebModule;
|
import org.apache.shiro.guice.web.ShiroWebModule;
|
||||||
|
|
||||||
import sonia.scm.security.ScmRealm;
|
import sonia.scm.security.ScmRealm;
|
||||||
|
|
||||||
|
import static org.apache.shiro.guice.web.ShiroWebModule.ROLES;
|
||||||
|
|
||||||
//~--- JDK imports ------------------------------------------------------------
|
//~--- JDK imports ------------------------------------------------------------
|
||||||
|
|
||||||
import javax.servlet.ServletContext;
|
import javax.servlet.ServletContext;
|
||||||
@@ -69,6 +74,15 @@ public class ScmSecurityModule extends ShiroWebModule
|
|||||||
@Override
|
@Override
|
||||||
protected void configureShiroWeb()
|
protected void configureShiroWeb()
|
||||||
{
|
{
|
||||||
|
|
||||||
|
// bind realm
|
||||||
bindRealm().to(ScmRealm.class);
|
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