Commit 0a5a738e authored by Patrick Dowler's avatar Patrick Dowler
Browse files

Merge branch 'master' of ssh://gimli2/srv/cadc/git/ac

parents 1769bdf7 2c76373b
......@@ -93,6 +93,7 @@
<!-- JAR files to be included in classpath and war file -->
<property name="cadcAC" value="${lib}/cadcAccessControl.jar"/>
<property name="cadcAC-Server" value="${lib}/cadcAccessControl-Server.jar"/>
<property name="cadcReg" value="${lib}/cadcRegistry.jar"/>
<property name="cadcLog" value="${lib}/cadcLog.jar"/>
<property name="cadcUtil" value="${lib}/cadcUtil.jar"/>
<property name="log4j" value="${ext.lib}/log4j.jar"/>
......@@ -102,16 +103,21 @@
<property name="mail" value="${ext.lib}/mail.jar"/>
<property name="cadc" value="${cadcAC}:${cadcAC-Server}:${cadcUtil}"/>
<property name="client.cadc.jars" value="${cadcAC}:${cadcAC-Server}:${cadcLog}:${cadcUtil}"/>
<property name="client.cadc.jars" value="${cadcAC}:${cadcAC-Server}:${cadcLog}:${cadcUtil}:${cadcReg}"/>
<property name="client.external.jars" value="${unboundid}:${log4j}:${servlet-api}:${mail}"/>
<property name="jars" value="${cadc}:${client.cadc.jars}:${client.external.jars}"/>
<target name="build" depends="compile,manifest">
<target name="copyResources" depends="compile">
<copy overwrite="true"
file="${env.A}/etc/LocalAuthority.properties"
tofile="${build}/class/LocalAuthority.properties"/>
</target>
<target name="build" depends="compile,copyResources,manifest">
<jar jarfile="${build}/lib/${project}.jar"
basedir="${build}/class" update="no"
manifest="${build}/tmp/${project}.mf">
<include name="ca/nrc/cadc/**"/>
</jar>
</target>
......
package ca.nrc.cadc.auth;
import java.io.File;
import java.net.MalformedURLException;
import java.net.URI;
import java.net.URL;
import java.security.Principal;
......@@ -20,6 +19,7 @@ import org.apache.log4j.Logger;
import ca.nrc.cadc.ac.User;
import ca.nrc.cadc.ac.client.UserClient;
import ca.nrc.cadc.profiler.Profiler;
import ca.nrc.cadc.reg.Standards;
import ca.nrc.cadc.reg.client.LocalAuthority;
import ca.nrc.cadc.reg.client.RegistryClient;
import ca.nrc.cadc.vosi.avail.CheckResource;
......@@ -109,7 +109,7 @@ public class ACIdentityManager implements IdentityManager
public NumericPrincipal run() throws Exception
{
LocalAuthority localAuth = new LocalAuthority();
URI serviceURI = localAuth.getServiceURI("ums");
URI serviceURI = localAuth.getServiceURI(Standards.UMS_USERS_01.toString());
UserClient userClient = new UserClient(serviceURI);
User newUser = userClient.createUser(x500Principal);
......@@ -205,7 +205,7 @@ public class ACIdentityManager implements IdentityManager
public Object run() throws Exception
{
LocalAuthority localAuth = new LocalAuthority();
URI serviceURI = localAuth.getServiceURI("ums");
URI serviceURI = localAuth.getServiceURI(Standards.UMS_USERS_01.toString());
UserClient userClient = new UserClient(serviceURI);
userClient.augmentSubject(subject);
......@@ -231,17 +231,10 @@ public class ACIdentityManager implements IdentityManager
*/
public static CheckResource getAvailabilityCheck()
{
try
{
RegistryClient regClient = new RegistryClient();
LocalAuthority localAuth = new LocalAuthority();
URI serviceURI = localAuth.getServiceURI("gms");
URL availURL = regClient.getServiceURL(serviceURI, "http", "/availability");
return new CheckWebService(availURL.toExternalForm());
}
catch (MalformedURLException e)
{
throw new RuntimeException(e);
}
RegistryClient regClient = new RegistryClient();
LocalAuthority localAuth = new LocalAuthority();
URI serviceURI = localAuth.getServiceURI(Standards.GMS_GROUPS_01.toString());
URL availURL = regClient.getServiceURL(serviceURI, Standards.VOSI_AVAILABILITY, AuthMethod.ANON);
return new CheckWebService(availURL.toExternalForm());
}
}
package ca.nrc.cadc.auth;
import java.net.MalformedURLException;
import java.net.URI;
import java.net.URL;
......@@ -10,6 +9,7 @@ import javax.security.auth.x500.X500Principal;
import org.apache.log4j.Logger;
import ca.nrc.cadc.profiler.Profiler;
import ca.nrc.cadc.reg.Standards;
import ca.nrc.cadc.reg.client.LocalAuthority;
import ca.nrc.cadc.reg.client.RegistryClient;
import ca.nrc.cadc.vosi.avail.CheckResource;
......@@ -69,17 +69,10 @@ public class AuthenticatorImpl implements Authenticator
public static CheckResource getAvailabilityCheck()
{
try
{
RegistryClient regClient = new RegistryClient();
LocalAuthority localAuth = new LocalAuthority();
URI serviceURI = localAuth.getServiceURI("gms");
URL availURL = regClient.getServiceURL(serviceURI, "http", "/availability");
return new CheckWebService(availURL.toExternalForm());
}
catch (MalformedURLException e)
{
throw new RuntimeException(e);
}
RegistryClient regClient = new RegistryClient();
LocalAuthority localAuth = new LocalAuthority();
URI serviceURI = localAuth.getServiceURI(Standards.GMS_GROUPS_01.toString());
URL availURL = regClient.getServiceURL(serviceURI, Standards.VOSI_AVAILABILITY, AuthMethod.ANON);
return new CheckWebService(availURL.toExternalForm());
}
}
......@@ -116,8 +116,8 @@
<copy overwrite="true" file="test/LdapConfig.test.properties"
todir="${user.home}/config/"/>
<copy overwrite="true"
file="${env.CADC_PREFIX}/etc/LocalAuthority.properties"
tofile="${build}/class/LocalAuthority.properties"/>
file="${env.A}/etc/LocalAuthority.properties"
todir="${build}/test/class/"/>
</target>
<!-- JAR files needed to run the test suite -->
......
......@@ -100,6 +100,7 @@ import ca.nrc.cadc.auth.HttpPrincipal;
import ca.nrc.cadc.auth.NumericPrincipal;
import ca.nrc.cadc.net.TransientException;
import ca.nrc.cadc.profiler.Profiler;
import ca.nrc.cadc.reg.Standards;
import ca.nrc.cadc.reg.client.LocalAuthority;
import ca.nrc.cadc.util.ObjectUtil;
import ca.nrc.cadc.util.StringUtil;
......@@ -739,7 +740,7 @@ public class LdapUserDAO extends LdapDAO
// cache memberOf values in the user
LocalAuthority localAuthority = new LocalAuthority();
URI gmsServiceURI = localAuthority.getServiceURI("gms");
URI gmsServiceURI = localAuthority.getServiceURI(Standards.GMS_GROUPS_01.toString());
GroupMemberships gms = new GroupMemberships(gmsServiceURI.toString(), userID);
user.appData = gms; // add even if empty
......@@ -1277,7 +1278,7 @@ public class LdapUserDAO extends LdapDAO
{
UUID uuid = new UUID(0L, Long.parseLong(numericID));
LocalAuthority localAuthority = new LocalAuthority();
URI umsServiceURI = localAuthority.getServiceURI("ums");
URI umsServiceURI = localAuthority.getServiceURI(Standards.UMS_REQS_01.toString());
String uriString = umsServiceURI.toString() + "?" + uuid.toString();
URI uri;
try
......
......@@ -79,6 +79,8 @@ import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import ca.nrc.cadc.auth.AuthMethod;
import ca.nrc.cadc.reg.Standards;
import org.apache.log4j.Logger;
import ca.nrc.cadc.auth.AuthenticationUtil;
......@@ -166,13 +168,11 @@ public class WhoAmIServlet extends HttpServlet
final RegistryClient registryClient = getRegistryClient();
LocalAuthority localAuthority = new LocalAuthority();
URI umsServiceURI = localAuthority.getServiceURI("ums");
URI umsServiceURI = localAuthority.getServiceURI(Standards.UMS_WHOAMI_01.toString());
log.debug("ums service uri: " + umsServiceURI);
final URL redirectURL =
registryClient.getServiceURL(
URI.create(umsServiceURI.toString() + "#users"), scheme, USER_GET_PATH);
final URL serviceURL = registryClient.getServiceURL(umsServiceURI, Standards.UMS_USERS_01, AuthMethod.CERT);
final URL redirectURL = new URL(serviceURL.toExternalForm() + USER_GET_PATH);
// Take the first one.
final String redirectUrl =
......@@ -181,8 +181,7 @@ public class WhoAmIServlet extends HttpServlet
log.debug("redirecting to " + redirectURI.toASCIIString());
response.sendRedirect(redirectURI.getPath() + "?"
+ redirectURI.getQuery());
response.sendRedirect(redirectURI.getPath() + "?" + redirectURI.getQuery());
}
/**
......
......@@ -82,15 +82,31 @@ import javax.security.auth.Subject;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import ca.nrc.cadc.ac.server.web.groups.AddUserMemberActionTest;
import ca.nrc.cadc.auth.AuthMethod;
import ca.nrc.cadc.reg.Standards;
import org.apache.log4j.Level;
import org.apache.log4j.Logger;
import org.junit.BeforeClass;
import org.junit.Test;
import ca.nrc.cadc.auth.HttpPrincipal;
import ca.nrc.cadc.reg.client.LocalAuthority;
import ca.nrc.cadc.reg.client.RegistryClient;
import ca.nrc.cadc.util.Log4jInit;
public class WhoAmIServletTest
{
private final static Logger log = Logger.getLogger(WhoAmIServletTest.class);
@BeforeClass
public static void setUpClass()
{
Log4jInit.setLevel("ca.nrc.cadc.ac", Level.INFO);
}
@Test
public void doGet() throws Exception
{
......@@ -133,11 +149,14 @@ public class WhoAmIServletTest
expectLastCall().once();
LocalAuthority localAuthority = new LocalAuthority();
URI umsServiceURI = localAuthority.getServiceURI("ums");
URI umsServiceURI = localAuthority.getServiceURI(Standards.UMS_WHOAMI_01.toString());
// expect(mockRegistry.getServiceURL(URI.create(umsServiceURI.toString() + "#users"),
// "http", "/%s?idType=HTTP")).
// andReturn(new URL("http://mysite.com/ac/users/CADCtest?idType=HTTP")).once();
expect(mockRegistry.getServiceURL(URI.create(umsServiceURI.toString() + "#users"),
"http", "/%s?idType=HTTP")).
andReturn(new URL("http://mysite.com/ac/users/CADCtest?idType=HTTP")).once();
expect(mockRegistry.getServiceURL(umsServiceURI, Standards.UMS_USERS_01, AuthMethod.CERT))
.andReturn(new URL("http://mysite.com/ac/users")).once();
replay(mockRequest, mockResponse, mockRegistry);
......
......@@ -92,6 +92,7 @@ import ca.nrc.cadc.ac.server.UserPersistence;
import ca.nrc.cadc.auth.AuthenticationUtil;
import ca.nrc.cadc.auth.HttpPrincipal;
import ca.nrc.cadc.auth.IdentityType;
import ca.nrc.cadc.reg.Standards;
import ca.nrc.cadc.reg.client.LocalAuthority;
import ca.nrc.cadc.util.Log4jInit;
import ca.nrc.cadc.util.ObjectUtil;
......@@ -118,7 +119,7 @@ public class RemoveUserMemberActionTest
{
User user = new User();
LocalAuthority localAuthority = new LocalAuthority();
URI umsServiceURI = localAuthority.getServiceURI("ums");
URI umsServiceURI = localAuthority.getServiceURI(Standards.UMS_REQS_01.toString());
InternalID internalID = new InternalID(new URI(umsServiceURI.toASCIIString() + "?" + UUID.randomUUID()));
ObjectUtil.setField(user, internalID, "id");
......@@ -172,7 +173,7 @@ public class RemoveUserMemberActionTest
{
User user = new User();
LocalAuthority localAuthority = new LocalAuthority();
URI umsServiceURI = localAuthority.getServiceURI("ums");
URI umsServiceURI = localAuthority.getServiceURI(Standards.UMS_REQS_01.toString());
InternalID internalID = new InternalID(new URI(umsServiceURI.toString() + "?" + UUID.randomUUID()));
ObjectUtil.setField(user, internalID, "id");
......
......@@ -117,7 +117,7 @@
<target name="setup-test">
<copy overwrite="true"
file="${env.CADC_PREFIX}/etc/LocalAuthority.properties"
file="${env.A}/etc/LocalAuthority.properties"
tofile="${build}/class/LocalAuthority.properties"/>
</target>
......
......@@ -90,6 +90,7 @@ import javax.net.ssl.HttpsURLConnection;
import javax.net.ssl.SSLSocketFactory;
import javax.security.auth.Subject;
import ca.nrc.cadc.reg.Standards;
import org.apache.log4j.Logger;
import ca.nrc.cadc.ac.Group;
......@@ -124,50 +125,24 @@ public class GMSClient implements TransferListener
{
private static final Logger log = Logger.getLogger(GMSClient.class);
private static final String GROUPS = "groups";
private static final String SEARCH = "search";
// socket factory to use when connecting
private SSLSocketFactory sslSocketFactory;
private SSLSocketFactory mySocketFactory;
private RegistryClient registryClient;
private URI gmsServiceURI;
private URI groupsURI;
private URI searchURI;
public GMSClient(URI serviceURI)
{
this(serviceURI, new RegistryClient());
}
private URI serviceID;
/**
* Slightly more complete constructor. Tests can override the
* RegistryClient.
* Constructor.
*
* @param serviceURI The service URI.
* @param registryClient The Registry Client.
* @param serviceID The service ID.
*/
public GMSClient(URI serviceURI, RegistryClient registryClient)
public GMSClient(URI serviceID)
{
if (serviceURI == null)
throw new IllegalArgumentException("invalid serviceURI: " + serviceURI);
if (serviceURI.getFragment() != null)
throw new IllegalArgumentException("invalid serviceURI (fragment not allowed): " + serviceURI);
this.registryClient = registryClient;
try
{
this.gmsServiceURI = serviceURI;
this.groupsURI = new URI(serviceURI.toASCIIString() + "#" + GROUPS);
this.searchURI = new URI(serviceURI.toASCIIString() + "#" + SEARCH);
}
catch(URISyntaxException ex)
{
throw new RuntimeException("BUG: failed to create standardID from serviceURI + fragment", ex);
}
if (serviceID == null)
throw new IllegalArgumentException("invalid serviceID: " + serviceID);
if (serviceID.getFragment() != null)
throw new IllegalArgumentException("invalid serviceID (fragment not allowed): " + serviceID);
this.serviceID = serviceID;
}
public void transferEvent(TransferEvent te)
......@@ -192,7 +167,6 @@ public class GMSClient implements TransferListener
throw new UnsupportedOperationException("Not yet implemented");
}
/**
* Create a new group.
*
......@@ -208,7 +182,8 @@ public class GMSClient implements TransferListener
throws GroupAlreadyExistsException, AccessControlException,
UserNotFoundException, WriterException, IOException
{
URL createGroupURL = registryClient.getServiceURL(groupsURI, "https", "", AuthMethod.CERT);
URL createGroupURL = getRegistryClient()
.getServiceURL(this.serviceID, Standards.GMS_GROUPS_01, AuthMethod.CERT);
log.debug("createGroupURL request to " + createGroupURL.toString());
// reset the state of the cache
......@@ -279,12 +254,13 @@ public class GMSClient implements TransferListener
public Group getGroup(String groupName)
throws GroupNotFoundException, AccessControlException, IOException
{
URL getGroupURL = registryClient.getServiceURL(groupsURI, "https", groupName, AuthMethod.CERT);
URL groupsURL = getRegistryClient()
.getServiceURL(this.serviceID, Standards.GMS_GROUPS_01, AuthMethod.CERT);
URL getGroupURL = new URL(groupsURL.toExternalForm() + "/" + groupName);
log.debug("getGroup request to " + getGroupURL.toString());
ByteArrayOutputStream out = new ByteArrayOutputStream();
HttpDownload transfer = new HttpDownload(getGroupURL, out);
transfer.setSSLSocketFactory(getSSLSocketFactory());
transfer.run();
......@@ -334,7 +310,8 @@ public class GMSClient implements TransferListener
public List<String> getGroupNames()
throws AccessControlException, IOException
{
URL getGroupNamesURL = registryClient.getServiceURL(groupsURI, "https", "", AuthMethod.CERT);
URL getGroupNamesURL = getRegistryClient()
.getServiceURL(this.serviceID, Standards.GMS_GROUPS_01, AuthMethod.CERT);
log.debug("getGroupNames request to " + getGroupNamesURL.toString());
......@@ -411,7 +388,9 @@ public class GMSClient implements TransferListener
throws IllegalArgumentException, GroupNotFoundException, UserNotFoundException,
AccessControlException, WriterException, IOException
{
URL updateGroupURL = registryClient.getServiceURL(groupsURI, "https", group.getID(), AuthMethod.CERT);
URL groupsURL = getRegistryClient()
.getServiceURL(this.serviceID, Standards.GMS_GROUPS_01, AuthMethod.CERT);
URL updateGroupURL = new URL(groupsURL.toExternalForm() + "/" + group.getID());
log.debug("updateGroup request to " + updateGroupURL.toString());
// reset the state of the cache
......@@ -478,7 +457,9 @@ public class GMSClient implements TransferListener
public void deleteGroup(String groupName)
throws GroupNotFoundException, AccessControlException, IOException
{
URL deleteGroupURL = registryClient.getServiceURL(groupsURI, "https", groupName, AuthMethod.CERT);
URL groupsURL = getRegistryClient()
.getServiceURL(this.serviceID, Standards.GMS_GROUPS_01, AuthMethod.CERT);
URL deleteGroupURL = new URL(groupsURL.toExternalForm() + "/" + groupName);
log.debug("deleteGroup request to " + deleteGroupURL.toString());
// reset the state of the cache
......@@ -544,8 +525,10 @@ public class GMSClient implements TransferListener
AccessControlException, IOException
{
String path = targetGroupName + "/groupMembers/" + groupMemberName;
URL addGroupMemberURL = registryClient.getServiceURL(groupsURI, "https", path, AuthMethod.CERT);
String path = "/" + targetGroupName + "/groupMembers/" + groupMemberName;
URL groupsURL = getRegistryClient()
.getServiceURL(this.serviceID, Standards.GMS_GROUPS_01, AuthMethod.CERT);
URL addGroupMemberURL = new URL(groupsURL.toExternalForm() + path);
log.debug("addGroupMember request to " + addGroupMemberURL.toString());
// reset the state of the cache
......@@ -603,8 +586,10 @@ public class GMSClient implements TransferListener
log.debug("addUserMember: " + targetGroupName + " + " + userID.getName());
String userIDType = AuthenticationUtil.getPrincipalType(userID);
String path = targetGroupName + "/userMembers/" + NetUtil.encode(userID.getName()) + "?idType=" + userIDType;
URL addUserMemberURL = registryClient.getServiceURL(groupsURI, "https", path, AuthMethod.CERT);
String path = "/" + targetGroupName + "/userMembers/" + NetUtil.encode(userID.getName()) + "?idType=" + userIDType;
URL groupsURL = getRegistryClient()
.getServiceURL(this.serviceID, Standards.GMS_GROUPS_01, AuthMethod.CERT);
URL addUserMemberURL = new URL(groupsURL.toExternalForm() + path);
log.debug("addUserMember request to " + addUserMemberURL.toString());
......@@ -658,8 +643,10 @@ public class GMSClient implements TransferListener
throws GroupNotFoundException, AccessControlException, IOException
{
String path = targetGroupName + "/groupMembers/" + groupMemberName;
URL removeGroupMemberURL = registryClient.getServiceURL(groupsURI, "https", path, AuthMethod.CERT);
String path = "/" + targetGroupName + "/groupMembers/" + groupMemberName;
URL groupsURL = getRegistryClient()
.getServiceURL(this.serviceID, Standards.GMS_GROUPS_01, AuthMethod.CERT);
URL removeGroupMemberURL = new URL(groupsURL.toExternalForm() + path);
log.debug("removeGroupMember request to " +
removeGroupMemberURL.toString());
......@@ -725,8 +712,10 @@ public class GMSClient implements TransferListener
String userIDType = AuthenticationUtil.getPrincipalType(userID);
log.debug("removeUserMember: " + targetGroupName + " - " + userID.getName() + " type: " + userIDType);
String path = targetGroupName + "/userMembers/" + NetUtil.encode(userID.getName()) + "?idType=" + userIDType;
URL removeUserMemberURL = registryClient.getServiceURL(groupsURI, "https", path, AuthMethod.CERT);
String path = "/" + targetGroupName + "/userMembers/" + NetUtil.encode(userID.getName()) + "?idType=" + userIDType;
URL groupsURL = getRegistryClient()
.getServiceURL(this.serviceID, Standards.GMS_GROUPS_01, AuthMethod.CERT);
URL removeUserMemberURL = new URL(groupsURL.toExternalForm() + path);
log.debug("removeUserMember: " + removeUserMemberURL.toString());
......@@ -836,11 +825,13 @@ public class GMSClient implements TransferListener
//searchGroupURL.append("&IDTYPE=").append(NetUtil.encode(idType));
searchGroupPath.append("&ROLE=").append(NetUtil.encode(roleString));
URL searchURL = registryClient.getServiceURL(searchURI, "https", searchGroupPath.toString(), AuthMethod.CERT);
URL searchURL = getRegistryClient()
.getServiceURL(this.serviceID, Standards.GMS_SEARCH_01, AuthMethod.CERT);
URL getMembershipsURL = new URL(searchURL.toExternalForm() + searchGroupPath.toString());
log.debug("getMemberships request to " + searchURL.toString());
log.debug("getMemberships request to " + getMembershipsURL.toString());
ByteArrayOutputStream out = new ByteArrayOutputStream();
HttpDownload transfer = new HttpDownload(searchURL, out);
HttpDownload transfer = new HttpDownload(getMembershipsURL, out);
transfer.setSSLSocketFactory(getSSLSocketFactory());
transfer.run();
......@@ -945,11 +936,13 @@ public class GMSClient implements TransferListener
searchGroupPath.append("&ROLE=").append(NetUtil.encode(roleString));
searchGroupPath.append("&GROUPID=").append(NetUtil.encode(groupName));
URL searchURL = registryClient.getServiceURL(searchURI, "https", searchGroupPath.toString(), AuthMethod.CERT);
URL searchURL = getRegistryClient()
.getServiceURL(this.serviceID, Standards.GMS_SEARCH_01, AuthMethod.CERT);
URL getMembershipURL = new URL(searchURL.toExternalForm() + searchGroupPath.toString());
log.debug("getMembership request to " + searchURL.toString());
log.debug("getMembership request to " + getMembershipURL.toString());
ByteArrayOutputStream out = new ByteArrayOutputStream();
HttpDownload transfer = new HttpDownload(searchURL, out);
HttpDownload transfer = new HttpDownload(getMembershipURL, out);
transfer.setSSLSocketFactory(getSSLSocketFactory());
transfer.run();
......@@ -1102,17 +1095,17 @@ public class GMSClient implements TransferListener
Set<GroupMemberships> gset = subject.getPrivateCredentials(GroupMemberships.class);
if (gset == null || gset.isEmpty())
{
GroupMemberships mems = new GroupMemberships(gmsServiceURI.toString(), userID);
GroupMemberships mems = new GroupMemberships(serviceID.toString(), userID);
subject.getPrivateCredentials().add(mems);
return mems;
}
GroupMemberships mems = gset.iterator().next();
// check to ensure they have the same service URI
if (!gmsServiceURI.toString().equals(mems.getServiceURI()))
if (!serviceID.toString().equals(mems.getServiceURI()))
{
log.debug("Not using cache because of differing service URIs: " +
"[" + gmsServiceURI.toString() + "][" + mems.getServiceURI() + "]");
"[" + serviceID.toString() + "][" + mems.getServiceURI() + "]");
return null;
}
......@@ -1182,4 +1175,9 @@ public class GMSClient implements TransferListener
return false;
}
protected RegistryClient getRegistryClient()
{
return new RegistryClient();
}
}
......@@ -84,6 +84,8 @@ import java.util.Set;
import javax.security.auth.Subject;
import javax.security.auth.x500.X500Principal;
import ca.nrc.cadc.reg.Standards;
import ca.nrc.cadc.reg.client.LocalAuthority;
import org.apache.log4j.Logger;
import ca.nrc.cadc.ac.ReaderException;
......@@ -110,47 +112,22 @@ public class UserClient
{
private static final Logger log = Logger.getLogger(UserClient.class);
private static final String USERS = "users";
private static final String USER_REQUESTS = "reqs";
private RegistryClient registryClient;
private URI usersURI;
// to be used when the client can work with
// user requests
private URI userReqsURI;
private URI serviceID;
/**
* Constructor.
*
* @param serviceURI The URI of the supporting access control web service
* @param serviceID The URI of the supporting access control web service
* obtained from the registry.
*/
public UserClient(URI serviceURI)
public UserClient(URI serviceID)
throws IllegalArgumentException
{
this(serviceURI, new RegistryClient());
}
public UserClient(URI serviceURI, RegistryClient registryClient)
{
if (serviceURI == null)
if (serviceID == null)
throw new IllegalArgumentException("Service URI cannot be null.");
if (serviceURI.getFragment() != null)
throw new IllegalArgumentException("invalid serviceURI (fragment not allowed): " + serviceURI);