Author: clebert.suconic(a)jboss.com
Date: 2012-02-01 11:07:27 -0500 (Wed, 01 Feb 2012)
New Revision: 12057
Removed:
branches/Branch_2_2_AS7/src/main/org/hornetq/integration/jboss/security/AS4SecurityActions.java
Modified:
branches/Branch_2_2_AS7/src/main/org/hornetq/integration/jboss/security/JBossASSecurityManager.java
branches/Branch_2_2_AS7/src/main/org/hornetq/service/JBossASSecurityManagerService.java
Log:
Removing AS4 dependency
Deleted:
branches/Branch_2_2_AS7/src/main/org/hornetq/integration/jboss/security/AS4SecurityActions.java
===================================================================
---
branches/Branch_2_2_AS7/src/main/org/hornetq/integration/jboss/security/AS4SecurityActions.java 2012-02-01
15:19:08 UTC (rev 12056)
+++
branches/Branch_2_2_AS7/src/main/org/hornetq/integration/jboss/security/AS4SecurityActions.java 2012-02-01
16:07:27 UTC (rev 12057)
@@ -1,126 +0,0 @@
-/*
- * Copyright 2009 Red Hat, Inc.
- * Red Hat licenses this file to you under the Apache License, version
- * 2.0 (the "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
http://www.apache.org/licenses/LICENSE-2.0
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
- * implied. See the License for the specific language governing
- * permissions and limitations under the License.
- */
-package org.hornetq.integration.jboss.security;
-
-import java.security.AccessController;
-import java.security.Principal;
-import java.security.PrivilegedAction;
-
-import javax.security.auth.Subject;
-
-import org.jboss.security.SecurityAssociation;
-
-/** A collection of privileged actions for this package
- * @author Scott.Stark(a)jboss.org
- * @author <a href="mailto:alex@jboss.org">Alexey Loubyansky</a>
- * @author <a href="mailto:tim.fox@jboss.com">Tim Fox</a>
- * @author <a href="mailto:anil.saldhana@jboss.com">anil
saldhana</a>
- * @version $Revison: 1.0$
- */
-
-/**
- * @author <a href="mailto:andy.taylor@jboss.org">Andy Taylor</a>
- * Created Oct 21, 2009
- */
-public class AS4SecurityActions
-{
- interface PrincipalInfoAction
- {
- PrincipalInfoAction PRIVILEGED = new PrincipalInfoAction()
- {
- public void push(final Principal principal, final Object credential, final
Subject subject)
- {
- AccessController.doPrivileged(new PrivilegedAction()
- {
- public Object run()
- {
- SecurityAssociation.pushSubjectContext(subject, principal,
credential);
- return null;
- }
- });
- }
-
- public void dup()
- {
- AccessController.doPrivileged(new PrivilegedAction()
- {
- public Object run()
- {
- SecurityAssociation.dupSubjectContext();
- return null;
- }
- });
- }
-
- public void pop()
- {
- AccessController.doPrivileged(new PrivilegedAction()
- {
- public Object run()
- {
- SecurityAssociation.popSubjectContext();
- return null;
- }
- });
- }
- };
-
- PrincipalInfoAction NON_PRIVILEGED = new PrincipalInfoAction()
- {
- public void push(final Principal principal, final Object credential, final
Subject subject)
- {
- SecurityAssociation.pushSubjectContext(subject, principal, credential);
- }
-
- public void dup()
- {
- SecurityAssociation.dupSubjectContext();
- }
-
- public void pop()
- {
- SecurityAssociation.popSubjectContext();
- }
- };
-
- void push(Principal principal, Object credential, Subject subject);
-
- void dup();
-
- void pop();
- }
-
- static void pushSubjectContext(final Principal principal, final Object credential,
final Subject subject)
- {
- if (System.getSecurityManager() == null)
- {
- PrincipalInfoAction.NON_PRIVILEGED.push(principal, credential, subject);
- }
- else
- {
- PrincipalInfoAction.PRIVILEGED.push(principal, credential, subject);
- }
- }
-
- static void popSubjectContext()
- {
- if (System.getSecurityManager() == null)
- {
- PrincipalInfoAction.NON_PRIVILEGED.pop();
- }
- else
- {
- PrincipalInfoAction.PRIVILEGED.pop();
- }
- }
-}
Modified:
branches/Branch_2_2_AS7/src/main/org/hornetq/integration/jboss/security/JBossASSecurityManager.java
===================================================================
---
branches/Branch_2_2_AS7/src/main/org/hornetq/integration/jboss/security/JBossASSecurityManager.java 2012-02-01
15:19:08 UTC (rev 12056)
+++
branches/Branch_2_2_AS7/src/main/org/hornetq/integration/jboss/security/JBossASSecurityManager.java 2012-02-01
16:07:27 UTC (rev 12057)
@@ -63,8 +63,6 @@
private boolean started;
- private boolean isAs5 = true;
-
private boolean allowClientLogin = false;
private boolean authoriseOnClientLogin = false;
@@ -183,26 +181,12 @@
private void popSecurityContext()
{
- if (isAs5)
- {
- SecurityActions.popSubjectContext();
- }
- else
- {
- AS4SecurityActions.popSubjectContext();
- }
+ SecurityActions.popSubjectContext();
}
private void pushSecurityContext(final SimplePrincipal principal, final char[]
passwordChars, final Subject subject)
{
- if (isAs5)
- {
- SecurityActions.pushSubjectContext(principal, passwordChars, subject,
securityDomainName);
- }
- else
- {
- AS4SecurityActions.pushSubjectContext(principal, passwordChars, subject);
- }
+ SecurityActions.pushSubjectContext(principal, passwordChars, subject,
securityDomainName);
}
public void addRole(final String user, final String role)
@@ -291,11 +275,6 @@
this.securityDomainName = securityDomainName;
}
- public void setAs5(final boolean as5)
- {
- isAs5 = as5;
- }
-
public void setAllowClientLogin(final boolean allowClientLogin)
{
this.allowClientLogin = allowClientLogin;
Modified:
branches/Branch_2_2_AS7/src/main/org/hornetq/service/JBossASSecurityManagerService.java
===================================================================
---
branches/Branch_2_2_AS7/src/main/org/hornetq/service/JBossASSecurityManagerService.java 2012-02-01
15:19:08 UTC (rev 12056)
+++
branches/Branch_2_2_AS7/src/main/org/hornetq/service/JBossASSecurityManagerService.java 2012-02-01
16:07:27 UTC (rev 12057)
@@ -25,7 +25,6 @@
public void create()
{
jBossASSecurityManager = new JBossASSecurityManager();
- jBossASSecurityManager.setAs5(false);
}
public JBossASSecurityManager getJBossASSecurityManager()