Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

refactored authzdb module

  • Loading branch information...
commit 8572dab0f24b8600c72fd4ff9a988dff9101bb8e 1 parent 8b86fc5
BuzzTroll authored
Showing with 371 additions and 52 deletions.
  1. +2 −0  .idea-modules/ec2soap/ec2soap.iml
  2. +1 −1  .idea-modules/query/ec2query.iml
  3. +1 −0  .idea-modules/wrksp-svc/workspace-service.iml
  4. +2 −0  .idea/libraries/cloud_client_libs.xml
  5. +1 −0  .idea/modules.xml
  6. +18 −0 authzdb.iml
  7. +12 −0 authzdb/build.properties
  8. +113 −0 authzdb/build.xml
  9. BIN  authzdb/lib/aopalliance.jar
  10. BIN  authzdb/lib/commons-logging.jar
  11. BIN  authzdb/lib/spring-aop.jar
  12. BIN  authzdb/lib/spring-asm.jar
  13. BIN  authzdb/lib/spring-aspects.jar
  14. BIN  authzdb/lib/spring-beans.jar
  15. BIN  authzdb/lib/spring-context.jar
  16. BIN  authzdb/lib/spring-core.jar
  17. BIN  authzdb/lib/spring-expression.jar
  18. BIN  authzdb/lib/spring-instrument.jar
  19. BIN  authzdb/lib/spring-jdbc.jar
  20. BIN  authzdb/lib/spring-jms.jar
  21. BIN  authzdb/lib/spring-orm.jar
  22. BIN  authzdb/lib/spring-oxm.jar
  23. BIN  authzdb/lib/spring-tx.jar
  24. +90 −36 ...vice/java/source/src/org/globus/workspace/sqlauthz → authzdb/src/org/nimbus/authz}/AuthzDBAdapter.java
  25. +37 −0 authzdb/src/org/nimbus/authz/AuthzDBException.java
  26. +46 −0 authzdb/src/org/nimbus/authz/ObjectWrapper.java
  27. +1 −1  ...e/service/java/source/src/org/globus/workspace/sqlauthz → authzdb/src/org/nimbus/authz}/UserAlias.java
  28. +1 −1  bin/create-nimbus-home
  29. +1 −0  cumulus/cumulus-install.sh
  30. +2 −0  cumulus/src/setup.py
  31. +1 −1  home/sbin/nimbusctl.py
  32. +1 −0  messaging/gt4.0-elastic/java/msgbridge/build.properties
  33. +4 −0 messaging/gt4.0-elastic/java/msgbridge/build.xml
  34. +4 −2 ...-elastic/java/msgbridge/src/org/nimbustools/messaging/gt4_0_elastic/v2008_05_05/image/ServiceImageImpl.java
  35. +1 −0  messaging/query/java/source/build.properties
  36. +3 −0  messaging/query/java/source/build.xml
  37. +1 −1  messaging/query/java/source/etc/query/other/main.xml
  38. +5 −5 messaging/query/java/source/src/org/nimbustools/messaging/query/security/NimbusAuthzUserDetailsService.java
  39. +1 −0  messaging/query/java/source/src/org/nimbustools/messaging/query/v2009_08_15/ElasticService.java
  40. +3 −0  scripts/lib/gt4.0/build/build.properties
  41. +3 −0  scripts/lib/gt4.0/build/build.xml
  42. +5 −0 scripts/lib/gt4.0/dist/build.xml
  43. +1 −0  service/service/java/source/build.properties
  44. +3 −0  service/service/java/source/build.xml
  45. +7 −4 service/service/java/source/src/org/globus/workspace/sqlauthz/AuthzDecisionLogic.java
