geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From djen...@apache.org
Subject cvs commit: incubator-geronimo/modules/security/src/java/org/apache/geronimo/security/realm/providers AbstractSecurityRealm.java
Date Wed, 10 Mar 2004 19:21:17 GMT
djencks     2004/03/10 11:21:17

  Modified:    modules/connector/src/java/org/apache/geronimo/connector/deployment
                        AbstractRARConfigBuilder.java
                        RAR_1_5ConfigBuilder.java
               modules/connector/src/java/org/apache/geronimo/connector/outbound/security
                        PasswordCredentialRealm.java
               modules/connector/src/schema geronimo-connector_1_5.xsd
               modules/connector/src/test/org/apache/geronimo/connector/deployment
                        RAR_1_5ConfigBuilderTest.java
               modules/connector/src/test-data/connector_1_5
                        geronimo-ra.xml
               modules/security/src/java/org/apache/geronimo/security/realm/providers
                        AbstractSecurityRealm.java
  Log:
  Deploy appropriate login module when requested
  
  Revision  Changes    Path
  1.9       +2 -2      incubator-geronimo/modules/connector/src/java/org/apache/geronimo/connector/deployment/AbstractRARConfigBuilder.java
  
  Index: AbstractRARConfigBuilder.java
  ===================================================================
  RCS file: /home/cvs/incubator-geronimo/modules/connector/src/java/org/apache/geronimo/connector/deployment/AbstractRARConfigBuilder.java,v
  retrieving revision 1.8
  retrieving revision 1.9
  diff -u -r1.8 -r1.9
  --- AbstractRARConfigBuilder.java	10 Mar 2004 09:58:31 -0000	1.8
  +++ AbstractRARConfigBuilder.java	10 Mar 2004 19:21:17 -0000	1.9
  @@ -67,7 +67,7 @@
       public final static String BASE_RESOURCE_ADAPTER_NAME = "geronimo.management:J2eeType=ResourceAdapter,name=";
       protected final static String BASE_CONNECTION_MANAGER_FACTORY_NAME = "geronimo.management:J2eeType=ConnectionManager,name=";
       protected static final String BASE_REALM_BRIDGE_NAME = "geronimo.security:service=RealmBridge,name=";
  -    private static final String BASE_PASSWORD_CREDENTIAL_LOGIN_MODULE_NAME = "geronimo.security:service=Realm,type=PasswordCredential,name=";
  +    protected static final String BASE_PASSWORD_CREDENTIAL_LOGIN_MODULE_NAME = "geronimo.security:service=Realm,type=PasswordCredential,name=";
   
       protected final Repository repository;
       protected final Kernel kernel;
  
  
  
  1.7       +9 -6      incubator-geronimo/modules/connector/src/java/org/apache/geronimo/connector/deployment/RAR_1_5ConfigBuilder.java
  
  Index: RAR_1_5ConfigBuilder.java
  ===================================================================
  RCS file: /home/cvs/incubator-geronimo/modules/connector/src/java/org/apache/geronimo/connector/deployment/RAR_1_5ConfigBuilder.java,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- RAR_1_5ConfigBuilder.java	10 Mar 2004 09:58:31 -0000	1.6
  +++ RAR_1_5ConfigBuilder.java	10 Mar 2004 19:21:17 -0000	1.7
  @@ -32,12 +32,15 @@
   import javax.management.MalformedObjectNameException;
   import javax.management.ObjectName;
   import javax.management.ReflectionException;
  +import javax.resource.spi.security.PasswordCredential;
   
   import org.apache.geronimo.common.propertyeditor.PropertyEditors;
   import org.apache.geronimo.connector.AdminObjectWrapper;
   import org.apache.geronimo.connector.ResourceAdapterWrapper;
   import org.apache.geronimo.connector.outbound.ConnectionManagerDeployment;
   import org.apache.geronimo.connector.outbound.ManagedConnectionFactoryWrapper;
  +import org.apache.geronimo.connector.outbound.security.PasswordCredentialLoginModule;
  +import org.apache.geronimo.connector.outbound.security.PasswordCredentialRealm;
   import org.apache.geronimo.deployment.DeploymentContext;
   import org.apache.geronimo.deployment.DeploymentException;
   import org.apache.geronimo.deployment.util.UnclosableInputStream;
  @@ -203,12 +206,12 @@
                           managedConnectionFactoryGBean.setReferencePatterns("ResourceAdapterWrapper",
Collections.singleton(resourceAdapterObjectName));
                       }
                       managedConnectionFactoryGBean.setReferencePatterns("ConnectionManagerFactory",
Collections.singleton(connectionManagerFactoryObjectName));
  -                    /*
  -                    //TODO also set up the login module
  -                    if (geronimoConnectionDefinition.getAuthentication().equals("BasicUserPassword"))
{
  -                        managedConnectionFactoryGBean.setReferencePatterns("ManagedConnectionFactoryListener",
Collections.singleton(ObjectName.getInstance(BASE_PASSWORD_CREDENTIAL_LOGIN_MODULE_NAME +
geronimoConnectionDefinition.getName())));
  +                    if (connectionfactoryInstance.getCredentialInterface() != null &&
PasswordCredential.class.getName().equals(connectionfactoryInstance.getCredentialInterface().getStringValue()))
{
  +                        GBeanMBean realmGBean = new GBeanMBean(PasswordCredentialRealm.class.getName());
  +                        realmGBean.setAttribute("RealmName", BASE_PASSWORD_CREDENTIAL_LOGIN_MODULE_NAME
+ connectionfactoryInstance.getName());
  +                        context.addGBean(ObjectName.getInstance(BASE_PASSWORD_CREDENTIAL_LOGIN_MODULE_NAME
+ connectionfactoryInstance.getName()), realmGBean);
  +                        managedConnectionFactoryGBean.setReferencePatterns("ManagedConnectionFactoryListener",
Collections.singleton(ObjectName.getInstance(BASE_PASSWORD_CREDENTIAL_LOGIN_MODULE_NAME +
connectionfactoryInstance.getName())));
                       }
  -                    */
                       managedConnectionFactoryGBean.setReferencePatterns("Kernel", Collections.singleton(Kernel.KERNEL));
                       managedConnectionFactoryGBean.setAttribute("SelfName", managedConnectionFactoryObjectName);
                   } catch (Exception e) {
  
  
  
  1.6       +6 -1      incubator-geronimo/modules/connector/src/java/org/apache/geronimo/connector/outbound/security/PasswordCredentialRealm.java
  
  Index: PasswordCredentialRealm.java
  ===================================================================
  RCS file: /home/cvs/incubator-geronimo/modules/connector/src/java/org/apache/geronimo/connector/outbound/security/PasswordCredentialRealm.java,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- PasswordCredentialRealm.java	10 Mar 2004 09:58:33 -0000	1.5
  +++ PasswordCredentialRealm.java	10 Mar 2004 19:21:17 -0000	1.6
  @@ -44,6 +44,10 @@
   
       static final String REALM_INSTANCE = "org.apache.connector.outbound.security.PasswordCredentialRealm";
   
  +    public PasswordCredentialRealm(String realmName) {
  +        super(realmName);
  +    }
  +
       public Set getGroupPrincipals() throws GeronimoSecurityException {
           return null;
       }
  @@ -89,6 +93,7 @@
   
       static {
           GBeanInfoFactory infoFactory = new GBeanInfoFactory(PasswordCredentialRealm.class.getName(),
AbstractSecurityRealm.getGBeanInfo());
  +        infoFactory.addInterface(ManagedConnectionFactoryListener.class);
           GBEAN_INFO = infoFactory.getBeanInfo();
       }
   
  
  
  
  1.10      +8 -5      incubator-geronimo/modules/connector/src/schema/geronimo-connector_1_5.xsd
  
  Index: geronimo-connector_1_5.xsd
  ===================================================================
  RCS file: /home/cvs/incubator-geronimo/modules/connector/src/schema/geronimo-connector_1_5.xsd,v
  retrieving revision 1.9
  retrieving revision 1.10
  diff -u -r1.9 -r1.10
  --- geronimo-connector_1_5.xsd	10 Mar 2004 09:58:33 -0000	1.9
  +++ geronimo-connector_1_5.xsd	10 Mar 2004 19:21:17 -0000	1.10
  @@ -228,6 +228,9 @@
               <xsd:element name="global-jndi-name"
                   type="xsd:string"
                   minOccurs="0"/>
  +            <xsd:element name="credential-interface"
  +                type="ger:credential-interfaceType"
  +                minOccurs="0"/>
   
           </xsd:sequence>
       </xsd:complexType>
  @@ -284,11 +287,11 @@
       </xsd:complexType>
   
       <xsd:simpleType name="versionType">
  -      <xsd:restriction base="xsd:string">
  -        <xsd:whiteSpace value="collapse"/>
  -          <xsd:enumeration value="1.0"/>
  -          <xsd:enumeration value="1.5"/>
  -      </xsd:restriction>
  +        <xsd:restriction base="xsd:string">
  +            <xsd:whiteSpace value="collapse"/>
  +            <xsd:enumeration value="1.0"/>
  +            <xsd:enumeration value="1.5"/>
  +        </xsd:restriction>
       </xsd:simpleType>
       <!-- **************************************************** -->
   
  
  
  
  1.6       +2 -2      incubator-geronimo/modules/connector/src/test/org/apache/geronimo/connector/deployment/RAR_1_5ConfigBuilderTest.java
  
  Index: RAR_1_5ConfigBuilderTest.java
  ===================================================================
  RCS file: /home/cvs/incubator-geronimo/modules/connector/src/test/org/apache/geronimo/connector/deployment/RAR_1_5ConfigBuilderTest.java,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- RAR_1_5ConfigBuilderTest.java	10 Mar 2004 09:58:33 -0000	1.5
  +++ RAR_1_5ConfigBuilderTest.java	10 Mar 2004 19:21:17 -0000	1.6
  @@ -100,7 +100,7 @@
           } finally {
               kernel.shutdown();
           }
  -        assertEquals(9, gbeans.size());
  +        assertEquals(10, gbeans.size());
           //we could check what the gbeans are...
       }
   
  
  
  
  1.11      +1 -0      incubator-geronimo/modules/connector/src/test-data/connector_1_5/geronimo-ra.xml
  
  Index: geronimo-ra.xml
  ===================================================================
  RCS file: /home/cvs/incubator-geronimo/modules/connector/src/test-data/connector_1_5/geronimo-ra.xml,v
  retrieving revision 1.10
  retrieving revision 1.11
  diff -u -r1.10 -r1.11
  --- geronimo-ra.xml	10 Mar 2004 09:58:34 -0000	1.10
  +++ geronimo-ra.xml	10 Mar 2004 19:21:17 -0000	1.11
  @@ -41,6 +41,7 @@
                           <useSubject>true</useSubject>
                       </connectionmanager>
                       <global-jndi-name>connectionfactories/testcf</global-jndi-name>
  +                    <credential-interface>javax.resource.spi.security.PasswordCredential</credential-interface>
                   </connectiondefinition-instance>
                   <connectiondefinition-instance>
                       <name>SecondTestOutboundConnectionFactory</name>
  
  
  
  1.5       +2 -2      incubator-geronimo/modules/security/src/java/org/apache/geronimo/security/realm/providers/AbstractSecurityRealm.java
  
  Index: AbstractSecurityRealm.java
  ===================================================================
  RCS file: /home/cvs/incubator-geronimo/modules/security/src/java/org/apache/geronimo/security/realm/providers/AbstractSecurityRealm.java,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- AbstractSecurityRealm.java	10 Mar 2004 09:59:26 -0000	1.4
  +++ AbstractSecurityRealm.java	10 Mar 2004 19:21:17 -0000	1.5
  @@ -86,7 +86,7 @@
           infoFactory.addOperation(new GOperationInfo("getUserPrincipals", new String[]{RE.class.getName()}));
           infoFactory.addOperation(new GOperationInfo("refresh"));
           infoFactory.addOperation(new GOperationInfo("getAppConfigurationEntry"));
  -        infoFactory.setConstructor(new GConstructorInfo(new String[]{"realmName"}, new
Class[]{String.class}));
  +        infoFactory.setConstructor(new GConstructorInfo(new String[]{"RealmName"}, new
Class[]{String.class}));
           GBEAN_INFO = infoFactory.getBeanInfo();
       }
   
  
  
  

Mime
View raw message