shiro-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Erik Martino Hansen (JIRA)" <j...@apache.org>
Subject [jira] [Created] (SHIRO-472) copy and createSubjectContext doesn't set the correct security manager
Date Mon, 25 Nov 2013 14:37:35 GMT
Erik Martino Hansen created SHIRO-472:
-----------------------------------------

             Summary: copy and createSubjectContext doesn't set the correct security manager
                 Key: SHIRO-472
                 URL: https://issues.apache.org/jira/browse/SHIRO-472
             Project: Shiro
          Issue Type: Bug
            Reporter: Erik Martino Hansen


It makes shiro rely too much on ThreadContext, this is a problem in web envirionments where
websocket packets tends to sneak around the installed filter. 

   public static void main(String[] args) {
        DefaultSecurityManager n = new DefaultSecurityManager();
        SecurityUtils.setSecurityManager(n);
        DefaultSecurityManager m = new DefaultSecurityManager();
        SubjectContext ct = m.createSubjectContext();
        if (m != ct.getSecurityManager()) {
            throw new AssertionError("createSubjectContext doesn't set the correct security
manager");
        }
        SubjectContext copy = m.copy(ct);
        if (m != copy.getSecurityManager()) {
            throw new AssertionError("copy doesn't set the correct security manager");
        }
    }




--
This message was sent by Atlassian JIRA
(v6.1#6144)

Mime
View raw message