View
2  .idea-modules/ec2soap/ec2soap.iml
@@ -29,6 +29,8 @@
<SOURCES />
</library>
</orderEntry>
+ <orderEntry type="module" module-name="workspace-service" />
+ <orderEntry type="module" module-name="authzdb" />
</component>
</module>
View
2  .idea-modules/query/ec2query.iml
@@ -22,8 +22,8 @@
<orderEntry type="module" module-name="common" />
<orderEntry type="module" module-name="ec2soap" />
<orderEntry type="library" name="test-libs" level="project" />
- <orderEntry type="module" module-name="workspace-service" />
<orderEntry type="library" name="workspace-service-libs" level="project" />
+ <orderEntry type="module" module-name="authzdb" />
</component>
</module>
View
1  .idea-modules/wrksp-svc/workspace-service.iml
@@ -30,6 +30,7 @@
<orderEntry type="library" name="workspace-service-libs" level="project" />
<orderEntry type="module" module-name="rm-api" />
<orderEntry type="library" name="test-libs" level="project" />
+ <orderEntry type="module" module-name="authzdb" />
</component>
</module>
View
2  .idea/libraries/cloud_client_libs.xml
@@ -5,8 +5,10 @@
<root url="jar://$PROJECT_DIR$/lib/clients/globus_delegation_client.jar!/" />
<root url="jar://$PROJECT_DIR$/lib/clients/globus_delegation_stubs.jar!/" />
<root url="jar://$PROJECT_DIR$/lib/services/commons-cli-2.0.jar!/" />
+ <root url="file://$PROJECT_DIR$/lib/clients" />
</CLASSES>
<JAVADOC />
<SOURCES />
+ <jarDirectory url="file://$PROJECT_DIR$/lib/clients" recursive="false" />
</library>
</component>
View
1  .idea/modules.xml
@@ -2,6 +2,7 @@
<project version="4">
<component name="ProjectModuleManager">
<modules>
+ <module fileurl="file://$PROJECT_DIR$/authzdb.iml" filepath="$PROJECT_DIR$/authzdb.iml" />
<module fileurl="file://$PROJECT_DIR$/.idea-modules/cloud-client/cloud-client.iml" filepath="$PROJECT_DIR$/.idea-modules/cloud-client/cloud-client.iml" />
<module fileurl="file://$PROJECT_DIR$/.idea-modules/protocol-common/common.iml" filepath="$PROJECT_DIR$/.idea-modules/protocol-common/common.iml" group="protocols" />
<module fileurl="file://$PROJECT_DIR$/.idea-modules/ctx/contextualization.iml" filepath="$PROJECT_DIR$/.idea-modules/ctx/contextualization.iml" />
View
18 authzdb.iml
@@ -0,0 +1,18 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<module type="JAVA_MODULE" version="4">
+ <component name="FacetManager">
+ <facet type="Spring" name="Spring">
+ <configuration />
+ </facet>
+ </component>
+ <component name="NewModuleRootManager" inherit-compiler-output="true">
+ <exclude-output />
+ <content url="file://$MODULE_DIR$/authzdb">
+ <sourceFolder url="file://$MODULE_DIR$/authzdb/src" isTestSource="false" />
+ </content>
+ <orderEntry type="inheritedJdk" />
+ <orderEntry type="sourceFolder" forTests="false" />
+ <orderEntry type="library" name="spring-3.0.0 (4)" level="project" />
+ </component>
+</module>
+
View
12 authzdb/build.properties
@@ -0,0 +1,12 @@
+nimbus.authz.main.print-noun=AuthzDB Module
+
+nimbus.authz.main.build.dir=build
+nimbus.authz.main.build.dest=build/classes
+nimbus.authz.main.src.dir=src
+nimbus.authz.main.dist.dir=dist
+nimbus.authz.main.jar.name=nimbus-authzdb.jar
+
+nimbus.authz.main.lib.dir=../lib/services
+
+# you can override this in ~/nimbus.build.properties
+nimbus.java.compilerarg=-nowarn
View
113 authzdb/build.xml
@@ -0,0 +1,113 @@
+<?xml version="1.0"?>
+
+<project default="dist" basedir="." name="Workspace Service">
+
+ <description>Authz DB Module</description>
+
+ <!-- load user nimbus.build.properties file, if it exists -->
+ <property file="${user.home}/nimbus.build.properties"/>
+
+ <!-- load some defaults from colocated build.properties file -->
+ <property file="build.properties"/>
+
+
+ <!-- *******************************************************************
+ MODULE NAME
+ ******************************************************************* -->
+
+ <target name="disp">
+ <echo message="**** Module: ${basedir}" />
+ </target>
+
+
+ <!-- *******************************************************************
+ CHECK MINIMUM JDK
+ ******************************************************************* -->
+
+ <target name="checkjdk">
+ <available property="jdk1.4+" classname="java.lang.CharSequence"/>
+ <fail message="Aborting: determined you are not building with >= JDK 1.4"
+ unless="jdk1.4+" />
+ </target>
+
+
+ <!-- *******************************************************************
+ INITIALIZE
+ ******************************************************************* -->
+
+ <target name="init" depends="checkjdk">
+ <mkdir dir="${nimbus.authz.main.build.dir}"/>
+ <mkdir dir="${nimbus.authz.main.build.dest}"/>
+ <mkdir dir="${nimbus.authz.main.dist.dir}"/>
+ </target>
+
+
+ <!-- *******************************************************************
+ COMPILATION
+ ******************************************************************* -->
+
+ <path id="nimbus.authz.main.classpath">
+ <fileset dir="${nimbus.authz.main.lib.dir}">
+ <include name="*.jar"/>
+ </fileset>
+ </path>
+
+ <target name="compile" depends="init">
+
+ <javac srcdir="${nimbus.authz.main.src.dir}"
+ destdir="${nimbus.authz.main.build.dest}"
+ classpathref="nimbus.authz.main.classpath"
+ debug="on">
+
+ <include name="**/*.java"/>
+ <compilerarg value="${nimbus.java.compilerarg}" />
+
+ </javac>
+
+ <copy todir="${nimbus.authz.main.build.dest}" >
+ <fileset dir="${nimbus.authz.main.src.dir}"
+ includes="**/*.properties" />
+ <fileset dir="${nimbus.authz.main.src.dir}"
+ includes="**/*.xml" />
+ <fileset dir="${nimbus.authz.main.src.dir}"
+ includes="**/*.txt" />
+ </copy>
+
+ </target>
+
+
+ <!-- *******************************************************************
+ CREATE ARCHIVE FILE
+ ******************************************************************* -->
+
+ <target name="jar" depends="compile">
+ <jar destfile="${nimbus.authz.main.dist.dir}/${nimbus.authz.main.jar.name}"
+ basedir="${nimbus.authz.main.build.dest}"/>
+ </target>
+
+
+ <!-- *******************************************************************
+ CREATE DISTRIBUTION
+ ******************************************************************* -->
+
+ <target name="dist">
+ <echo message="**** Module: ${basedir}" />
+ <echo>Building: ${nimbus.authz.main.print-noun}</echo>
+ <antcall target="jar" />
+ <echo>Built: ${nimbus.authz.main.print-noun}
+ </echo>
+ </target>
+
+
+ <!-- *******************************************************************
+ CLEAN
+ ******************************************************************* -->
+
+ <target name="clean">
+ <delete dir="${nimbus.authz.main.build.dir}"/>
+ <delete dir="${nimbus.authz.main.dist.dir}"/>
+ <delete dir="tmp"/>
+ <echo message="Cleaned: ${basedir}" />
+ </target>
+
+</project>
View
BIN  authzdb/lib/aopalliance.jar
Binary file not shown
View
BIN  authzdb/lib/commons-logging.jar
Binary file not shown
View
BIN  authzdb/lib/spring-aop.jar
Binary file not shown
View
BIN  authzdb/lib/spring-asm.jar
Binary file not shown
View
BIN  authzdb/lib/spring-aspects.jar
Binary file not shown
View
BIN  authzdb/lib/spring-beans.jar
Binary file not shown
View
BIN  authzdb/lib/spring-context.jar
Binary file not shown
View
BIN  authzdb/lib/spring-core.jar
Binary file not shown
View
BIN  authzdb/lib/spring-expression.jar
Binary file not shown
View
BIN  authzdb/lib/spring-instrument.jar
Binary file not shown
View
BIN  authzdb/lib/spring-jdbc.jar
Binary file not shown
View
BIN  authzdb/lib/spring-jms.jar
Binary file not shown
View
BIN  authzdb/lib/spring-orm.jar
Binary file not shown
View
BIN  authzdb/lib/spring-oxm.jar
Binary file not shown
View
BIN  authzdb/lib/spring-tx.jar
Binary file not shown
View
126 ...us/workspace/sqlauthz/AuthzDBAdapter.java → .../src/org/nimbus/authz/AuthzDBAdapter.java
@@ -1,9 +1,7 @@
-package org.globus.workspace.sqlauthz;
+package org.nimbus.authz;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
-import org.globus.workspace.Lager;
-import org.globus.workspace.persistence.WorkspaceDatabaseException;
import javax.sql.DataSource;
import java.sql.*;
@@ -33,6 +31,7 @@
private static final String GET_FILE_SIZE = "SELECT object_size FROM objects WHERE id = ?";
private static final String GET_FILE_OWNER = "SELECT owner_id FROM objects WHERE id = ?";
private static final String GET_USER_ALIAS = "SELECT alias_name, friendly_name, alias_type, alias_type_data from user_alias WHERE user_id = ?";
+ private static final String GET_ALL_USER_OBJECTS = "Select id,name,object_size,creation_time from objects where object_type = ? and owner = ?";
public static final int ALIAS_TYPE_S3 = 1;
public static final int ALIAS_TYPE_DN = 2;
@@ -57,20 +56,20 @@ public AuthzDBAdapter(
public String getCanonicalUserIdFromS3(
String name)
- throws WorkspaceDatabaseException
+ throws AuthzDBException
{
return getCanonicalUserIdFromAlias(name, ALIAS_TYPE_S3);
}
public String getCanonicalUserIdFromDn(
String name)
- throws WorkspaceDatabaseException
+ throws AuthzDBException
{
return getCanonicalUserIdFromAlias(name, ALIAS_TYPE_DN);
}
public List<UserAlias> getUserAliases(String userId)
- throws WorkspaceDatabaseException
+ throws AuthzDBException
{
Connection c = null;
PreparedStatement pstmt = null;
@@ -96,7 +95,7 @@ public String getCanonicalUserIdFromDn(
catch(SQLException e)
{
logger.error("",e);
- throw new WorkspaceDatabaseException(e);
+ throw new AuthzDBException(e);
}
finally
{
@@ -121,7 +120,7 @@ public String getCanonicalUserIdFromDn(
public long getFileSize(
int fileId)
- throws WorkspaceDatabaseException
+ throws AuthzDBException
{
Connection c = null;
PreparedStatement pstmt = null;
@@ -135,7 +134,7 @@ public long getFileSize(
rs = pstmt.executeQuery();
if(!rs.next())
{
- throw new WorkspaceDatabaseException("no such file id found " + fileId);
+ throw new AuthzDBException("no such file id found " + fileId);
}
long size = rs.getLong(1);
return size;
@@ -143,7 +142,7 @@ public long getFileSize(
catch(SQLException e)
{
logger.error("",e);
- throw new WorkspaceDatabaseException(e);
+ throw new AuthzDBException(e);
}
finally
{
@@ -167,7 +166,7 @@ public long getFileSize(
public String getFileOwner(
int fileId)
- throws WorkspaceDatabaseException
+ throws AuthzDBException
{
Connection c = null;
PreparedStatement pstmt = null;
@@ -181,7 +180,7 @@ public String getFileOwner(
rs = pstmt.executeQuery();
if(!rs.next())
{
- throw new WorkspaceDatabaseException("no such file id found " + fileId);
+ throw new AuthzDBException("no such file id found " + fileId);
}
String owner = rs.getString(1);
return owner;
@@ -189,7 +188,7 @@ public String getFileOwner(
catch(SQLException e)
{
logger.error("",e);
- throw new WorkspaceDatabaseException(e);
+ throw new AuthzDBException(e);
}
finally
{
@@ -215,7 +214,7 @@ public boolean canStore(
long fileSize,
String canUser,
int objectType)
- throws WorkspaceDatabaseException
+ throws AuthzDBException
{
Connection c = null;
PreparedStatement pstmt = null;
@@ -254,7 +253,7 @@ public boolean canStore(
catch(SQLException e)
{
logger.error("",e);
- throw new WorkspaceDatabaseException(e);
+ throw new AuthzDBException(e);
}
finally
{
@@ -281,7 +280,7 @@ private int getParentObject(
Connection c,
String objectName,
int objectType)
- throws WorkspaceDatabaseException, SQLException
+ throws AuthzDBException, SQLException
{
PreparedStatement pstmt = null;
@@ -296,7 +295,7 @@ private int getParentObject(
{
logger.debug("pstmt " + pstmt.toString());
pstmt.close();
- throw new WorkspaceDatabaseException("no such parent file found " + objectName + " " + objectType);
+ throw new AuthzDBException("no such parent file found " + objectName + " " + objectType);
}
int objectId = rs.getInt(1);
return objectId;
@@ -317,9 +316,64 @@ private int getParentObject(
}
}
+
+ public List<ObjectWrapper> getAllUsersFiles(
+ String canonicalUser)
+ throws AuthzDBException
+ {
+ Connection c = null;
+ PreparedStatement pstmt = null;
+
+ try
+ {
+ c = getConnection();
+ pstmt = c.prepareStatement(GET_ALL_USER_OBJECTS);
+ pstmt.setInt(1, OBJECT_TYPE_S3);
+ pstmt.setString(2, canonicalUser);
+
+ ResultSet rs = pstmt.executeQuery();
+
+ final List<ObjectWrapper> objs = new ArrayList<ObjectWrapper>();
+
+ while(rs.next())
+ {
+ ObjectWrapper ow = new ObjectWrapper();
+ ow.setName(rs.getString("name"));
+ ow.setId(rs.getInt("id"));
+ ow.setSize(rs.getInt("object_size"));
+ objs.add(ow);
+ }
+ return objs;
+ }
+ catch(SQLException e)
+ {
+ logger.error("",e);
+ throw new AuthzDBException(e);
+ }
+ finally
+ {
+ try
+ {
+ if (pstmt != null)
+ {
+ pstmt.close();
+ }
+ if (c != null)
+ {
+ returnConnection(c);
+ }
+ }
+ catch (SQLException sql)
+ {
+ logger.error("SQLException in finally cleanup", sql);
+ }
+ }
+
+ }
+
public String getDataKey(
int objectId)
- throws WorkspaceDatabaseException
+ throws AuthzDBException
{
Connection c = null;
PreparedStatement pstmt = null;
@@ -332,7 +386,7 @@ public String getDataKey(
ResultSet rs = pstmt.executeQuery();
if(!rs.next())
{
- throw new WorkspaceDatabaseException("no such file id found " + objectId);
+ throw new AuthzDBException("no such file id found " + objectId);
}
String dataKey = rs.getString(1);
return dataKey;
@@ -340,7 +394,7 @@ public String getDataKey(
catch(SQLException e)
{
logger.error("",e);
- throw new WorkspaceDatabaseException(e);
+ throw new AuthzDBException(e);
}
finally
{
@@ -368,7 +422,7 @@ public int newFile(
String canonicalUser,
String dataKey,
int objectType)
- throws WorkspaceDatabaseException
+ throws AuthzDBException
{
Connection c = null;
PreparedStatement pstmt = null;
@@ -387,7 +441,7 @@ public int newFile(
int rc = pstmt.executeUpdate();
if(rc != 1)
{
- throw new WorkspaceDatabaseException("did not insert the row properly");
+ throw new AuthzDBException("did not insert the row properly");
}
int fileId = this.getFileID(fileName, parentId, objectType, c);
@@ -406,7 +460,7 @@ public int newFile(
rc = pstmt.executeUpdate();
if(rc != 1)
{
- throw new WorkspaceDatabaseException("did not insert the row properly");
+ throw new AuthzDBException("did not insert the row properly");
}
}
return fileId;
@@ -414,7 +468,7 @@ public int newFile(
catch(SQLException e)
{
logger.error("an error occured looking up the file ", e);
- throw new WorkspaceDatabaseException(e);
+ throw new AuthzDBException(e);
}
finally
{
@@ -440,7 +494,7 @@ public int getFileID(
String fileName,
int parentId,
int objectType)
- throws WorkspaceDatabaseException
+ throws AuthzDBException
{
Connection c = null;
try
@@ -451,7 +505,7 @@ public int getFileID(
catch(SQLException e)
{
logger.error("an error occured looking up the file ", e);
- throw new WorkspaceDatabaseException(e);
+ throw new AuthzDBException(e);
}
finally
{
@@ -465,7 +519,7 @@ public int getFileID(
int parentId,
int objectType,
Connection c)
- throws WorkspaceDatabaseException
+ throws AuthzDBException
{
PreparedStatement pstmt = null;
@@ -491,7 +545,7 @@ public int getFileID(
catch(SQLException e)
{
logger.error("an error occured looking up the file ", e);
- throw new WorkspaceDatabaseException(e);
+ throw new AuthzDBException(e);
}
finally
{
@@ -513,7 +567,7 @@ public int getFileID(
public String getPermissions(
int objectId,
String userId)
- throws WorkspaceDatabaseException
+ throws AuthzDBException
{
Connection c = null;
PreparedStatement pstmt = null;
@@ -537,7 +591,7 @@ public String getPermissions(
catch(SQLException e)
{
logger.error("",e);
- throw new WorkspaceDatabaseException(e);
+ throw new AuthzDBException(e);
}
finally
{
@@ -562,7 +616,7 @@ public String getPermissions(
public void setFileSize(
int objectId,
long size)
- throws WorkspaceDatabaseException
+ throws AuthzDBException
{
Connection c = null;
PreparedStatement pstmt = null;
@@ -577,13 +631,13 @@ public void setFileSize(
int rc = pstmt.executeUpdate();
if(rc != 1)
{
- throw new WorkspaceDatabaseException("did not insert the row properly");
+ throw new AuthzDBException("did not insert the row properly");
}
}
catch(SQLException e)
{
logger.error("an error occured looking up the file ", e);
- throw new WorkspaceDatabaseException(e);
+ throw new AuthzDBException(e);
}
finally
{
@@ -609,7 +663,7 @@ public void setFileSize(
public String getCanonicalUserIdFromAlias(
String name,
int type)
- throws WorkspaceDatabaseException
+ throws AuthzDBException
{
Connection c = null;
PreparedStatement pstmt = null;
@@ -625,7 +679,7 @@ public String getCanonicalUserIdFromAlias(
if(!rs.next())
{
- throw new WorkspaceDatabaseException("no such user found " + name);
+ throw new AuthzDBException("no such user found " + name);
}
String canUserId = rs.getString(1);
@@ -635,7 +689,7 @@ public String getCanonicalUserIdFromAlias(
catch(SQLException e)
{
logger.error("",e);
- throw new WorkspaceDatabaseException(e);
+ throw new AuthzDBException(e);
}
finally
{
View
37 authzdb/src/org/nimbus/authz/AuthzDBException.java
@@ -0,0 +1,37 @@
+package org.nimbus.authz;
+
+/**
+ * Created by John Bresnahan
+ * User: bresnaha
+ * Date: Jun 14, 2010
+ * Time: 1:47:33 PM
+ * <p/>
+ * org.nimbus.authz
+ */
+public class AuthzDBException extends Exception
+{
+ public AuthzDBException()
+ {
+ super();
+ }
+
+ public AuthzDBException(String message)
+ {
+ super(message);
+ }
+
+ public AuthzDBException(String message, Exception e)
+ {
+ super(message, e);
+ }
+
+ public AuthzDBException(String message, Throwable e)
+ {
+ super(message, e);
+ }
+
+ public AuthzDBException(Exception e)
+ {
+ super("", e);
+ }
+}
View
46 authzdb/src/org/nimbus/authz/ObjectWrapper.java
@@ -0,0 +1,46 @@
+package org.nimbus.authz;
+
+/**
+ * Created by John Bresnahan
+ * User: bresnaha
+ * Date: Jun 14, 2010
+ * Time: 10:33:58 PM
+ * <p/>
+ * org.nimbus.authz
+ */
+public class ObjectWrapper
+{
+ private String name;
+ private int id;
+ private long size;
+
+ public void setName(String n)
+ {
+ this.name = n;
+ }
+
+ public long getSize()
+ {
+ return this.size;
+ }
+
+ public void setSize(long s)
+ {
+ this.size = s;
+ }
+
+ public String getName()
+ {
+ return this.name;
+ }
+
+ public void setId(int i)
+ {
+ this.id = i;
+ }
+
+ public int getId()
+ {
+ return this.id;
+ }
+}
View
2  .../globus/workspace/sqlauthz/UserAlias.java → authzdb/src/org/nimbus/authz/UserAlias.java
@@ -13,7 +13,7 @@
* License for the specific language governing permissions and limitations
* under the License.
*/
-package org.globus.workspace.sqlauthz;
+package org.nimbus.authz;
public class UserAlias {
View
2  bin/create-nimbus-home
@@ -73,7 +73,7 @@ if [ ! -d $NIMBUS_HOME ]; then
fi
echo "Installing cumulus..."
-${NIMBUS_SRC}/cumulus/install.sh $NIMBUS_HOME/cumulus
+${NIMBUS_SRC}/cumulus/cumulus-install.sh $NIMBUS_HOME/cumulus
if [ $? -ne 0 ]; then
echo "Failed to install cumulus"
exit 1
View
1  cumulus/cumulus-install.sh
@@ -26,5 +26,6 @@ if [ -e $HOME/.nimbus/cumulus.ini ]; then
mv $HOME/.nimbus/cumulus.ini $bkup
fi
+cd $source_dir
./configure --prefix=$installdir
make install
View
2  cumulus/src/setup.py
@@ -24,6 +24,8 @@
'cumulus-remove-user = pycb.tools.remove_user:main',
'cumulus-list-users = pycb.tools.list_users:main',
'cumulus-quota = pycb.tools.set_quota:main',
+ 'nimbusauthz-add-user = pynimbusauthz.add_user:main',
+ 'nimbusauthz-list-users = pynimbusauthz.list_user:main',
]
},
View
2  home/sbin/nimbusctl.py
@@ -89,7 +89,7 @@
CUMULUS_HOME = NIMBUS_HOME + "/cumulus"
if cumulus_enabled:
- CUMULUS_SERVICE_EXE = os.path.join(NIMBUS_HOME, "cumulus/bin/cumulus.sh")
+ CUMULUS_SERVICE_EXE = os.path.join(NIMBUS_HOME, "cumulus/bin/cumulus")
if not os.path.exists(CUMULUS_SERVICE_EXE):
sys.exit("The services executable does not exist: " +
CUMULUS_SERVICE_EXE)
View
1  messaging/gt4.0-elastic/java/msgbridge/build.properties
@@ -11,6 +11,7 @@ nimbus.messaging.gt4_0-elastic.lib.dir=../../../../lib/services
# Dependencies from source tree
nimbus.messaging.gt4_0.common.dist.dir=../../../gt4.0/java/common/dist/
nimbus.service.api.dist.dir=../../../../service-api/java/source/dist/
+nimbus.authzdb.dist.dir=../../../../authzdb/dist/
# (gar is the 'dist' of stubs but we only want the jars... will be better later)
vws.gt4_0.stubs.build.lib.dir=../stubs/build/lib/
View
4 messaging/gt4.0-elastic/java/msgbridge/build.xml
@@ -69,6 +69,10 @@
<fileset dir="${nimbus.service.api.dist.dir}">
<include name="*.jar"/>
</fileset>
+
+ <fileset dir="${nimbus.authzdb.dist.dir}">
+ <include name="*.jar"/>
+ </fileset>
</path>
<target name="compile" depends="init">
View
6 ...ridge/src/org/nimbustools/messaging/gt4_0_elastic/v2008_05_05/image/ServiceImageImpl.java
@@ -280,15 +280,16 @@ private static String cleanLocationBase(String givenLocationBase) {
throw new IllegalArgumentException("empty givenLocationBase");
}
+ // XXX it seems historically this could only be gsiftp so the exception will always trip
URL url = null;
try {
url = new URL(givenLocationBase);
} catch (MalformedURLException e) {
- // gsiftp is an unknown scheme for Java
+ // CUMULUS is an unknown scheme for Java
// replace just gsiftp and check URL
String newTestURL = givenLocationBase.trim();
- if (newTestURL.startsWith("gsiftp")) {
+ if (newTestURL.startsWith("cumulus")) {
newTestURL = newTestURL.replaceFirst("gsiftp", "http");
try {
url = new URL(newTestURL);
@@ -304,6 +305,7 @@ private static String cleanLocationBase(String givenLocationBase) {
"invalid givenLocationBase? (no url)");
}
+ // This will be http now? i am confused
final String scheme = url.getProtocol();
if (scheme == null) {
throw new IllegalArgumentException(
View
1  messaging/query/java/source/build.properties
@@ -12,6 +12,7 @@ nimbus.messaging.query.lib.dir=../../../../lib/services
nimbus.messaging.gt4_0.common.dist.dir=../../../gt4.0/java/common/dist/
nimbus.messaging.gt4_0-elastic.dist.dir=../../../gt4.0-elastic/java/msgbridge/dist/
nimbus.service.api.dist.dir=../../../../service-api/java/source/dist/
+nimbus.authzdb.dist.dir=../../../../authzdb/dist/
nimbus.service.dist.dir=../../../../service/service/java/source/dist/
# (gar is the 'dist' of stubs but we only want the jars... will be better later)
View
3  messaging/query/java/source/build.xml
@@ -78,6 +78,9 @@
<include name="*.jar"/>
</fileset>
+ <fileset dir="${nimbus.authzdb.dist.dir}">
+ <include name="*.jar"/>
+ </fileset>
</path>
<target name="compile" depends="init">
View
2  messaging/query/java/source/etc/query/other/main.xml
@@ -63,7 +63,7 @@ http://cxf.apache.org/schemas/jaxrs.xsd">
<property name="password" value="nimbus"/>
</bean>
- <bean id="authzDBAdapter" class="org.globus.workspace.sqlauthz.AuthzDBAdapter">
+ <bean id="authzDBAdapter" class="org.nimbus.authz.AuthzDBAdapter">
<constructor-arg ref="other.AuthzDataSource"/>
</bean>
View
10 ...va/source/src/org/nimbustools/messaging/query/security/NimbusAuthzUserDetailsService.java
@@ -17,9 +17,9 @@
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
-import org.globus.workspace.persistence.WorkspaceDatabaseException;
-import org.globus.workspace.sqlauthz.AuthzDBAdapter;
-import org.globus.workspace.sqlauthz.UserAlias;
+import org.nimbus.authz.AuthzDBAdapter;
+import org.nimbus.authz.AuthzDBException;
+import org.nimbus.authz.UserAlias;
import org.springframework.beans.factory.InitializingBean;
import org.springframework.dao.DataAccessException;
import org.springframework.security.core.userdetails.UsernameNotFoundException;
@@ -82,7 +82,7 @@ public QueryUser loadUserByUsername(String username)
return new QueryUser(username,secret, dn);
- } catch (WorkspaceDatabaseException e) {
+ } catch (AuthzDBException e) {
throw new UsernameNotFoundException("Failed to retrieve credentials for access ID " + username, e);
}
}
@@ -121,7 +121,7 @@ public QueryUser loadUserByDn(String dn)
return new QueryUser(accessId, secret, dn);
- } catch (WorkspaceDatabaseException e) {
+ } catch (AuthzDBException e) {
throw new UsernameNotFoundException("Failed to retrieve query credentials for DN '" + dn + "'", e);
}
}
View
1  ...ing/query/java/source/src/org/nimbustools/messaging/query/v2009_08_15/ElasticService.java
@@ -57,6 +57,7 @@ public ElasticService(ServiceRM serviceRM, ServiceGeneral serviceGeneral,
throw new IllegalArgumentException("serviceSecurity may not be null");
}
+ logger.debug("Elastic Service creation");
this.serviceRM = serviceRM;
this.serviceGeneral = serviceGeneral;
this.serviceImage = serviceImage;
View
3  scripts/lib/gt4.0/build/build.properties
@@ -39,5 +39,8 @@ nimbus.autocommon.gt4_0.builddir=${nimbus.basedir}/autocommon/
# Context broker makes its own GAR
nimbus.ctx-broker.gt4_0.builddir=${nimbus.basedir}/ctx-broker/
+# GT4.0.x wizard implementation has dep on autocommon
+nimbus.authzdb.builddir=${nimbus.basedir}/authzdb
+
# you can override this in ~/nimbus.build.properties
nimbus.java.compilerarg=-nowarn
View
3  scripts/lib/gt4.0/build/build.xml
@@ -66,6 +66,7 @@
<ant dir="${nimbus.messaging.query.service.builddir}" target="clean" />
<ant dir="${nimbus.messaging.rest.builddir}" target="clean" />
<ant dir="${nimbus.ctx-broker.gt4_0.builddir}" target="clean" />
+ <ant dir="${nimbus.authzdb.builddir}" target="clean" />
</target>
@@ -130,6 +131,7 @@
<echo>Building default Nimbus-for-GT4.0 packages:
</echo>
+ <ant dir="${nimbus.authzdb.builddir}" target="dist" />
<ant dir="${nimbus.autocommon.gt4_0.builddir}" target="dist" /> <!-- dep -->
<antcall target="dist-service-api" />
<antcall target="dist-default-services" />
@@ -213,6 +215,7 @@
<echo>Default clients-only installation to GT4.0 GLOBUS_LOCATION:
</echo>
+ <ant dir="${nimbus.authzdb.builddir}" target="dist" />
<ant dir="${nimbus.messaging.gt4_0.schemas.builddir}" target="deploy" />
<ant dir="${nimbus.messaging.gt4_0.stubs.builddir}" target="deploy" />
<ant dir="${nimbus.messaging.gt4_0.client.builddir}" target="deploy" />
View
5 scripts/lib/gt4.0/dist/build.xml
@@ -97,6 +97,9 @@
<include name="*"/>
</fileset>
</chmod>
+ <copy todir="${distbuild.dir}/${nimbus.main}/authzdb">
+ <fileset dir="${nimbus.basedir}/authzdb"/>
+ </copy>
<copy todir="${distbuild.dir}/${nimbus.main}/autocommon">
<fileset dir="${nimbus.basedir}/autocommon"/>
</copy>
@@ -140,6 +143,7 @@
<exclude name="${nimbus.main}/scripts/*sh" />
<include name="${nimbus.main}/bin/**"/>
<exclude name="${nimbus.main}/bin/*"/>
+ <include name="${nimbus.main}/authzdb/**"/>
<include name="${nimbus.main}/autocommon/**"/>
<include name="${nimbus.main}/autoconfiguration/**"/>
<include name="${nimbus.main}/ctx-broker/**"/>
@@ -147,6 +151,7 @@
<exclude name="${nimbus.main}/home/bin/*"/>
<exclude name="${nimbus.main}/home/sbin/*"/>
<include name="${nimbus.main}/lib/**"/>
+ <include name="${nimbus.main}/authzdb/**"/>
<include name="${nimbus.main}/messaging/**"/>
<include name="${nimbus.main}/monitoring/**"/>
<include name="${nimbus.main}/metadata/**"/>
View
1  service/service/java/source/build.properties
@@ -10,6 +10,7 @@ nimbus.service.main.lib.dir=../../../../lib/services
# Compile dependencies from source tree
nimbus.service.api.dist.dir=../../../../service-api/java/source/dist/
+nimbus.authz.dist.dir=../../../../authzdb/dist
# you can override this in ~/nimbus.build.properties
nimbus.java.compilerarg=-nowarn
View
3  service/service/java/source/build.xml
@@ -53,6 +53,9 @@
<fileset dir="${nimbus.service.api.dist.dir}">
<include name="*.jar"/>
</fileset>
+ <fileset dir="${nimbus.authz.dist.dir}">
+ <include name="*.jar"/>
+ </fileset>
</path>
<target name="compile" depends="init">
View
11 service/service/java/source/src/org/globus/workspace/sqlauthz/AuthzDecisionLogic.java
@@ -10,6 +10,9 @@
import org.globus.workspace.service.binding.vm.VirtualMachinePartition;
import org.nimbustools.api.services.rm.AuthorizationException;
import org.nimbustools.api.services.rm.ResourceRequestDeniedException;
+import org.nimbus.authz.AuthzDBAdapter;
+import org.nimbus.authz.AuthzDBException;
+
import javax.sql.DataSource;
import java.io.File;
@@ -93,7 +96,7 @@ protected String translateCumulus(
return rc;
}
- catch(WorkspaceDatabaseException wsdbex)
+ catch(AuthzDBException wsdbex)
{
logger.error("iternal db problem", wsdbex);
throw new AuthorizationException("Internal problem with the data base " + wsdbex.toString());
@@ -158,7 +161,7 @@ protected String translateCumulus(
return rc;
}
- catch(WorkspaceDatabaseException wsdbex)
+ catch(AuthzDBException wsdbex)
{
logger.error("trouble looking up the cumulus information ", wsdbex);
throw new AuthorizationException("Trouble with the database " + wsdbex.toString());
@@ -311,7 +314,7 @@ private long checkUrl(
return size;
}
- catch(WorkspaceDatabaseException wsdbex)
+ catch(AuthzDBException wsdbex)
{
logger.error("iternal db problem", wsdbex);
throw new AuthorizationException("Internal problem with the data base " + wsdbex.toString());
@@ -405,7 +408,7 @@ public void unpropagationFinished(
{
throw new WorkspaceException("Authorization exception occured ", authex);
}
- catch(WorkspaceDatabaseException wsdbex)
+ catch(AuthzDBException wsdbex)
{
throw new WorkspaceException("Workspace database exception occured ", wsdbex);
}
Please sign in to comment.
Something went wrong with that request. Please try again.