Uploaded image for project: 'Shiro'
  1. Shiro
  2. SHIRO-472

copy and createSubjectContext doesn't set the correct security manager

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Open
    • Priority: Major
    • Resolution: Unresolved
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: None
    • Labels:
      None

      Description

      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;
      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"); }

      }

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              xylifyx Erik Martino Hansen
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated: