Permalink
Browse files

Minor rest fixes.

  • Loading branch information...
1 parent ed62140 commit 1a75077b622221277c38bddbeb6514adc8b0a303 @labisso labisso committed Feb 22, 2010
View
2 messaging/rest/java/source/build.properties
@@ -15,7 +15,7 @@ nimbus.messaging.gt4_0.common.lib.dir=../../../gt4.0/java/common/lib/
nimbus.messaging.gt4_0.common.dist.dir=../../../gt4.0/java/common/dist/
nimbus.messaging.query.lib.dir=../../../query/java/source/lib/
nimbus.service.api.lib.dir=../../../../service-api/java/source/lib/
-
+nimbus.autocommon.dist.dir=../../../../autocommon/dist
# you can override this in ~/nimbus.build.properties
nimbus.java.compilerarg=-nowarn
View
6 messaging/rest/java/source/build.xml
@@ -61,9 +61,9 @@
<include name="*.jar"/>
</fileset>
- <!--<fileset dir="${nimbus.messaging.gt4_0.common.dist.dir}">
+ <fileset dir="${nimbus.autocommon.dist.dir}">
<include name="*.jar"/>
- </fileset> -->
+ </fileset>
<fileset dir="${nimbus.service.api.lib.dir}">
<include name="*.jar"/>
@@ -157,7 +157,7 @@
<java classname="org.nimbustools.messaging.rest.RestHttp"
fork="true">
<classpath refid="nimbus.messaging.rest.classpath"/>
- <arg file="etc/rest/other/main.xml"/>
+ <arg file="etc/rest/other/main-fake.xml"/>
<arg value="4443"/>
<arg value="${nimbus.messaging.rest.testserver.keystore.dest}"/>
<arg value="${nimbus.messaging.rest.testserver.keystore.pass}"/>
View
77 messaging/rest/java/source/etc/rest/other/main-fake.xml
@@ -0,0 +1,77 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<beans xmlns="http://www.springframework.org/schema/beans"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xmlns:jaxrs="http://cxf.apache.org/jaxrs"
+ xmlns:aop="http://www.springframework.org/schema/aop"
+ xmlns:security="http://www.springframework.org/schema/security"
+ xsi:schemaLocation="
+http://www.springframework.org/schema/beans
+http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
+http://www.springframework.org/schema/aop
+http://www.springframework.org/schema/aop/spring-aop.xsd
+http://www.springframework.org/schema/security
+http://www.springframework.org/schema/security/spring-security-3.0.xsd
+http://cxf.apache.org/jaxrs
+http://cxf.apache.org/schemas/jaxrs.xsd">
+
+ <import resource="classpath:META-INF/cxf/cxf.xml" />
+ <import resource="classpath:META-INF/cxf/cxf-extension-jaxrs-binding.xml" />
+ <import resource="classpath:META-INF/cxf/cxf-servlet.xml" />
+
+ <security:http auto-config="true">
+ <security:http-basic/>
+ <security:intercept-url pattern="/**" access="ROLE_ADMIN"/>
+ </security:http>
+
+ <security:authentication-manager>
+ <security:authentication-provider>
+ <security:user-service>
+ <security:user name="testadmin" password="secret" authorities="ROLE_ADMIN"/>
+ <security:user name="testuser" password="secret" authorities="ROLE_USER"/>
+ </security:user-service>
+ </security:authentication-provider>
+ </security:authentication-manager>
+
+ <jaxrs:server id="NimbusRestServer"
+ address="/">
+ <jaxrs:serviceBeans>
+ <ref bean="adminResource"/>
+ </jaxrs:serviceBeans>
+ <jaxrs:providers>
+ <ref bean="nimbusWebExceptionMapper"/>
+ </jaxrs:providers>
+ <jaxrs:outFaultInterceptors>
+ <ref bean="outFaultInterceptor"/>
+ </jaxrs:outFaultInterceptors>
+ <jaxrs:properties>
+ <entry key="org.apache.cxf.propogate.exception" value="false"/>
+ </jaxrs:properties>
+ </jaxrs:server>
+
+
+ <bean id="outFaultInterceptor" class="org.nimbustools.messaging.rest.OutFaultInterceptor">
+ <property name="responseUtil" ref="responseUtil"/>
+ </bean>
+ <bean id="nimbusWebExceptionMapper"
+ class="org.nimbustools.messaging.rest.NimbusWebExceptionMapper">
+ <property name="responseUtil" ref="responseUtil"/>
+ </bean>
+
+ <bean id="adminResource" class="org.nimbustools.messaging.rest.AdminResource">
+ <property name="responseUtil" ref="responseUtil"/>
+ <property name="usersResource" ref="usersResource"/>
+ </bean>
+
+ <bean id="usersResource" class="org.nimbustools.messaging.rest.UsersResource">
+ <property name="usersService" ref="fakeUsersService"/>
+ <property name="responseUtil" ref="responseUtil"/>
+ </bean>
+
+ <bean id="fakeUsersService" class="org.nimbustools.messaging.rest.FakeUsersService"/>
+
+ <bean id="responseUtil" class="org.nimbustools.messaging.rest.ResponseUtil"/>
+
+
+</beans>
+
View
6 messaging/rest/java/source/src/org/nimbustools/messaging/rest/GridmapUsersService.java
@@ -20,8 +20,8 @@
import org.nimbustools.auto_common.ezpz_ca.HashUtil;
import org.springframework.core.io.Resource;
import org.springframework.beans.factory.InitializingBean;
+import org.springframework.security.core.codec.Base64;
import org.mortbay.util.QuotedStringTokenizer;
-import org.globus.util.Base64;
import javax.crypto.KeyGenerator;
import javax.crypto.SecretKey;
@@ -118,7 +118,7 @@ public User addUser(User user) throws DuplicateUserException {
"' already exists in gridmap");
}
- final String gridmapLine = dn +" " + this.localUserName;
+ final String gridmapLine = "\""+ dn +"\" " + this.localUserName;
appendLineToResource(gridmapResource, gridmapLine);
if (groupAuthzResource != null) {
appendLineToResource(groupAuthzResource, gridmapLine);
@@ -288,6 +288,8 @@ public void afterPropertiesSet() throws Exception {
if (this.localUserName == null || this.localUserName.trim().length() == 0) {
this.localUserName = DEFAULT_LOCAL_USERNAME;
}
+
+ this.initialize();
}
static String getUserId(String dn) {

0 comments on commit 1a75077

Please sign in to comment.