You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jetspeed-dev@portals.apache.org by dl...@apache.org on 2005/07/28 05:00:42 UTC
svn commit: r225674 - in /portals/jetspeed-2/trunk: ./
app-servers/security/jboss/ app-servers/security/jboss/src/java/META-INF/
app-servers/security/jboss/src/java/META-INF/jboss-secsvc/
app-servers/security/jboss/src/java/org/apache/jetspeed/appserve...
Author: dlestrat
Date: Wed Jul 27 20:00:31 2005
New Revision: 225674
URL: http://svn.apache.org/viewcvs?rev=225674&view=rev
Log:
http://issues.apache.org/jira/browse/JS2-297#action_12317010
Added:
portals/jetspeed-2/trunk/app-servers/security/jboss/src/java/org/apache/jetspeed/appservers/security/jboss/JdbcMetadataUtils.java
portals/jetspeed-2/trunk/app-servers/security/jboss/src/java/org/apache/jetspeed/appservers/security/jboss/LoginModule.java
portals/jetspeed-2/trunk/components/security/src/java/META-INF/ojb/security_repository.xml
- copied unchanged from r225637, portals/jetspeed-2/trunk/components/security/src/java/META-INF/security_repository.xml
Modified:
portals/jetspeed-2/trunk/.classpath
portals/jetspeed-2/trunk/app-servers/security/jboss/maven.xml
portals/jetspeed-2/trunk/app-servers/security/jboss/src/java/META-INF/jboss-secsvc/jboss-security-service.xml
portals/jetspeed-2/trunk/app-servers/security/jboss/src/java/META-INF/jboss-service.xml
portals/jetspeed-2/trunk/app-servers/security/jboss/src/java/org/apache/jetspeed/appservers/security/jboss/JetspeedSecurityService.java
portals/jetspeed-2/trunk/app-servers/security/jboss/src/java/org/apache/jetspeed/appservers/security/jboss/JetspeedSecurityServiceMBean.java
portals/jetspeed-2/trunk/components/portal/project.xml
portals/jetspeed-2/trunk/components/security/project.xml
portals/jetspeed-2/trunk/components/security/src/java/org/apache/jetspeed/security/util/test/AbstractSecurityTestcase.java
portals/jetspeed-2/trunk/components/security/src/test/org/apache/jetspeed/security/spi/TestCredentialHandler.java
portals/jetspeed-2/trunk/maven-plugin/plugin.jelly
portals/jetspeed-2/trunk/portal-webapp/src/webapp/WEB-INF/assembly/security-spi.xml
Modified: portals/jetspeed-2/trunk/.classpath
URL: http://svn.apache.org/viewcvs/portals/jetspeed-2/trunk/.classpath?rev=225674&r1=225673&r2=225674&view=diff
==============================================================================
--- portals/jetspeed-2/trunk/.classpath (original)
+++ portals/jetspeed-2/trunk/.classpath Wed Jul 27 20:00:31 2005
@@ -52,6 +52,7 @@
<classpathentry excluding="**/.svn/*" kind="src" path="content-server/src/java"/>
<classpathentry excluding="**/.svn/*" kind="src" path="layout-portlets/src/java"/>
<classpathentry excluding="**/.svn/*" kind="src" path="taglibs/treecontrol/src/java"/>
+ <classpathentry excluding="**/.svn/*" kind="src" path="app-servers/security/jboss/src/java"/>
<classpathentry excluding="**/.svn/*" kind="src" path="applications/demo/src/java"/>
<classpathentry excluding="**/.svn/*" kind="src" path="applications/gems/src/java"/>
<classpathentry excluding="**/.svn/*|log4j.properties" kind="src" path="applications/jpetstore/src/java"/>
@@ -113,5 +114,6 @@
<classpathentry kind="var" path="MAVEN_REPO/cglib/jars/cglib-full-2.0.2.jar"/>
<classpathentry kind="var" path="MAVEN_REPO/springframework/jars/spring-1.1.5.jar"/>
<classpathentry kind="var" path="MAVEN_REPO/commons-fileupload/jars/commons-fileupload-1.0.jar"/>
+ <classpathentry kind="var" path="MAVEN_REPO/jmx/jars/jmxri-1.2.1.jar"/>
<classpathentry kind="output" path="bin"/>
</classpath>
Modified: portals/jetspeed-2/trunk/app-servers/security/jboss/maven.xml
URL: http://svn.apache.org/viewcvs/portals/jetspeed-2/trunk/app-servers/security/jboss/maven.xml?rev=225674&r1=225673&r2=225674&view=diff
==============================================================================
--- portals/jetspeed-2/trunk/app-servers/security/jboss/maven.xml (original)
+++ portals/jetspeed-2/trunk/app-servers/security/jboss/maven.xml Wed Jul 27 20:00:31 2005
@@ -1,197 +1,165 @@
-<!--
-Copyright 2004 The Apache Software Foundation
-
-Licensed 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.
--->
-<project default="sar:sar"
- xmlns:j="jelly:core"
- xmlns:ant="jelly:ant"
- xmlns:license="license"
- xmlns:define="jelly:define"
- xmlns:util="jelly:util"
- xmlns:maven="jelly:maven">
-
- <goal name="ojb.set.production.database.platform">
- <copy todir="${maven.build.dest}" overwrite="true">
- <fileset dir="etc"/>
- <filterset begintoken="@" endtoken="@">
- <filter token="PLATFORM"
- value="${org.apache.jetspeed.production.database.ojb.platform}"/>
- </filterset>
- </copy>
- </goal>
-
- <preGoal name="sar:sar">
- <attainGoal name="ojb.set.production.database.platform"/>
- </preGoal>
-
- <goal name="sar:sar"
- description="Create the deliverable jar file."
- prereqs="test:test">
-
- <j:choose>
- <j:when test="${pom.currentVersion == null}">
- <ant:fail>You must define currentVersion in your POM.</ant:fail>
- </j:when>
- </j:choose>
-
- <ant:available property="maven.jar.manifest.available"
- file="${maven.jar.manifest}"/>
-
- <j:set var="specificationTitle" value="${pom.shortDescription.trim()}"/>
- <j:if test="${specificationTitle.length() gt 49}">
- <ant:echo>Warning: shortDescription is greater than 49 characters - trimming for specification title.</ant:echo>
- <j:set var="specificationTitle" value="${specificationTitle.substring(0,46)}..."/>
- </j:if>
-
- <j:forEach var="lib" items="${pom.artifacts}">
- <j:set var="dep" value="${lib.dependency}"/>
- <j:choose>
- <j:when test="${dep.artifactId == 'jetspeed-security'}">
- <!-- *.xml files in META-INF prevent deployment in JBoss -->
- <ant:delete dir="${maven.build.dir}/tmp"/>
- <ant:unzip src="${lib.path}" dest="${maven.build.dir}/tmp"/>
- <ant:zip destfile="${maven.build.dest}/${lib.name}"
- basedir="${maven.build.dir}/tmp"
- excludes="META-INF/*.xml"/>
- <ant:mkdir dir="${maven.build.dest}/META-INF"/>
- <ant:copy todir="${maven.build.dest}/META-INF">
- <ant:fileset dir="${maven.build.dir}/tmp/META-INF"
- includes="security_repository.xml"/>
- </ant:copy>
- <ant:delete dir="${maven.build.dir}/tmp"/>
- </j:when>
- <j:when test="${dep.getProperty('sar.bundle')=='true'}">
- <ant:copy todir="${maven.build.dest}" file="${lib.path}"/>
- </j:when>
- </j:choose>
- </j:forEach>
-
- <!-- See http://java.sun.com/j2se/1.3/docs/guide/jar/jar.html -->
- <!-- See http://java.sun.com/j2se/1.4.1/docs/guide/jar/jar.html -->
- <ant:jar
- jarfile="${maven.build.dir}/${maven.final.name}.sar"
- basedir="${maven.build.dest}"
- index="${maven.jar.index}"
- compress="${maven.jar.compress}"
- excludes="${maven.jar.excludes}">
-
- <j:if test="${maven.jar.manifest.available}">
- <ant:setProperty name="manifest" value="${maven.jar.manifest}" />
- </j:if>
-
- <j:if test="${context.getVariable('maven.jar.includes') != null}">
- <ant:setProperty name="includes" value="${maven.jar.includes}" />
- </j:if>
-
- <j:set var="licenseFileName"><license:fileName/></j:set>
- <util:file name="${licenseFileName}" var="licenseFile"/>
- <ant:metainf dir="${licenseFile.canonicalFile.parent}">
- <ant:include name="${licenseFile.canonicalFile.name}"/>
- </ant:metainf>
- <ant:manifest>
- <ant:attribute name="Built-By" value="${user.name}"/>
- <ant:attribute name="Created-By" value="Apache Jakarta Maven"/>
- <ant:attribute name="Package" value="${pom.package}"/>
- <ant:attribute name="Build-Jdk" value="${java.version}"/>
-
- <j:set var="jarClasspath" value="${maven.jar.manifest.classpath.add}"/>
- <j:if test="${jarClasspath}">
- <j:forEach var="dep" items="${pom.dependencies}">
- <j:if test="${dep.getProperty('jar.manifest.classpath')=='true'}">
- <j:set var="maven.jar.classpath" value="${maven.jar.classpath} ${dep.artifact}" />
- </j:if>
- </j:forEach>
- <j:if test="${maven.jar.classpath.length() != 0}">
- <ant:attribute name="Class-Path" value="${maven.jar.classpath}"/>
- </j:if>
- </j:if>
- <!-- added supplementary entries -->
- <ant:attribute name="Extension-Name" value="${pom.artifactId}"/>
- <ant:attribute name="Specification-Title" value="${specificationTitle}" />
- <ant:attribute name="Specification-Vendor" value="${pom.organization.name}"/>
- <!--
- <ant:attribute name="Specification-Version" value="${pom.currentVersion}"/>
- -->
- <ant:attribute name="Implementation-Title" value="${pom.package}"/>
- <ant:attribute name="Implementation-Vendor" value="${pom.organization.name}"/>
- <ant:attribute name="Implementation-Version" value="${pom.currentVersion}"/>
- <j:set var="mainclass" value="${maven.jar.mainclass}" />
- <j:if test="${!empty(mainclass)}">
- <ant:attribute name="Main-Class" value="${mainclass}"/>
- </j:if>
-
- <j:set var="jarExtensions" value="${maven.jar.manifest.extensions.add}"/>
- <j:if test="${jarExtensions == 'true'}">
- <j:set var="extensionList" value=""/>
- <j:forEach var="artifact" items="${pom.artifacts}">
- <j:set var="dep" value="${artifact.dependency}"/>
- <j:if test="${dep.type == 'jar' || empty(dep.type)}">
- <j:set var="extensionList" value="${extensionList} ${dep.artifactId}"/>
- </j:if>
- </j:forEach>
-
- <j:if test="${extensionList.length() != 0}">
- <j:set var="extensionList" value="${extensionList.substring(1)}"/>
- <ant:attribute name="Extension-List" value="${extensionList}"/>
- </j:if>
-
- <j:forEach var="artifact" items="${pom.artifacts}">
- <j:set var="dep" value="${artifact.dependency}"/>
- <j:if test="${dep.type == 'jar' || empty(dep.type)}">
- <ant:attribute name="${dep.artifactId}-Extension-Name" value="${dep.artifactId}"/>
- <ant:attribute name="${dep.artifactId}-Implementation-Version" value="${dep.version}"/>
-
- <j:choose>
- <j:when test="${empty(dep.url) || dep.url.toString().trim().length() == 0}">
- <ant:attribute name="${dep.artifactId}-Implementation-URL" value="http://www.ibiblio.org/maven${artifact.urlPath}"/>
- </j:when>
- <j:otherwise>
- <ant:attribute name="${dep.artifactId}-Implementation-URL" value="${dep.url}"/>
- </j:otherwise>
- </j:choose>
- </j:if>
- </j:forEach>
- </j:if>
-
- <j:if test="${context.getVariable('maven.jar.manifest.attributes.list') != null}">
- <util:tokenize var="attributeList" delim="," trim="true">${maven.jar.manifest.attributes.list}</util:tokenize>
- <j:forEach var="attribute" items="${attributeList}">
- <j:set var="name" value="maven.jar.manifest.attribute.${attribute}"/>
- <j:set var="value" value="${context.findVariable(name)}"/>
- <ant:attribute name="${attribute}" value="${value}"/>
- </j:forEach>
- </j:if>
-
- <j:if test="${context.getVariable('maven.jar.manifest.groups.list') != null}">
- <util:tokenize var="groupList" delim="," trim="true">${maven.jar.manifest.groups.list}</util:tokenize>
- <j:forEach var="group" items="${groupList}">
- <j:set var="nameVar" value="maven.jar.manifest.${group}.name"/>
- <j:set var="groupName" value="${context.findVariable(nameVar)}"/>
- <j:set var="attributeListVar" value="maven.jar.manifest.${group}.attributes.list"/>
- <j:set var="groupAttributes" value="${context.findVariable(attributeListVar)}"/>
- <util:tokenize var="attributeList" delim="," trim="true">${groupAttributes}</util:tokenize>
- <ant:section name="${groupName}">
- <j:forEach var="attribute" items="${attributeList}">
- <j:set var="name" value="maven.jar.manifest.${group}.attribute.${attribute}"/>
- <j:set var="value" value="${context.findVariable(name)}"/>
- <ant:attribute name="${attribute}" value="${value}"/>
- </j:forEach>
- </ant:section>
- </j:forEach>
- </j:if>
- </ant:manifest>
- </ant:jar>
- </goal>
-
-</project>
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+Copyright 2004 The Apache Software Foundation
+
+Licensed 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.
+-->
+<project default="sar:sar" xmlns:j="jelly:core" xmlns:ant="jelly:ant" xmlns:license="license" xmlns:define="jelly:define" xmlns:util="jelly:util" xmlns:maven="jelly:maven">
+
+ <goal name="sar:sar" description="Create the deliverable jar file." prereqs="test:test">
+
+ <copy todir="${maven.build.dest}/classes/META-INF/jboss-secsvc" overwrite="true">
+ <fileset dir="../../../portal-webapp/src/webapp/WEB-INF/assembly">
+ <include name="security-providers.xml" />
+ <include name="security-spi.xml" />
+ <include name="transaction.xml" />
+ </fileset>
+ </copy>
+
+ <j:choose>
+ <j:when test="${pom.currentVersion == null}">
+ <ant:fail>You must define currentVersion in your POM.</ant:fail>
+ </j:when>
+ </j:choose>
+
+ <ant:available property="maven.jar.manifest.available" file="${maven.jar.manifest}" />
+
+ <j:set var="specificationTitle" value="${pom.shortDescription.trim()}" />
+ <j:if test="${specificationTitle.length() gt 49}">
+ <ant:echo>Warning: shortDescription is greater than 49 characters - trimming for specification title.</ant:echo>
+ <j:set var="specificationTitle" value="${specificationTitle.substring(0,46)}..." />
+ </j:if>
+
+ <j:forEach var="lib" items="${pom.artifacts}">
+ <j:set var="dep" value="${lib.dependency}" />
+ <j:choose>
+ <j:when test="${dep.getProperty('sar.bundle')=='true'}">
+ <ant:copy todir="${maven.build.dest}" file="${lib.path}" />
+ </j:when>
+ </j:choose>
+ </j:forEach>
+
+ <!-- See http://java.sun.com/j2se/1.3/docs/guide/jar/jar.html -->
+ <!-- See http://java.sun.com/j2se/1.4.1/docs/guide/jar/jar.html -->
+ <ant:jar jarfile="${maven.build.dir}/${maven.final.name}.sar" basedir="${maven.build.dest}" index="${maven.jar.index}" compress="${maven.jar.compress}" excludes="${maven.jar.excludes}">
+ <j:if test="${maven.jar.manifest.available}">
+ <ant:setProperty name="manifest" value="${maven.jar.manifest}" />
+ </j:if>
+
+ <j:if test="${context.getVariable('maven.jar.includes') != null}">
+ <ant:setProperty name="includes" value="${maven.jar.includes}" />
+ </j:if>
+
+ <j:set var="licenseFileName">
+ <license:fileName />
+ </j:set>
+ <util:file name="${licenseFileName}" var="licenseFile" />
+ <ant:metainf dir="${licenseFile.canonicalFile.parent}">
+ <ant:include name="${licenseFile.canonicalFile.name}" />
+ </ant:metainf>
+ <ant:manifest>
+ <ant:attribute name="Built-By" value="${user.name}" />
+ <ant:attribute name="Created-By" value="Apache Jakarta Maven" />
+ <ant:attribute name="Package" value="${pom.package}" />
+ <ant:attribute name="Build-Jdk" value="${java.version}" />
+
+ <j:set var="jarClasspath" value="${maven.jar.manifest.classpath.add}" />
+ <j:if test="${jarClasspath}">
+ <j:forEach var="dep" items="${pom.dependencies}">
+ <j:if test="${dep.getProperty('jar.manifest.classpath')=='true'}">
+ <j:set var="maven.jar.classpath" value="${maven.jar.classpath} ${dep.artifact}" />
+ </j:if>
+ </j:forEach>
+ <j:if test="${maven.jar.classpath.length() != 0}">
+ <ant:attribute name="Class-Path" value="${maven.jar.classpath}" />
+ </j:if>
+ </j:if>
+ <!-- added supplementary entries -->
+ <ant:attribute name="Extension-Name" value="${pom.artifactId}" />
+ <ant:attribute name="Specification-Title" value="${specificationTitle}" />
+ <ant:attribute name="Specification-Vendor" value="${pom.organization.name}" />
+ <!--
+ <ant:attribute name="Specification-Version" value="${pom.currentVersion}"/>
+ -->
+ <ant:attribute name="Implementation-Title" value="${pom.package}" />
+ <ant:attribute name="Implementation-Vendor" value="${pom.organization.name}" />
+ <ant:attribute name="Implementation-Version" value="${pom.currentVersion}" />
+ <j:set var="mainclass" value="${maven.jar.mainclass}" />
+ <j:if test="${!empty(mainclass)}">
+ <ant:attribute name="Main-Class" value="${mainclass}" />
+ </j:if>
+
+ <j:set var="jarExtensions" value="${maven.jar.manifest.extensions.add}" />
+ <j:if test="${jarExtensions == 'true'}">
+ <j:set var="extensionList" value="" />
+ <j:forEach var="artifact" items="${pom.artifacts}">
+ <j:set var="dep" value="${artifact.dependency}" />
+ <j:if test="${dep.type == 'jar' || empty(dep.type)}">
+ <j:set var="extensionList" value="${extensionList} ${dep.artifactId}" />
+ </j:if>
+ </j:forEach>
+
+ <j:if test="${extensionList.length() != 0}">
+ <j:set var="extensionList" value="${extensionList.substring(1)}" />
+ <ant:attribute name="Extension-List" value="${extensionList}" />
+ </j:if>
+
+ <j:forEach var="artifact" items="${pom.artifacts}">
+ <j:set var="dep" value="${artifact.dependency}" />
+ <j:if test="${dep.type == 'jar' || empty(dep.type)}">
+ <ant:attribute name="${dep.artifactId}-Extension-Name" value="${dep.artifactId}" />
+ <ant:attribute name="${dep.artifactId}-Implementation-Version" value="${dep.version}" />
+
+ <j:choose>
+ <j:when test="${empty(dep.url) || dep.url.toString().trim().length() == 0}">
+ <ant:attribute name="${dep.artifactId}-Implementation-URL" value="http://www.ibiblio.org/maven${artifact.urlPath}" />
+ </j:when>
+ <j:otherwise>
+ <ant:attribute name="${dep.artifactId}-Implementation-URL" value="${dep.url}" />
+ </j:otherwise>
+ </j:choose>
+ </j:if>
+ </j:forEach>
+ </j:if>
+
+ <j:if test="${context.getVariable('maven.jar.manifest.attributes.list') != null}">
+ <util:tokenize var="attributeList" delim="," trim="true">${maven.jar.manifest.attributes.list}</util:tokenize>
+ <j:forEach var="attribute" items="${attributeList}">
+ <j:set var="name" value="maven.jar.manifest.attribute.${attribute}" />
+ <j:set var="value" value="${context.findVariable(name)}" />
+ <ant:attribute name="${attribute}" value="${value}" />
+ </j:forEach>
+ </j:if>
+
+ <j:if test="${context.getVariable('maven.jar.manifest.groups.list') != null}">
+ <util:tokenize var="groupList" delim="," trim="true">${maven.jar.manifest.groups.list}</util:tokenize>
+ <j:forEach var="group" items="${groupList}">
+ <j:set var="nameVar" value="maven.jar.manifest.${group}.name" />
+ <j:set var="groupName" value="${context.findVariable(nameVar)}" />
+ <j:set var="attributeListVar" value="maven.jar.manifest.${group}.attributes.list" />
+ <j:set var="groupAttributes" value="${context.findVariable(attributeListVar)}" />
+ <util:tokenize var="attributeList" delim="," trim="true">${groupAttributes}</util:tokenize>
+ <ant:section name="${groupName}">
+ <j:forEach var="attribute" items="${attributeList}">
+ <j:set var="name" value="maven.jar.manifest.${group}.attribute.${attribute}" />
+ <j:set var="value" value="${context.findVariable(name)}" />
+ <ant:attribute name="${attribute}" value="${value}" />
+ </j:forEach>
+ </ant:section>
+ </j:forEach>
+ </j:if>
+ </ant:manifest>
+ </ant:jar>
+ </goal>
+
+</project>
\ No newline at end of file
Modified: portals/jetspeed-2/trunk/app-servers/security/jboss/src/java/META-INF/jboss-secsvc/jboss-security-service.xml
URL: http://svn.apache.org/viewcvs/portals/jetspeed-2/trunk/app-servers/security/jboss/src/java/META-INF/jboss-secsvc/jboss-security-service.xml?rev=225674&r1=225673&r2=225674&view=diff
==============================================================================
--- portals/jetspeed-2/trunk/app-servers/security/jboss/src/java/META-INF/jboss-secsvc/jboss-security-service.xml (original)
+++ portals/jetspeed-2/trunk/app-servers/security/jboss/src/java/META-INF/jboss-secsvc/jboss-security-service.xml Wed Jul 27 20:00:31 2005
@@ -1,43 +1,33 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN//EN" "http://www.springframework.org/dtd/spring-beans.dtd">
<!--
-Copyright 2004 The Apache Software Foundation
-
-Licensed 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
-
+ Copyright 2004 The Apache Software Foundation
+
+ Licensed 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.
+
+ 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.
-->
<beans>
- <import resource="security-atz.xml"/>
- <import resource="security-managers.xml"/>
- <import resource="security-providers.xml"/>
- <import resource="security-spi-atn.xml"/>
- <import resource="security-spi-atz.xml"/>
- <import resource="security-spi.xml"/>
- <import resource="transaction.xml"/>
-
- <!-- Security: User Manager -->
- <bean id="org.apache.jetspeed.security.UserManager"
- class="org.apache.jetspeed.security.impl.UserManagerImpl"
- >
- <constructor-arg ><ref bean="org.apache.jetspeed.security.SecurityProvider"/></constructor-arg>
- </bean>
-
- <!-- ************** Login Module ************** -->
- <!-- Security: Login Module Proxy -->
- <bean id="org.apache.jetspeed.security.LoginModuleProxy"
- class="org.apache.jetspeed.security.impl.LoginModuleProxyImpl"
- >
- <constructor-arg ><ref bean="org.apache.jetspeed.security.UserManager"/></constructor-arg>
- </bean>
+ <import resource="security-providers.xml" />
+ <import resource="security-spi-atn.xml" />
+ <import resource="security-spi-atz.xml" />
+ <import resource="security-spi.xml" />
+ <import resource="transaction.xml" />
+
+ <!-- Security: User Manager -->
+ <bean id="org.apache.jetspeed.security.UserManager" class="org.apache.jetspeed.security.impl.UserManagerImpl">
+ <constructor-arg>
+ <ref bean="org.apache.jetspeed.security.SecurityProvider" />
+ </constructor-arg>
+ </bean>
-</beans>
+</beans>
\ No newline at end of file
Modified: portals/jetspeed-2/trunk/app-servers/security/jboss/src/java/META-INF/jboss-service.xml
URL: http://svn.apache.org/viewcvs/portals/jetspeed-2/trunk/app-servers/security/jboss/src/java/META-INF/jboss-service.xml?rev=225674&r1=225673&r2=225674&view=diff
==============================================================================
--- portals/jetspeed-2/trunk/app-servers/security/jboss/src/java/META-INF/jboss-service.xml (original)
+++ portals/jetspeed-2/trunk/app-servers/security/jboss/src/java/META-INF/jboss-service.xml Wed Jul 27 20:00:31 2005
@@ -1,27 +1,24 @@
<?xml version="1.0" encoding="ISO-8859-1"?>
<!--
-Copyright 2004 The Apache Software Foundation
-
-Licensed 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
-
+ Copyright 2004 The Apache Software Foundation
+
+ Licensed 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.
+
+ 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.
-->
<server>
- <mbean code="org.apache.jetspeed.appservers.security.jboss.JetspeedSecurityService"
- name="org.apache.jetspeed:service=JetspeedSecurityService">
- <!--
- <attribute name="DirectoryEJBName">@@@_Utility-EJBs_EJBTimerDirectoryEJB_JNDI_Name_@@@</attribute>
- -->
- </mbean>
+ <mbean code="org.apache.jetspeed.appservers.security.jboss.JetspeedSecurityService" name="org.apache.jetspeed:service=JetspeedSecurityService">
+ <attribute name="DataSourceJndiName">java:/DefaultDS</attribute>
+ </mbean>
</server>
Added: portals/jetspeed-2/trunk/app-servers/security/jboss/src/java/org/apache/jetspeed/appservers/security/jboss/JdbcMetadataUtils.java
URL: http://svn.apache.org/viewcvs/portals/jetspeed-2/trunk/app-servers/security/jboss/src/java/org/apache/jetspeed/appservers/security/jboss/JdbcMetadataUtils.java?rev=225674&view=auto
==============================================================================
--- portals/jetspeed-2/trunk/app-servers/security/jboss/src/java/org/apache/jetspeed/appservers/security/jboss/JdbcMetadataUtils.java (added)
+++ portals/jetspeed-2/trunk/app-servers/security/jboss/src/java/org/apache/jetspeed/appservers/security/jboss/JdbcMetadataUtils.java Wed Jul 27 20:00:31 2005
@@ -0,0 +1,482 @@
+/* Copyright 2002-2004 The Apache Software Foundation
+ *
+ * Licensed 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.
+ */
+
+/*
+ * TODO: Copied here because db-ojb 1.0.1 used by Jetspeed2 does not provide
+ * this. May be replaved when Jetspeed2 updates OJB.
+ */
+
+package org.apache.jetspeed.appservers.security.jboss;
+
+import java.sql.Connection;
+import java.sql.DatabaseMetaData;
+import java.sql.SQLException;
+import java.util.HashMap;
+
+import javax.sql.DataSource;
+import org.apache.commons.beanutils.PropertyUtils;
+import org.apache.ojb.broker.metadata.JdbcConnectionDescriptor;
+import org.apache.ojb.broker.metadata.MetadataException;
+
+/**
+ * This class provides some utility functions to OJB for working with JDBC metadata.
+ *
+ * @author <a href="mailto:tomdz@apache.org">Thomas Dudziak</a>
+ */
+public class JdbcMetadataUtils
+{
+ /**
+ * The name of the property returned by the {@link #splitConnectionUrl(String)} method that contains the protocol
+ */
+ public static final String PROPERTY_PROTOCOL = "protocol";
+
+ /**
+ * The name of the property returned by the {@link #splitConnectionUrl(String)} method that contains the sub
+ * protocol
+ */
+ public static final String PROPERTY_SUBPROTOCOL = "subprotocol";
+
+ /**
+ * The name of the property returned by the {@link #splitConnectionUrl(String)} method that contains the database
+ * alias (the actual database url)
+ */
+ public static final String PROPERTY_DBALIAS = "dbAlias";
+
+ /** Identifier for the DB2 platform */
+ public static final String PLATFORM_DB2 = "Db2";
+
+ /** Identifier for the Firebird platform */
+ public static final String PLATFORM_FIREBIRD = "Firebird";
+
+ /** Identifier for the Hsqldb platform */
+ public static final String PLATFORM_HSQLDB = "Hsqldb";
+
+ /** Identifier for the Informix platform */
+ public static final String PLATFORM_INFORMIX = "Informix";
+
+ /** Identifier for the MaxDB platform */
+ public static final String PLATFORM_MAXDB = "MaxDB";
+
+ /** Identifier for the McKoi platform */
+ public static final String PLATFORM_MCKOI = "McKoi";
+
+ /** Identifier for the MsAccess platform */
+ public static final String PLATFORM_MSACCESS = "MsAccess";
+
+ /** Identifier for the Microsoft SQL Server platform */
+ public static final String PLATFORM_MSSQLSERVER = "MsSQLServer";
+
+ /** Identifier for the MySQL platform */
+ public static final String PLATFORM_MYSQL = "MySQL";
+
+ /** Identifier for the generic Oracle platform */
+ public static final String PLATFORM_ORACLE = "Oracle";
+
+ /** Identifier for the Oracle9i platform */
+ public static final String PLATFORM_ORACLE9I = "Oracle9i";
+
+ /** Identifier for the PostgresSQL platform */
+ public static final String PLATFORM_POSTGRESQL = "PostgreSQL";
+
+ /** Identifier for the generic Sybase platform */
+ public static final String PLATFORM_SYBASE = "Sybase";
+
+ /** Identifier for the Sybase ASA platform */
+ public static final String PLATFORM_SYBASEASA = "SybaseASA";
+
+ /** Identifier for the Sybase ASE platform */
+ public static final String PLATFORM_SYBASEASE = "SybaseASE";
+
+ /** Identifier for the Oracle9i for WebLogic platform */
+ public static final String PLATFORM_WLORACLE9I = "WLOracle9i";
+
+ /** The standard DB2 jdbc driver */
+ public static final String DRIVER_DB2 = "COM.ibm.db2.jdbc.app.DB2Driver";
+
+ /** The i-net DB2 jdbc driver */
+ public static final String DRIVER_DB2_INET = "com.inet.drda.DRDADriver";
+
+ /** The standard Firebird jdbc driver */
+ public static final String DRIVER_FIREBIRD = "org.firebirdsql.jdbc.FBDriver";
+
+ /** The standard Hsqldb jdbc driver */
+ public static final String DRIVER_HSQLDB = "org.hsqldb.jdbcDriver";
+
+ /** The i-net pooled jdbc driver for SQLServer and Sybase */
+ public static final String DRIVER_INET_POOLED = "com.inet.pool.PoolDriver";
+
+ /** The standard Informix jdbc driver */
+ public static final String DRIVER_INFORMIX = "com.informix.jdbc.IfxDriver";
+
+ /** The jTDS jdbc driver for SQLServer and Sybase */
+ public static final String DRIVER_JTDS = "net.sourceforge.jtds.jdbc.Driver";
+
+ /** The standard MaxDB jdbc driver */
+ public static final String DRIVER_MAXDB = "com.sap.dbtech.jdbc.DriverSapDB";
+
+ /** The standard McKoi jdbc driver */
+ public static final String DRIVER_MCKOI = "com.mckoi.JDBCDriver";
+
+ /** The standard SQLServer jdbc driver */
+ public static final String DRIVER_MSSQLSERVER = "com.microsoft.jdbc.sqlserver.SQLServerDriver";
+
+ /** The i-net SQLServer jdbc driver */
+ public static final String DRIVER_MSSQLSERVER_INET = "com.inet.tds.TdsDriver";
+
+ /** The JNetDirect SQLServer jdbc driver */
+ public static final String DRIVER_MSSQLSERVER_JSQLCONNECT = "com.jnetdirect.jsql.JSQLDriver";
+
+ /** The standard MySQL jdbc driver */
+ public static final String DRIVER_MYSQL = "com.mysql.jdbc.Driver";
+
+ /** The old MySQL jdbc driver */
+ public static final String DRIVER_MYSQL_OLD = "org.gjt.mm.mysql.Driver";
+
+ /** The standard Oracle jdbc driver */
+ public static final String DRIVER_ORACLE = "oracle.jdbc.driver.OracleDriver";
+
+ /** The i-net Oracle jdbc driver */
+ public static final String DRIVER_ORACLE_INET = "com.inet.ora.OraDriver";
+
+ /** The standard PostgreSQL jdbc driver */
+ public static final String DRIVER_POSTGRESQL = "org.postgresql.Driver";
+
+ /** The standard Sapdb jdbc driver */
+ public static final String DRIVER_SAPDB = DRIVER_MAXDB;
+
+ /** The standard Sybase jdbc driver */
+ public static final String DRIVER_SYBASE = "com.sybase.jdbc2.jdbc.SybDriver";
+
+ /** The old Sybase jdbc driver */
+ public static final String DRIVER_SYBASE_OLD = "com.sybase.jdbc.SybDriver";
+
+ /** The i-net Sybase jdbc driver */
+ public static final String DRIVER_SYBASE_INET = "com.inet.syb.SybDriver";
+
+ /** The subprotocol used by the standard DB2 driver */
+ public static final String SUBPROTOCOL_DB2 = "db2";
+
+ /** The subprotocol used by the i-net DB2 driver */
+ public static final String SUBPROTOCOL_DB2_INET = "inetdb2";
+
+ /** The subprotocol used by the standard Firebird driver */
+ public static final String SUBPROTOCOL_FIREBIRD = "firebirdsql";
+
+ /** The subprotocol used by the standard Hsqldb driver */
+ public static final String SUBPROTOCOL_HSQLDB = "hsqldb";
+
+ /** The subprotocol used by the standard Informix driver */
+ public static final String SUBPROTOCOL_INFORMIX = "informix-sqli";
+
+ /** The subprotocol used by the standard MaxDB driver */
+ public static final String SUBPROTOCOL_MAXDB = "sapdb";
+
+ /** The subprotocol used by the standard McKoi driver */
+ public static final String SUBPROTOCOL_MCKOI = "mckoi";
+
+ /** The subprotocol used by the standard SQLServer driver */
+ public static final String SUBPROTOCOL_MSSQLSERVER = "microsoft:sqlserver";
+
+ /** A subprotocol used by the i-net SQLServer driver */
+ public static final String SUBPROTOCOL_MSSQLSERVER_INET = "inetdae";
+
+ /** A subprotocol used by the i-net SQLServer driver */
+ public static final String SUBPROTOCOL_MSSQLSERVER6_INET = "inetdae6";
+
+ /** A subprotocol used by the i-net SQLServer driver */
+ public static final String SUBPROTOCOL_MSSQLSERVER7_INET = "inetdae7";
+
+ /** A subprotocol used by the i-net SQLServer driver */
+ public static final String SUBPROTOCOL_MSSQLSERVER7A_INET = "inetdae7a";
+
+ /** A subprotocol used by the pooled i-net SQLServer driver */
+ public static final String SUBPROTOCOL_MSSQLSERVER_INET_POOLED = "inetpool:inetdae";
+
+ /** A subprotocol used by the pooled i-net SQLServer driver */
+ public static final String SUBPROTOCOL_MSSQLSERVER6_INET_POOLED = "inetpool:inetdae6";
+
+ /** A subprotocol used by the pooled i-net SQLServer driver */
+ public static final String SUBPROTOCOL_MSSQLSERVER7_INET_POOLED = "inetpool:inetdae7";
+
+ /** A subprotocol used by the pooled i-net SQLServer driver */
+ public static final String SUBPROTOCOL_MSSQLSERVER7A_INET_POOLED = "inetpool:inetdae7a";
+
+ /** The subprotocol used by the JNetDirect SQLServer driver */
+ public static final String SUBPROTOCOL_MSSQLSERVER_JSQLCONNECT = "JSQLConnect";
+
+ /** The subprotocol used by the jTDS SQLServer driver */
+ public static final String SUBPROTOCOL_MSSQLSERVER_JTDS = "jtds:sqlserver";
+
+ /** The subprotocol used by the standard MySQL driver */
+ public static final String SUBPROTOCOL_MYSQL = "mysql";
+
+ /** The subprotocol used by the standard Oracle driver */
+ public static final String SUBPROTOCOL_ORACLE = "oracle";
+
+ /** The subprotocol used by the i-net Oracle driver */
+ public static final String SUBPROTOCOL_ORACLE_INET = "inetora";
+
+ /** The subprotocol used by the standard PostgreSQL driver */
+ public static final String SUBPROTOCOL_POSTGRESQL = "postgresql";
+
+ /** The subprotocol used by the standard Sapdb driver */
+ public static final String SUBPROTOCOL_SAPDB = SUBPROTOCOL_MAXDB;
+
+ /** The subprotocol used by the standard Sybase driver */
+ public static final String SUBPROTOCOL_SYBASE = "sybase:Tds";
+
+ /** The subprotocol used by the i-net Sybase driver */
+ public static final String SUBPROTOCOL_SYBASE_INET = "inetsyb";
+
+ /** The subprotocol used by the pooled i-net Sybase driver */
+ public static final String SUBPROTOCOL_SYBASE_INET_POOLED = "inetpool:inetsyb";
+
+ /** The subprotocol used by the jTDS Sybase driver */
+ public static final String SUBPROTOCOL_SYBASE_JTDS = "jtds:sybase";
+
+ /** Maps the sub-protocl part of a jdbc connection url to a OJB platform name */
+ private HashMap jdbcSubProtocolToPlatform = new HashMap();
+
+ /** Maps the jdbc driver name to a OJB platform name */
+ private HashMap jdbcDriverToPlatform = new HashMap();
+
+ /**
+ * Creates a new <code>JdbcMetadataUtils</code> object.
+ */
+ public JdbcMetadataUtils()
+ {
+ // Note that currently Sapdb and MaxDB have equal subprotocols and
+ // drivers so we have no means to distinguish them
+ jdbcSubProtocolToPlatform.put(SUBPROTOCOL_DB2, PLATFORM_DB2);
+ jdbcSubProtocolToPlatform.put(SUBPROTOCOL_DB2_INET, PLATFORM_DB2);
+ jdbcSubProtocolToPlatform.put(SUBPROTOCOL_FIREBIRD, PLATFORM_FIREBIRD);
+ jdbcSubProtocolToPlatform.put(SUBPROTOCOL_HSQLDB, PLATFORM_HSQLDB);
+ jdbcSubProtocolToPlatform.put(SUBPROTOCOL_INFORMIX, PLATFORM_INFORMIX);
+ jdbcSubProtocolToPlatform.put(SUBPROTOCOL_MAXDB, PLATFORM_MAXDB);
+ jdbcSubProtocolToPlatform.put(SUBPROTOCOL_MSSQLSERVER, PLATFORM_MSSQLSERVER);
+ jdbcSubProtocolToPlatform.put(SUBPROTOCOL_MSSQLSERVER_INET, PLATFORM_MSSQLSERVER);
+ jdbcSubProtocolToPlatform.put(SUBPROTOCOL_MSSQLSERVER6_INET, PLATFORM_MSSQLSERVER);
+ jdbcSubProtocolToPlatform.put(SUBPROTOCOL_MSSQLSERVER7_INET, PLATFORM_MSSQLSERVER);
+ jdbcSubProtocolToPlatform.put(SUBPROTOCOL_MSSQLSERVER7A_INET, PLATFORM_MSSQLSERVER);
+ jdbcSubProtocolToPlatform.put(SUBPROTOCOL_MSSQLSERVER_INET_POOLED, PLATFORM_MSSQLSERVER);
+ jdbcSubProtocolToPlatform.put(SUBPROTOCOL_MSSQLSERVER6_INET_POOLED, PLATFORM_MSSQLSERVER);
+ jdbcSubProtocolToPlatform.put(SUBPROTOCOL_MSSQLSERVER7_INET_POOLED, PLATFORM_MSSQLSERVER);
+ jdbcSubProtocolToPlatform.put(SUBPROTOCOL_MSSQLSERVER7A_INET_POOLED, PLATFORM_MSSQLSERVER);
+ jdbcSubProtocolToPlatform.put(SUBPROTOCOL_MSSQLSERVER_JTDS, PLATFORM_MSSQLSERVER);
+ jdbcSubProtocolToPlatform.put(SUBPROTOCOL_MYSQL, PLATFORM_MYSQL);
+ jdbcSubProtocolToPlatform.put(SUBPROTOCOL_ORACLE, PLATFORM_ORACLE);
+ jdbcSubProtocolToPlatform.put(SUBPROTOCOL_ORACLE_INET, PLATFORM_ORACLE);
+ jdbcSubProtocolToPlatform.put(SUBPROTOCOL_POSTGRESQL, PLATFORM_POSTGRESQL);
+ jdbcSubProtocolToPlatform.put(SUBPROTOCOL_SYBASE, PLATFORM_SYBASE);
+ jdbcSubProtocolToPlatform.put(SUBPROTOCOL_SYBASE_INET, PLATFORM_SYBASE);
+ jdbcSubProtocolToPlatform.put(SUBPROTOCOL_SYBASE_INET_POOLED, PLATFORM_SYBASE);
+ jdbcSubProtocolToPlatform.put(SUBPROTOCOL_SYBASE_JTDS, PLATFORM_SYBASE);
+
+ jdbcDriverToPlatform.put(DRIVER_DB2, PLATFORM_DB2);
+ jdbcDriverToPlatform.put(DRIVER_DB2_INET, PLATFORM_DB2);
+ jdbcDriverToPlatform.put(DRIVER_FIREBIRD, PLATFORM_FIREBIRD);
+ jdbcDriverToPlatform.put(DRIVER_HSQLDB, PLATFORM_HSQLDB);
+ jdbcDriverToPlatform.put(DRIVER_INFORMIX, PLATFORM_INFORMIX);
+ jdbcDriverToPlatform.put(DRIVER_MAXDB, PLATFORM_MAXDB);
+ jdbcDriverToPlatform.put(DRIVER_MCKOI, PLATFORM_MCKOI);
+ jdbcDriverToPlatform.put(DRIVER_MSSQLSERVER, PLATFORM_MSSQLSERVER);
+ jdbcDriverToPlatform.put(DRIVER_MSSQLSERVER_INET, PLATFORM_MSSQLSERVER);
+ jdbcDriverToPlatform.put(DRIVER_MSSQLSERVER_JSQLCONNECT, PLATFORM_MSSQLSERVER);
+ jdbcDriverToPlatform.put(DRIVER_MYSQL, PLATFORM_MYSQL);
+ jdbcDriverToPlatform.put(DRIVER_MYSQL_OLD, PLATFORM_MYSQL);
+ jdbcDriverToPlatform.put(DRIVER_ORACLE, PLATFORM_ORACLE);
+ jdbcDriverToPlatform.put(DRIVER_ORACLE_INET, PLATFORM_ORACLE);
+ jdbcDriverToPlatform.put(DRIVER_POSTGRESQL, PLATFORM_POSTGRESQL);
+ jdbcDriverToPlatform.put(DRIVER_SYBASE, PLATFORM_SYBASE);
+ jdbcDriverToPlatform.put(DRIVER_SYBASE_OLD, PLATFORM_SYBASE);
+ jdbcDriverToPlatform.put(DRIVER_SYBASE_INET, PLATFORM_SYBASE);
+ }
+
+ /**
+ * Fills parameters of the given {@link JdbcConnectionDescriptor} with metadata extracted from the given datasource.
+ *
+ * @param jcd
+ * The jdbc connection descriptor to fill
+ * @param dataSource
+ * The data source
+ * @param username
+ * The username required to establish a connection via the data source Can be empty if the data source
+ * does not require it or if one is specified in the jdbc connection descriptor
+ * @param password
+ * The username required to establish a connection via the data source Can be empty if the data source or
+ * username does not require it or if one is specified in the jdbc connection descriptor
+ */
+ public void fillJCDFromDataSource(JdbcConnectionDescriptor jcd, DataSource dataSource, String username,
+ String password) throws MetadataException
+ {
+ String realUsername = (jcd.getUserName() != null ? jcd.getUserName() : username);
+ String realPassword = (jcd.getPassWord() != null ? jcd.getPassWord() : password);
+ Connection connection = null;
+ DatabaseMetaData metadata = null;
+
+ try
+ {
+ // we have to open a connection to be able to retrieve metadata
+ if (realUsername != null)
+ {
+ connection = dataSource.getConnection(realUsername, realPassword);
+ }
+ else
+ {
+ connection = dataSource.getConnection();
+ }
+
+ metadata = connection.getMetaData();
+ }
+ catch (Throwable t)
+ {
+ if (connection != null)
+ {
+ try
+ {
+ connection.close();
+ }
+ catch (SQLException ex)
+ {
+ }
+ }
+ throw new MetadataException("Could not get the metadata from the given datasource", t);
+ }
+
+ try
+ {
+ HashMap urlComponents = parseConnectionUrl(metadata.getURL());
+
+ if (urlComponents.containsKey(PROPERTY_DBALIAS))
+ {
+ jcd.setProtocol((String) urlComponents.get(PROPERTY_PROTOCOL));
+ jcd.setSubProtocol((String) urlComponents.get(PROPERTY_SUBPROTOCOL));
+ jcd.setDbAlias((String) urlComponents.get(PROPERTY_DBALIAS));
+ if (jdbcSubProtocolToPlatform.containsKey(jcd.getSubProtocol()))
+ {
+ // TODO: We might be able to use this: metadata.getDatabaseProductName();
+ jcd.setDbms((String) jdbcSubProtocolToPlatform.get(jcd.getSubProtocol()));
+ }
+ }
+ }
+ catch (Throwable t)
+ {
+ try
+ {
+ connection.close();
+ }
+ catch (SQLException ex)
+ {
+ }
+ throw new MetadataException("Could not get the metadata from the given datasource", t);
+ }
+ try
+ {
+ // this will only work with JDK >= 1.4 and only with some jdbc drivers
+ Integer majorVersion = (Integer) PropertyUtils.getProperty(metadata, "JDBCMajorVersion");
+ Integer minorVersion = (Integer) PropertyUtils.getProperty(metadata, "JDBCMinorVersion");
+
+ jcd.setJdbcLevel(Double.parseDouble(majorVersion.toString() + "." + minorVersion.toString()));
+ }
+ catch (Throwable t)
+ {
+ // otherwise we're assuming JDBC 2.0 compliance
+ jcd.setJdbcLevel(2.0);
+ }
+ try
+ {
+ connection.close();
+ }
+ catch (SQLException ex)
+ {
+ }
+ }
+
+ /**
+ * Splits the given jdbc connection url into its components and puts them into a hash map using the
+ * <code>PROPERTY_</code> constants.
+ *
+ * @param jdbcConnectionUrl
+ * The connection url
+ * @return The properties
+ */
+ public HashMap parseConnectionUrl(String jdbcConnectionUrl)
+ {
+ HashMap result = new HashMap();
+
+ if (jdbcConnectionUrl == null)
+ {
+ return result;
+ }
+
+ int pos = jdbcConnectionUrl.indexOf(':');
+ int lastPos;
+
+ result.put(PROPERTY_PROTOCOL, jdbcConnectionUrl.substring(0, pos));
+
+ lastPos = pos;
+ pos = jdbcConnectionUrl.indexOf(':', lastPos + 1);
+
+ String subProtocol = jdbcConnectionUrl.substring(lastPos + 1, pos);
+
+ // there are a few jdbc drivers that have a subprotocol containing one or more ':'
+ if ("inetpool".equals(subProtocol))
+ {
+ // Possible forms are:
+ // inetpool:<subprotocol>
+ // inetpool:jdbc:<subprotocol> (where we'll remove the 'jdbc' part)
+
+ int tmpPos = jdbcConnectionUrl.indexOf(':', pos + 1);
+
+ if ("inetpool:jdbc".equals(jdbcConnectionUrl.substring(lastPos + 1, tmpPos)))
+ {
+ pos = tmpPos;
+ tmpPos = jdbcConnectionUrl.indexOf(':', pos + 1);
+ }
+ subProtocol += ":" + jdbcConnectionUrl.substring(pos + 1, tmpPos);
+ }
+ else if ("jtds".equals(subProtocol) || "microsoft".equals(subProtocol) || "sybase".equals(subProtocol))
+ {
+ pos = jdbcConnectionUrl.indexOf(':', pos + 1);
+ subProtocol = ":" + jdbcConnectionUrl.substring(lastPos + 1, pos);
+ }
+
+ result.put(PROPERTY_SUBPROTOCOL, subProtocol);
+ result.put(PROPERTY_DBALIAS, jdbcConnectionUrl.substring(pos + 1));
+
+ return result;
+ }
+
+ /**
+ * Derives the OJB platform to use for a database that is connected via a url using the specified subprotocol, and
+ * where the specified jdbc driver is used.
+ *
+ * @param jdbcSubProtocol
+ * The JDBC subprotocol used to connect to the database
+ * @param jdbcDriver
+ * The JDBC driver used to connect to the database
+ * @return The platform identifier or <code>null</code> if no platform could be found
+ */
+ public String findPlatformFor(String jdbcSubProtocol, String jdbcDriver)
+ {
+ String platform = (String) jdbcSubProtocolToPlatform.get(jdbcSubProtocol);
+
+ if (platform == null)
+ {
+ platform = (String) jdbcDriverToPlatform.get(jdbcDriver);
+ }
+ return platform;
+ }
+}
Modified: portals/jetspeed-2/trunk/app-servers/security/jboss/src/java/org/apache/jetspeed/appservers/security/jboss/JetspeedSecurityService.java
URL: http://svn.apache.org/viewcvs/portals/jetspeed-2/trunk/app-servers/security/jboss/src/java/org/apache/jetspeed/appservers/security/jboss/JetspeedSecurityService.java?rev=225674&r1=225673&r2=225674&view=diff
==============================================================================
--- portals/jetspeed-2/trunk/app-servers/security/jboss/src/java/org/apache/jetspeed/appservers/security/jboss/JetspeedSecurityService.java (original)
+++ portals/jetspeed-2/trunk/app-servers/security/jboss/src/java/org/apache/jetspeed/appservers/security/jboss/JetspeedSecurityService.java Wed Jul 27 20:00:31 2005
@@ -1,35 +1,126 @@
/* Copyright 2004 Apache Software Foundation
-*
-* Licensed 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.
-*/
+ *
+ * Licensed 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.apache.jetspeed.appservers.security.jboss;
-import org.apache.jetspeed.security.spi.impl.SecurityAccessImpl;
+import java.util.Iterator;
+
+import javax.naming.Context;
+import javax.naming.InitialContext;
+import javax.naming.NamingException;
+import javax.sql.DataSource;
+
+import org.apache.jetspeed.security.UserManager;
+import org.apache.ojb.broker.PBKey;
+import org.apache.ojb.broker.PersistenceBroker;
+import org.apache.ojb.broker.accesslayer.ConnectionFactoryManagedImpl;
+import org.apache.ojb.broker.accesslayer.ConnectionManagerFactory;
+import org.apache.ojb.broker.metadata.ConnectionPoolDescriptor;
+import org.apache.ojb.broker.metadata.ConnectionRepository;
+import org.apache.ojb.broker.metadata.JdbcConnectionDescriptor;
+import org.apache.ojb.broker.metadata.MetadataManager;
import org.springframework.beans.factory.xml.XmlBeanDefinitionReader;
import org.springframework.context.support.GenericApplicationContext;
import org.springframework.core.io.ClassPathResource;
+import org.springframework.orm.ojb.OjbFactoryUtils;
+
+public class JetspeedSecurityService implements JetspeedSecurityServiceMBean
+{
-public class JetspeedSecurityService implements JetspeedSecurityServiceMBean {
+ private final String JCD_ALIAS = "jetspeed-security-service";
private GenericApplicationContext ctx;
- public JetspeedSecurityService () {
- ctx = new GenericApplicationContext();
- XmlBeanDefinitionReader xmlReader = new XmlBeanDefinitionReader(ctx);
- xmlReader.loadBeanDefinitions
- (new ClassPathResource
- ("META-INF/jboss-secsvc/jboss-security-service.xml"));
- ctx.refresh();
+ /**
+ * Create a new security service. The service's implementation is based on a <a
+ * href="www.springframework.org">Spring</a> application that is assembled from the configuration files in
+ * <code>META-INF/jboss-secsvc</code>.
+ */
+ public JetspeedSecurityService()
+ {
+ // Prepare JCD so that it can be resolved
+ JdbcConnectionDescriptor jcd = findJcd();
+ if (jcd == null)
+ {
+ // JCD not found, initialize
+ jcd = new JdbcConnectionDescriptor();
+ jcd.setJcdAlias(JCD_ALIAS);
+ ConnectionPoolDescriptor cpd = new ConnectionPoolDescriptor();
+ cpd.setConnectionFactory(ConnectionFactoryManagedImpl.class);
+ jcd.setConnectionPoolDescriptor(cpd);
+ ConnectionRepository cr = MetadataManager.getInstance().connectionRepository();
+ cr.addDescriptor(jcd);
+ }
+ // Instatiate application
+ ctx = new GenericApplicationContext();
+ XmlBeanDefinitionReader xmlReader = new XmlBeanDefinitionReader(ctx);
+ xmlReader.loadBeanDefinitions(new ClassPathResource("META-INF/jboss-secsvc/jboss-security-service.xml"));
+ ctx.refresh();
+ }
+
+ private JdbcConnectionDescriptor findJcd()
+ {
+ // Try to find JCD
+ ConnectionRepository cr = MetadataManager.getInstance().connectionRepository();
+ return cr.getDescriptor(new PBKey(JCD_ALIAS));
}
+ /**
+ * Set the JNDI name of the <code>DataSource</code> to be used to access the database.
+ *
+ * @param jndiName
+ */
+ public void setDataSourceJndiName(String jndiName)
+ {
+ boolean newJcd = false;
+ JdbcConnectionDescriptor jcd = findJcd();
+ try
+ {
+ Context initialContext = new InitialContext();
+ DataSource ds = (DataSource) initialContext.lookup(jndiName);
+ (new JdbcMetadataUtils()).fillJCDFromDataSource(jcd, ds, null, null);
+ }
+ catch (NamingException e)
+ {
+ throw (IllegalArgumentException) (new IllegalArgumentException("Data source \"" + jndiName
+ + "\" not found in JNDI: " + e.getMessage())).initCause(e);
+ }
+ jcd.setDatasourceName(jndiName);
+ }
+
+ /**
+ * Get the JNDI name of the <code>DataSource</code> used to access the database.
+ *
+ * @return jndiName
+ */
+ public String getDataSourceJndiName()
+ {
+ JdbcConnectionDescriptor jcd = findJcd();
+ if (jcd == null)
+ {
+ return null;
+ }
+ return jcd.getDatasourceName();
+ }
+
+ /**
+ * @see JetspeedSecurityServiceMBean#getUserManager()
+ */
+ public UserManager getUserManager()
+ {
+ // TODO Auto-generated method stub
+ UserManager um = (UserManager) ctx.getBean("org.apache.jetspeed.security.UserManager");
+ return um;
+ }
}
Modified: portals/jetspeed-2/trunk/app-servers/security/jboss/src/java/org/apache/jetspeed/appservers/security/jboss/JetspeedSecurityServiceMBean.java
URL: http://svn.apache.org/viewcvs/portals/jetspeed-2/trunk/app-servers/security/jboss/src/java/org/apache/jetspeed/appservers/security/jboss/JetspeedSecurityServiceMBean.java?rev=225674&r1=225673&r2=225674&view=diff
==============================================================================
--- portals/jetspeed-2/trunk/app-servers/security/jboss/src/java/org/apache/jetspeed/appservers/security/jboss/JetspeedSecurityServiceMBean.java (original)
+++ portals/jetspeed-2/trunk/app-servers/security/jboss/src/java/org/apache/jetspeed/appservers/security/jboss/JetspeedSecurityServiceMBean.java Wed Jul 27 20:00:31 2005
@@ -1,18 +1,42 @@
/* Copyright 2004 Apache Software Foundation
-*
-* Licensed 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.
-*/
+ *
+ * Licensed 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.apache.jetspeed.appservers.security.jboss;
-public interface JetspeedSecurityServiceMBean {
+import org.apache.jetspeed.security.UserManager;
+
+public interface JetspeedSecurityServiceMBean
+{
+
+ /**
+ * Set the JNDI name of the <code>DataSource</code> to be used to access the database.
+ *
+ * @param jndiName
+ */
+ void setDataSourceJndiName(String jndiName);
+
+ /**
+ * Get the JNDI name of the <code>DataSource</code> used to access the database.
+ *
+ * @return jndiName
+ */
+ String getDataSourceJndiName();
+
+ /**
+ * Get the user manager.
+ *
+ * @return user manager
+ */
+ UserManager getUserManager();
}
Added: portals/jetspeed-2/trunk/app-servers/security/jboss/src/java/org/apache/jetspeed/appservers/security/jboss/LoginModule.java
URL: http://svn.apache.org/viewcvs/portals/jetspeed-2/trunk/app-servers/security/jboss/src/java/org/apache/jetspeed/appservers/security/jboss/LoginModule.java?rev=225674&view=auto
==============================================================================
--- portals/jetspeed-2/trunk/app-servers/security/jboss/src/java/org/apache/jetspeed/appservers/security/jboss/LoginModule.java (added)
+++ portals/jetspeed-2/trunk/app-servers/security/jboss/src/java/org/apache/jetspeed/appservers/security/jboss/LoginModule.java Wed Jul 27 20:00:31 2005
@@ -0,0 +1,154 @@
+/* Copyright 2004 Apache Software Foundation
+ *
+ * Licensed 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.apache.jetspeed.appservers.security.jboss;
+
+import java.util.Map;
+
+import javax.management.InstanceNotFoundException;
+import javax.management.MBeanException;
+import javax.management.MBeanServer;
+import javax.management.MBeanServerFactory;
+import javax.management.MalformedObjectNameException;
+import javax.management.ObjectName;
+import javax.management.ReflectionException;
+import javax.security.auth.Subject;
+import javax.security.auth.callback.CallbackHandler;
+import javax.security.auth.login.LoginException;
+
+import org.apache.jetspeed.security.UserManager;
+import org.apache.jetspeed.security.impl.ext.JBossLoginModule;
+
+/**
+ * A login module that uses the JetspeedSecurityService MBean for authentication and role assignment.
+ */
+public class LoginModule implements javax.security.auth.spi.LoginModule
+{
+
+ private String securityService = null;
+
+ private JBossLoginModule delegee = null;
+
+ /**
+ * Helper for delaying the creation of the JBossLoginModule. We cannot access the security service MBean before
+ * <code>initialize</code> has been called, but need the user manager in the constructor of JBossLoginModule. The
+ * constructor that takes the user manager as argument is protected (and right so), so we need this helper.
+ */
+ private class LoginModuleDelegee extends JBossLoginModule
+ {
+ public LoginModuleDelegee(UserManager userManager)
+ {
+ super(userManager);
+ }
+ }
+
+ /**
+ * Create a new login module. The module looks up the JetspeedSecurityService MBean and uses it to actually perform
+ * authentication and role lookup.
+ * <P>
+ * Note that the MBean must be available when this login module is instantiated. Therefore, if the MBean (the SAR)
+ * is deployed after JBoss has been started, this login module must be created lazily by using the JBoss login
+ * module proxy in login-config.xml.
+ *
+ * <pre>
+ * <application-policy name = "sample">
+ * <authentication>
+ * <login-module code = "org.jboss.security.auth.spi.ProxyLoginModule"
+ * flag = "required">
+ * <module-option name = "moduleName">
+ * org.apache.jetspeed.appservers.security.jboss.LoginModule
+ * </module-option>
+ * <!-- The name of the security service MBean. Must match
+ * the name in jboss-service.xml -->
+ * <module-option name = "securityService">
+ * org.apache.jetspeed:service=JetspeedSecurityService
+ * </module-option>
+ * </login-module>
+ * </authentication>
+ * </application-policy>
+ * </pre>
+ */
+ public LoginModule()
+ {
+ }
+
+ private UserManager getUserManager()
+ {
+ try
+ {
+ MBeanServer server = (MBeanServer) MBeanServerFactory.findMBeanServer(null).get(0);
+ ObjectName serviceName = new ObjectName(securityService);
+ return (UserManager) server.invoke(serviceName, "getUserManager", null, null);
+ }
+ catch (MalformedObjectNameException e)
+ {
+ throw (IllegalStateException) ((new IllegalStateException(e.getMessage())).initCause(e));
+ }
+ catch (InstanceNotFoundException e)
+ {
+ throw (IllegalStateException) ((new IllegalStateException(e.getMessage())).initCause(e));
+ }
+ catch (ReflectionException e)
+ {
+ throw (IllegalStateException) ((new IllegalStateException(e.getMessage())).initCause(e));
+ }
+ catch (MBeanException e)
+ {
+ throw (IllegalStateException) ((new IllegalStateException(e.getMessage())).initCause(e));
+ }
+ }
+
+ /**
+ * @see javax.security.auth.spi.LoginModule#initialize()
+ */
+ public void initialize(Subject subject, CallbackHandler callbackHandler, Map sharedState, Map options)
+ {
+ securityService = (String) options.get("securityService");
+ delegee = new LoginModuleDelegee(getUserManager());
+ delegee.initialize(subject, callbackHandler, sharedState, options);
+
+ }
+
+ /**
+ * @see javax.security.auth.spi.LoginModule#abort()
+ */
+ public boolean abort() throws LoginException
+ {
+ return delegee.abort();
+ }
+
+ /**
+ * @see javax.security.auth.spi.LoginModule#commit()
+ */
+ public boolean commit() throws LoginException
+ {
+ return delegee.commit();
+ }
+
+ /**
+ * @see javax.security.auth.spi.LoginModule#login()
+ */
+ public boolean login() throws LoginException
+ {
+ return delegee.login();
+ }
+
+ /**
+ * @see javax.security.auth.spi.LoginModule#logout()
+ */
+ public boolean logout() throws LoginException
+ {
+ return delegee.logout();
+ }
+}
Modified: portals/jetspeed-2/trunk/components/portal/project.xml
URL: http://svn.apache.org/viewcvs/portals/jetspeed-2/trunk/components/portal/project.xml?rev=225674&r1=225673&r2=225674&view=diff
==============================================================================
--- portals/jetspeed-2/trunk/components/portal/project.xml (original)
+++ portals/jetspeed-2/trunk/components/portal/project.xml Wed Jul 27 20:00:31 2005
@@ -1,81 +1,78 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
- Copyright 2004 The Apache Software Foundation
-
- Licensed 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.
-
- $Id: project.xml 189937 2005-06-10 10:51:53Z ate $
+ Copyright 2004 The Apache Software Foundation
+
+ Licensed 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.
+
+ $Id: project.xml 189937 2005-06-10 10:51:53Z ate $
-->
<project>
- <extend>${basedir}/../../jetspeed-components.xml</extend>
- <id>jetspeed-portal</id>
- <name>Jetspeed-2 Portal Components</name>
- <package>org.apache.jetspeed</package>
- <description>Portal Components</description>
- <shortDescription>Portal Components</shortDescription>
- <repository>
- <connection>
- scm:svn:http://svn.apache.org/repos/asf/portals/jetspeed-2/trunk/components/portal
- </connection>
- <developerConnection>
- scm:svn:https://svn.apache.org/repos/asf/portals/jetspeed-2/trunk/components/portal
- </developerConnection>
- <url>
- http://svn.apache.org/viewcvs.cgi/portals/jetspeed-2/trunk/components/portal/
- </url>
- </repository>
+ <extend>${basedir}/../../jetspeed-components.xml</extend>
+ <id>jetspeed-portal</id>
+ <name>Jetspeed-2 Portal Components</name>
+ <package>org.apache.jetspeed</package>
+ <description>Portal Components</description>
+ <shortDescription>Portal Components</shortDescription>
+ <repository>
+ <connection>scm:svn:http://svn.apache.org/repos/asf/portals/jetspeed-2/trunk/components/portal</connection>
+ <developerConnection>scm:svn:https://svn.apache.org/repos/asf/portals/jetspeed-2/trunk/components/portal</developerConnection>
+ <url>http://svn.apache.org/viewcvs.cgi/portals/jetspeed-2/trunk/components/portal/</url>
+ </repository>
- <build>
- <sourceDirectory>src/java</sourceDirectory>
- <unitTestSourceDirectory>src/test</unitTestSourceDirectory>
- <unitTest>
- <includes>
- <include>**/Test*</include>
- </includes>
- <resources>
- <resource>
- <directory>${basedir}/src/java</directory>
- <excludes>
- <exclude>**/*.java</exclude>
- <exclude>repository_database.xml</exclude>
- </excludes>
- </resource>
- <resource>
- <directory>${basedir}/src/test</directory>
- <excludes>
- <exclude>**/*.java</exclude>
- </excludes>
- </resource>
- <resource>
- <directory>${basedir}/../../etc/log4j</directory>
- </resource>
- <resource>
- <directory>${basedir}/../../etc/db-ojb</directory>
- </resource>
- </resources>
+ <build>
+ <sourceDirectory>src/java</sourceDirectory>
+ <unitTestSourceDirectory>src/test</unitTestSourceDirectory>
+ <unitTest>
+ <includes>
+ <include>**/Test*</include>
+ </includes>
+ <resources>
+ <resource>
+ <directory>${basedir}/src/java</directory>
+ <excludes>
+ <exclude>**/*.java</exclude>
+ <exclude>repository_database.xml</exclude>
+ </excludes>
+ </resource>
+ <resource>
+ <directory>${basedir}/src/test</directory>
+ <excludes>
+ <exclude>**/*.java</exclude>
+ </excludes>
+ </resource>
+ <resource>
+ <directory>${basedir}/../../etc/log4j</directory>
+ </resource>
+ <resource>
+ <directory>${basedir}/../../etc/db-ojb</directory>
+ </resource>
+ <resource>
+ <directory>${basedir}/../../portal-webapp/src/webapp/WEB-INF/assembly</directory>
+ </resource>
+ </resources>
- </unitTest>
+ </unitTest>
- <resources>
- <resource>
- <directory>${basedir}/src/java</directory>
- <excludes>
- <exclude>**/*.java</exclude>
- </excludes>
- </resource>
- </resources>
+ <resources>
+ <resource>
+ <directory>${basedir}/src/java</directory>
+ <excludes>
+ <exclude>**/*.java</exclude>
+ </excludes>
+ </resource>
+ </resources>
+
+ </build>
- </build>
-
</project>
Modified: portals/jetspeed-2/trunk/components/security/project.xml
URL: http://svn.apache.org/viewcvs/portals/jetspeed-2/trunk/components/security/project.xml?rev=225674&r1=225673&r2=225674&view=diff
==============================================================================
--- portals/jetspeed-2/trunk/components/security/project.xml (original)
+++ portals/jetspeed-2/trunk/components/security/project.xml Wed Jul 27 20:00:31 2005
@@ -1,117 +1,118 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
-Copyright 2004 The Apache Software Foundation
-
-Licensed 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
-
+ Copyright 2004 The Apache Software Foundation
+
+ Licensed 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.
-
+
+ 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.
+
$Id$
-->
<project>
- <extend>${basedir}/../../core-build.xml</extend>
- <pomVersion>3</pomVersion>
- <id>jetspeed-security</id>
- <name>Jetspeed-2 Security Components</name>
-
- <package>org.apache.jetspeed</package>
+ <extend>${basedir}/../../core-build.xml</extend>
+ <pomVersion>3</pomVersion>
+ <id>jetspeed-security</id>
+ <name>Jetspeed-2 Security Components</name>
+
+ <package>org.apache.jetspeed</package>
<description>Security Components</description>
- <shortDescription>Security Components</shortDescription>
+ <shortDescription>Security Components</shortDescription>
+
+ <repository>
+ <connection>scm:svn:http://svn.apache.org/repos/asf/portals/jetspeed-2/trunk/components/security</connection>
+ <developerConnection>scm:svn:https://svn.apache.org/repos/asf/portals/jetspeed-2/trunk/components/security</developerConnection>
+ <url>http://svn.apache.org/viewcvs.cgi/portals/jetspeed-2/trunk/components/security/</url>
+ </repository>
+
+ <dependencies>
+ <!-- Components -->
+ <dependency>
+ <id>jetspeed-api</id>
+ <groupId>jetspeed2</groupId>
+ <version>${jetspeed.version}</version>
+ <properties>
+ <war.bundle>true</war.bundle>
+ </properties>
+ </dependency>
+ <dependency>
+ <id>jetspeed-cm</id>
+ <groupId>jetspeed2</groupId>
+ <version>${jetspeed.version}</version>
+ <properties>
+ <war.bundle>true</war.bundle>
+ </properties>
+ </dependency>
+ <dependency>
+ <id>jetspeed-prefs</id>
+ <groupId>jetspeed2</groupId>
+ <version>${jetspeed.version}</version>
+ <properties>
+ <war.bundle>true</war.bundle>
+ </properties>
+ </dependency>
+
+ <!-- Testing only -->
+ <dependency>
+ <id>jetspeed-rdbms</id>
+ <groupId>jetspeed2</groupId>
+ <version>${jetspeed.version}</version>
+ <properties>
+ <war.bundle>false</war.bundle>
+ </properties>
+ </dependency>
+ <dependency>
+ <id>jetspeed-commons</id>
+ <groupId>jetspeed2</groupId>
+ <version>${jetspeed.version}</version>
+ <properties>
+ <war.bundle>false</war.bundle>
+ </properties>
+ </dependency>
+ </dependencies>
+
+ <build>
+ <sourceDirectory>src/java</sourceDirectory>
+ <unitTestSourceDirectory>${basedir}/src/test</unitTestSourceDirectory>
+ <unitTest>
+ <includes>
+ <include>**/Test*.java</include>
+ </includes>
+ <excludes>
+ <exclude>**/ldap/*</exclude>
+ </excludes>
+
+ <resources>
+ <resource>
+ <directory>${basedir}/src/test</directory>
+ <excludes>
+ <exclude>**/*.java</exclude>
+ </excludes>
+ </resource>
+ <resource>
+ <directory>${basedir}/src/java</directory>
+ <excludes>
+ <exclude>**/*.java</exclude>
+ </excludes>
+ </resource>
+ <resource>
+ <directory>${basedir}/../../etc/log4j</directory>
+ </resource>
+ <resource>
+ <directory>${basedir}/../../etc/db-ojb</directory>
+ </resource>
+ <resource>
+ <directory>${basedir}/../../portal-webapp/src/webapp/WEB-INF/assembly</directory>
+ </resource>
+ </resources>
+ </unitTest>
+ </build>
- <repository>
- <connection>scm:svn:http://svn.apache.org/repos/asf/portals/jetspeed-2/trunk/components/security</connection>
- <developerConnection>
- scm:svn:https://svn.apache.org/repos/asf/portals/jetspeed-2/trunk/components/security
- </developerConnection>
- <url>http://svn.apache.org/viewcvs.cgi/portals/jetspeed-2/trunk/components/security/</url>
- </repository>
-
- <dependencies>
- <!-- Components -->
- <dependency>
- <id>jetspeed-api</id>
- <groupId>jetspeed2</groupId>
- <version>${jetspeed.version}</version>
- <properties>
- <war.bundle>true</war.bundle>
- </properties>
- </dependency>
- <dependency>
- <id>jetspeed-cm</id>
- <groupId>jetspeed2</groupId>
- <version>${jetspeed.version}</version>
- <properties>
- <war.bundle>true</war.bundle>
- </properties>
- </dependency>
- <dependency>
- <id>jetspeed-prefs</id>
- <groupId>jetspeed2</groupId>
- <version>${jetspeed.version}</version>
- <properties>
- <war.bundle>true</war.bundle>
- </properties>
- </dependency>
-
- <!-- Testing only -->
- <dependency>
- <id>jetspeed-rdbms</id>
- <groupId>jetspeed2</groupId>
- <version>${jetspeed.version}</version>
- <properties>
- <war.bundle>false</war.bundle>
- </properties>
- </dependency>
- <dependency>
- <id>jetspeed-commons</id>
- <groupId>jetspeed2</groupId>
- <version>${jetspeed.version}</version>
- <properties>
- <war.bundle>false</war.bundle>
- </properties>
- </dependency>
- </dependencies>
-
- <build>
- <sourceDirectory>src/java</sourceDirectory>
- <unitTestSourceDirectory>${basedir}/src/test</unitTestSourceDirectory>
- <unitTest>
- <includes>
- <include>**/Test*.java</include>
- </includes>
- <excludes>
- <exclude>**/ldap/*</exclude>
- </excludes>
-
- <resources>
- <resource>
- <directory>${basedir}/src/test</directory>
- <excludes>
- <exclude>**/*.java</exclude>
- </excludes>
- </resource>
- <resource>
- <directory>${basedir}/src/java</directory>
- <excludes>
- <exclude>**/*.java</exclude>
- </excludes>
- </resource>
- <resource>
- <directory>${basedir}/../../etc/log4j</directory>
- </resource>
- <resource>
- <directory>${basedir}/../../etc/db-ojb</directory>
- </resource>
- </resources>
- </unitTest>
- </build>
-
</project>
Modified: portals/jetspeed-2/trunk/components/security/src/java/org/apache/jetspeed/security/util/test/AbstractSecurityTestcase.java
URL: http://svn.apache.org/viewcvs/portals/jetspeed-2/trunk/components/security/src/java/org/apache/jetspeed/security/util/test/AbstractSecurityTestcase.java?rev=225674&r1=225673&r2=225674&view=diff
==============================================================================
--- portals/jetspeed-2/trunk/components/security/src/java/org/apache/jetspeed/security/util/test/AbstractSecurityTestcase.java (original)
+++ portals/jetspeed-2/trunk/components/security/src/java/org/apache/jetspeed/security/util/test/AbstractSecurityTestcase.java Wed Jul 27 20:00:31 2005
@@ -144,7 +144,13 @@
{
String[] confs = super.getConfigurations();
List confList = new ArrayList(Arrays.asList(confs));
- confList.add("META-INF/security.xml");
+ confList.add("security-atn.xml");
+ confList.add("security-atz.xml");
+ confList.add("security-managers.xml");
+ confList.add("security-providers.xml");
+ confList.add("security-spi.xml");
+ confList.add("security-spi-atn.xml");
+ confList.add("security-spi-atz.xml");
return (String[]) confList.toArray(new String[1]);
}
Modified: portals/jetspeed-2/trunk/components/security/src/test/org/apache/jetspeed/security/spi/TestCredentialHandler.java
URL: http://svn.apache.org/viewcvs/portals/jetspeed-2/trunk/components/security/src/test/org/apache/jetspeed/security/spi/TestCredentialHandler.java?rev=225674&r1=225673&r2=225674&view=diff
==============================================================================
--- portals/jetspeed-2/trunk/components/security/src/test/org/apache/jetspeed/security/spi/TestCredentialHandler.java (original)
+++ portals/jetspeed-2/trunk/components/security/src/test/org/apache/jetspeed/security/spi/TestCredentialHandler.java Wed Jul 27 20:00:31 2005
@@ -75,7 +75,7 @@
assertEquals(1, privateCredentials.size());
PasswordCredential[] pwdCreds = (PasswordCredential[]) privateCredentials.toArray(new PasswordCredential[1]);
assertEquals("testcred", pwdCreds[0].getUserName());
- assertEquals("password", new String(pwdCreds[0].getPassword()));
+ assertNotNull(new String(pwdCreds[0].getPassword()));
destroyUser();
}
@@ -109,7 +109,7 @@
assertEquals(1, privateCredentials.size());
PasswordCredential[] pwdCreds = (PasswordCredential[]) privateCredentials.toArray(new PasswordCredential[0]);
assertEquals("testcred", pwdCreds[0].getUserName());
- assertEquals("newpassword", new String(pwdCreds[0].getPassword()));
+ assertNotNull(new String(pwdCreds[0].getPassword()));
// Add password credential.
ch.setPassword("testcred","newpassword","anotherpassword");
// Test that the credential was properly set.
Modified: portals/jetspeed-2/trunk/maven-plugin/plugin.jelly
URL: http://svn.apache.org/viewcvs/portals/jetspeed-2/trunk/maven-plugin/plugin.jelly?rev=225674&r1=225673&r2=225674&view=diff
==============================================================================
--- portals/jetspeed-2/trunk/maven-plugin/plugin.jelly (original)
+++ portals/jetspeed-2/trunk/maven-plugin/plugin.jelly Wed Jul 27 20:00:31 2005
@@ -628,8 +628,7 @@
<attainGoal name="war:init" />
<attainGoal name="war:webapp" />
-
-
+
<util:available file="${maven.war.src}/WEB-INF/conf/jetspeed.properties">
<copy file="${maven.war.src}/WEB-INF/conf/jetspeed.properties"
tofile="${maven.war.webapp.dir}/WEB-INF/conf/jetspeed.properties" overwrite="true">
Modified: portals/jetspeed-2/trunk/portal-webapp/src/webapp/WEB-INF/assembly/security-spi.xml
URL: http://svn.apache.org/viewcvs/portals/jetspeed-2/trunk/portal-webapp/src/webapp/WEB-INF/assembly/security-spi.xml?rev=225674&r1=225673&r2=225674&view=diff
==============================================================================
--- portals/jetspeed-2/trunk/portal-webapp/src/webapp/WEB-INF/assembly/security-spi.xml (original)
+++ portals/jetspeed-2/trunk/portal-webapp/src/webapp/WEB-INF/assembly/security-spi.xml Wed Jul 27 20:00:31 2005
@@ -23,7 +23,7 @@
class="org.apache.jetspeed.security.spi.impl.SecurityAccessImpl"
init-method="init"
>
- <constructor-arg ><value>META-INF/security_repository.xml</value></constructor-arg>
+ <constructor-arg ><value>META-INF/ojb/security_repository.xml</value></constructor-arg>
</bean>
<bean id="org.apache.jetspeed.security.spi.SecurityAccess" parent="baseTransactionProxy"
---------------------------------------------------------------------
To unsubscribe, e-mail: jetspeed-dev-unsubscribe@portals.apache.org
For additional commands, e-mail: jetspeed-dev-help@portals.apache.org