Author: anil.saldhana(a)jboss.com
Date: 2009-02-13 18:28:06 -0500 (Fri, 13 Feb 2009)
New Revision: 317
Removed:
identity-federation/trunk/identity-bindings/src/main/java/org/jboss/identity/federation/bindings/jboss/DefaultJBossSubjectRegistration.java
identity-federation/trunk/identity-bindings/src/main/java/org/jboss/identity/federation/bindings/jboss/JBossSubjectRegistration.java
identity-federation/trunk/identity-bindings/src/main/java/org/jboss/identity/federation/bindings/jboss/SecurityActions.java
Log:
delete jboss specific code as integration code for jboss is in a new module
Deleted:
identity-federation/trunk/identity-bindings/src/main/java/org/jboss/identity/federation/bindings/jboss/DefaultJBossSubjectRegistration.java
===================================================================
---
identity-federation/trunk/identity-bindings/src/main/java/org/jboss/identity/federation/bindings/jboss/DefaultJBossSubjectRegistration.java 2009-02-13
21:07:24 UTC (rev 316)
+++
identity-federation/trunk/identity-bindings/src/main/java/org/jboss/identity/federation/bindings/jboss/DefaultJBossSubjectRegistration.java 2009-02-13
23:28:06 UTC (rev 317)
@@ -1,73 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * Copyright 2008, Red Hat Middleware LLC, and individual contributors
- * as indicated by the @author tags. See the copyright.txt file in the
- * distribution for a full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
- */
-package org.jboss.identity.federation.bindings.jboss;
-
-import java.lang.reflect.Method;
-import java.security.acl.Group;
-
-import javax.security.auth.Subject;
-
-import org.apache.catalina.realm.GenericPrincipal;
-import org.apache.log4j.Logger;
-import org.jboss.identity.federation.bindings.jboss.subject.JBossIdentityGroup;
-import org.jboss.identity.federation.bindings.jboss.subject.JBossIdentityPrincipal;
-
-/**
- * @author Anil.Saldhana(a)redhat.com
- * @since Jan 16, 2009
- */
-public class DefaultJBossSubjectRegistration implements JBossSubjectRegistration
-{
- protected Logger log = Logger.getLogger(DefaultJBossSubjectRegistration.class);
-
- public void register(GenericPrincipal principal)
- {
- String sa = "org.jboss.security.SecurityAssociation";
- try
- {
- Class<?> securityAssociationClass =
SecurityActions.getContextClassLoader().loadClass(sa);
- Method m = securityAssociationClass.getDeclaredMethod("setSubject",
new Class[] {Subject.class});
- Subject subject = this.getJBossSubjectFromTomcatPrincipal(principal);
- m.invoke(null, subject);
- }
- catch(Exception e)
- {
- log.trace("Not a JBoss environment. So not registering in
SecurityAssociation");
- }
- }
-
- private Subject getJBossSubjectFromTomcatPrincipal(GenericPrincipal principal)
- {
- Subject subject = new Subject();
- String[] roles = principal.getRoles();
-
- subject.getPrincipals().add(new JBossIdentityPrincipal(principal.getName()));
-
- Group roleGroup = new JBossIdentityGroup("Roles");
- for(String role: roles)
- {
- roleGroup.addMember(new JBossIdentityPrincipal(role));
- }
-
- return subject;
- }
-}
\ No newline at end of file
Deleted:
identity-federation/trunk/identity-bindings/src/main/java/org/jboss/identity/federation/bindings/jboss/JBossSubjectRegistration.java
===================================================================
---
identity-federation/trunk/identity-bindings/src/main/java/org/jboss/identity/federation/bindings/jboss/JBossSubjectRegistration.java 2009-02-13
21:07:24 UTC (rev 316)
+++
identity-federation/trunk/identity-bindings/src/main/java/org/jboss/identity/federation/bindings/jboss/JBossSubjectRegistration.java 2009-02-13
23:28:06 UTC (rev 317)
@@ -1,39 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * Copyright 2008, Red Hat Middleware LLC, and individual contributors
- * as indicated by the @author tags. See the copyright.txt file in the
- * distribution for a full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
- */
-package org.jboss.identity.federation.bindings.jboss;
-
-import org.apache.catalina.realm.GenericPrincipal;
-
-/**
- * Register Tomcat Principal/Roles with the JBoss Setup.
- * Mainly for propagation of identity to other containers.
- * @author Anil.Saldhana(a)redhat.com
- * @since Jan 16, 2009
- */
-public interface JBossSubjectRegistration
-{
- /**
- * Register the Tomcat Principal
- * @param principal
- */
- void register(GenericPrincipal principal);
-}
\ No newline at end of file
Deleted:
identity-federation/trunk/identity-bindings/src/main/java/org/jboss/identity/federation/bindings/jboss/SecurityActions.java
===================================================================
---
identity-federation/trunk/identity-bindings/src/main/java/org/jboss/identity/federation/bindings/jboss/SecurityActions.java 2009-02-13
21:07:24 UTC (rev 316)
+++
identity-federation/trunk/identity-bindings/src/main/java/org/jboss/identity/federation/bindings/jboss/SecurityActions.java 2009-02-13
23:28:06 UTC (rev 317)
@@ -1,48 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * Copyright 2008, Red Hat Middleware LLC, and individual contributors
- * as indicated by the @author tags. See the copyright.txt file in the
- * distribution for a full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
- */
-package org.jboss.identity.federation.bindings.jboss;
-
-import java.security.AccessController;
-import java.security.PrivilegedAction;
-
-/**
- * Privileged Blocks
- * @author Anil.Saldhana(a)redhat.com
- * @since Dec 9, 2008
- */
-class SecurityActions
-{
- /**
- * Get the Thread Context ClassLoader
- * @return
- */
- static ClassLoader getContextClassLoader()
- {
- return AccessController.doPrivileged(new PrivilegedAction<ClassLoader>()
- {
- public ClassLoader run()
- {
- return Thread.currentThread().getContextClassLoader();
- }
- });
- }
-}