Loading cadcAccessControl-Identity/src/ca/nrc/cadc/auth/ACIdentityManager.java +6 −2 Original line number Diff line number Diff line Loading @@ -237,8 +237,12 @@ public class ACIdentityManager implements IdentityManager RegistryClient regClient = new RegistryClient(); LocalAuthority localAuth = new LocalAuthority(); URI serviceURI = localAuth.getServiceURI("gms"); URL serviceURL = regClient.getServiceURL(serviceURI, Standards.GMS_01_URI, AuthMethod.ANON); URL availURL = new URL(serviceURL.toExternalForm() + "/availability"); URL serviceURL = regClient.getServiceURL(serviceURI, Standards.GMS_GROUPS_01, AuthMethod.ANON); // Hack to strip off the groups endpoint to get the base url of the service. String serviceUrl = serviceURL.toExternalForm(); int index = serviceUrl.lastIndexOf('/'); URL availURL = new URL(serviceUrl.substring(0, index)+ "/availability"); return new CheckWebService(availURL.toExternalForm()); } catch (MalformedURLException e) Loading cadcAccessControl-Identity/src/ca/nrc/cadc/auth/AuthenticatorImpl.java +6 −2 Original line number Diff line number Diff line Loading @@ -75,8 +75,12 @@ public class AuthenticatorImpl implements Authenticator RegistryClient regClient = new RegistryClient(); LocalAuthority localAuth = new LocalAuthority(); URI serviceURI = localAuth.getServiceURI("gms"); URL serviceURL = regClient.getServiceURL(serviceURI, Standards.GMS_01_URI, AuthMethod.ANON); URL availURL = new URL(serviceURL.toExternalForm() + "/availability"); URL serviceURL = regClient.getServiceURL(serviceURI, Standards.GMS_GROUPS_01, AuthMethod.ANON); // Hack to strip off the groups endpoint to get the base url of the service. String serviceUrl = serviceURL.toExternalForm(); int index = serviceUrl.lastIndexOf('/'); URL availURL = new URL(serviceUrl.substring(0, index)+ "/availability"); return new CheckWebService(availURL.toExternalForm()); } catch (MalformedURLException e) Loading cadcAccessControl/src/ca/nrc/cadc/ac/client/GMSClient.java +11 −11 Original line number Diff line number Diff line Loading @@ -183,7 +183,7 @@ public class GMSClient implements TransferListener UserNotFoundException, WriterException, IOException { URL createGroupURL = getRegistryClient() .getServiceURL(this.serviceID, Standards.GMS_GROUPS_01_URI, AuthMethod.CERT); .getServiceURL(this.serviceID, Standards.GMS_GROUPS_01, AuthMethod.CERT); log.debug("createGroupURL request to " + createGroupURL.toString()); // reset the state of the cache Loading Loading @@ -255,7 +255,7 @@ public class GMSClient implements TransferListener throws GroupNotFoundException, AccessControlException, IOException { URL groupsURL = getRegistryClient() .getServiceURL(this.serviceID, Standards.GMS_GROUPS_01_URI, AuthMethod.CERT); .getServiceURL(this.serviceID, Standards.GMS_GROUPS_01, AuthMethod.CERT); URL getGroupURL = new URL(groupsURL.toExternalForm() + "/" + groupName); log.debug("getGroup request to " + getGroupURL.toString()); Loading Loading @@ -311,7 +311,7 @@ public class GMSClient implements TransferListener throws AccessControlException, IOException { URL getGroupNamesURL = getRegistryClient() .getServiceURL(this.serviceID, Standards.GMS_GROUPS_01_URI, AuthMethod.CERT); .getServiceURL(this.serviceID, Standards.GMS_GROUPS_01, AuthMethod.CERT); log.debug("getGroupNames request to " + getGroupNamesURL.toString()); Loading Loading @@ -389,7 +389,7 @@ public class GMSClient implements TransferListener AccessControlException, WriterException, IOException { URL groupsURL = getRegistryClient() .getServiceURL(this.serviceID, Standards.GMS_GROUPS_01_URI, AuthMethod.CERT); .getServiceURL(this.serviceID, Standards.GMS_GROUPS_01, AuthMethod.CERT); URL updateGroupURL = new URL(groupsURL.toExternalForm() + "/" + group.getID()); log.debug("updateGroup request to " + updateGroupURL.toString()); Loading Loading @@ -458,7 +458,7 @@ public class GMSClient implements TransferListener throws GroupNotFoundException, AccessControlException, IOException { URL groupsURL = getRegistryClient() .getServiceURL(this.serviceID, Standards.GMS_GROUPS_01_URI, AuthMethod.CERT); .getServiceURL(this.serviceID, Standards.GMS_GROUPS_01, AuthMethod.CERT); URL deleteGroupURL = new URL(groupsURL.toExternalForm() + "/" + groupName); log.debug("deleteGroup request to " + deleteGroupURL.toString()); Loading Loading @@ -527,7 +527,7 @@ public class GMSClient implements TransferListener String path = targetGroupName + "/groupMembers/" + groupMemberName; URL groupsURL = getRegistryClient() .getServiceURL(this.serviceID, Standards.GMS_GROUPS_01_URI, AuthMethod.CERT); .getServiceURL(this.serviceID, Standards.GMS_GROUPS_01, AuthMethod.CERT); URL addGroupMemberURL = new URL(groupsURL.toExternalForm() + "/" + path); log.debug("addGroupMember request to " + addGroupMemberURL.toString()); Loading Loading @@ -588,7 +588,7 @@ public class GMSClient implements TransferListener String userIDType = AuthenticationUtil.getPrincipalType(userID); String path = targetGroupName + "/userMembers/" + NetUtil.encode(userID.getName()) + "?idType=" + userIDType; URL groupsURL = getRegistryClient() .getServiceURL(this.serviceID, Standards.GMS_GROUPS_01_URI, AuthMethod.CERT); .getServiceURL(this.serviceID, Standards.GMS_GROUPS_01, AuthMethod.CERT); URL addUserMemberURL = new URL(groupsURL.toExternalForm() + "/" + path); log.debug("addUserMember request to " + addUserMemberURL.toString()); Loading Loading @@ -645,7 +645,7 @@ public class GMSClient implements TransferListener String path = targetGroupName + "/groupMembers/" + groupMemberName; URL groupsURL = getRegistryClient() .getServiceURL(this.serviceID, Standards.GMS_GROUPS_01_URI, AuthMethod.CERT); .getServiceURL(this.serviceID, Standards.GMS_GROUPS_01, AuthMethod.CERT); URL removeGroupMemberURL = new URL(groupsURL.toExternalForm() + "/" + path); log.debug("removeGroupMember request to " + removeGroupMemberURL.toString()); Loading Loading @@ -714,7 +714,7 @@ public class GMSClient implements TransferListener log.debug("removeUserMember: " + targetGroupName + " - " + userID.getName() + " type: " + userIDType); String path = targetGroupName + "/userMembers/" + NetUtil.encode(userID.getName()) + "?idType=" + userIDType; URL groupsURL = getRegistryClient() .getServiceURL(this.serviceID, Standards.GMS_GROUPS_01_URI, AuthMethod.CERT); .getServiceURL(this.serviceID, Standards.GMS_GROUPS_01, AuthMethod.CERT); URL removeUserMemberURL = new URL(groupsURL.toExternalForm() + "/" + path); log.debug("removeUserMember: " + removeUserMemberURL.toString()); Loading Loading @@ -826,7 +826,7 @@ public class GMSClient implements TransferListener searchGroupPath.append("&ROLE=").append(NetUtil.encode(roleString)); URL searchURL = getRegistryClient() .getServiceURL(this.serviceID, Standards.GMS_SEARCH_01_URI, AuthMethod.CERT); .getServiceURL(this.serviceID, Standards.GMS_SEARCH_01, AuthMethod.CERT); URL getMembershipsURL = new URL(searchURL.toExternalForm() + "/" + searchGroupPath.toString()); log.debug("getMemberships request to " + getMembershipsURL.toString()); Loading Loading @@ -937,7 +937,7 @@ public class GMSClient implements TransferListener searchGroupPath.append("&GROUPID=").append(NetUtil.encode(groupName)); URL searchURL = getRegistryClient() .getServiceURL(this.serviceID, Standards.GMS_SEARCH_01_URI, AuthMethod.CERT); .getServiceURL(this.serviceID, Standards.GMS_SEARCH_01, AuthMethod.CERT); URL getMembershipURL = new URL(searchURL.toExternalForm() + "/" + searchGroupPath.toString()); log.debug("getMembership request to " + getMembershipURL.toString()); Loading cadcAccessControl/src/ca/nrc/cadc/ac/client/UserClient.java +7 −7 Original line number Diff line number Diff line Loading @@ -149,11 +149,11 @@ public class UserClient // augment subject calls are always https with client certs URL usersURL = getRegistryClient() .getServiceURL(this.serviceID, Standards.UMS_USERS_01_URI, AuthMethod.CERT); .getServiceURL(this.serviceID, Standards.UMS_USERS_01, AuthMethod.CERT); URL getUserURL = new URL(usersURL.toExternalForm() + path); if (getUserURL == null) throw new IllegalArgumentException("No service endpoint for uri " + Standards.UMS_USERS_01_URI); throw new IllegalArgumentException("No service endpoint for uri " + Standards.UMS_USERS_01); log.debug("augmentSubject request to " + getUserURL.toString()); ByteArrayOutputStream out = new ByteArrayOutputStream(); Loading Loading @@ -189,7 +189,7 @@ public class UserClient public List<User> getDisplayUsers() throws IOException { URL usersURL = getRegistryClient() .getServiceURL(this.serviceID, Standards.UMS_USERS_01_URI, AuthMethod.CERT); .getServiceURL(this.serviceID, Standards.UMS_USERS_01, AuthMethod.CERT); final List<User> webUsers = new ArrayList<User>(); HttpDownload httpDownload = new HttpDownload(usersURL, Loading Loading @@ -254,10 +254,10 @@ public class UserClient userWriter.write(user, userXML); URL createUserURL = getRegistryClient() .getServiceURL(this.serviceID, Standards.UMS_REQS_01_URI, AuthMethod.CERT); .getServiceURL(this.serviceID, Standards.UMS_REQS_01, AuthMethod.CERT); if (createUserURL == null) throw new IllegalArgumentException("No service endpoint for uri " + Standards.UMS_REQS_01_URI); throw new IllegalArgumentException("No service endpoint for uri " + Standards.UMS_REQS_01); log.debug("createUser request to " + createUserURL.toString()); ByteArrayInputStream in = new ByteArrayInputStream(userXML.toString().getBytes()); Loading Loading @@ -318,10 +318,10 @@ public class UserClient String path = "/" + id + "?idType=" + AuthenticationUtil.getPrincipalType(principal); URL usersURL = getRegistryClient() .getServiceURL(this.serviceID, Standards.UMS_USERS_01_URI, AuthMethod.CERT); .getServiceURL(this.serviceID, Standards.UMS_USERS_01, AuthMethod.CERT); URL getUserURL = new URL(usersURL.toExternalForm() + path); if (getUserURL == null) throw new IllegalArgumentException("No service endpoint for uri " + Standards.UMS_USERS_01_URI); throw new IllegalArgumentException("No service endpoint for uri " + Standards.UMS_USERS_01); log.debug("getUser request to " + getUserURL.toString()); ByteArrayOutputStream out = new ByteArrayOutputStream(); Loading cadcAccessControl/test/src/ca/nrc/cadc/ac/client/GMSClientTest.java +2 −2 Original line number Diff line number Diff line Loading @@ -116,7 +116,7 @@ public class GMSClientTest final URI serviceID = URI.create("ivo://mysite.com/users"); expect(mockRegistryClient.getServiceURL(serviceID, Standards.UMS_USERS_01_URI, AuthMethod.CERT)) expect(mockRegistryClient.getServiceURL(serviceID, Standards.UMS_USERS_01, AuthMethod.CERT)) .andReturn(new URL("http://mysite.com/users")); replay(mockRegistryClient); Loading Loading @@ -154,7 +154,7 @@ public class GMSClientTest final RegistryClient mockRegistryClient = createMock(RegistryClient.class); expect(mockRegistryClient.getServiceURL(serviceID, Standards.GMS_GROUPS_01_URI, AuthMethod.CERT )) expect(mockRegistryClient.getServiceURL(serviceID, Standards.GMS_GROUPS_01, AuthMethod.CERT )) .andReturn(new URL("http://mysite.com/users")); replay(mockRegistryClient); Loading Loading
cadcAccessControl-Identity/src/ca/nrc/cadc/auth/ACIdentityManager.java +6 −2 Original line number Diff line number Diff line Loading @@ -237,8 +237,12 @@ public class ACIdentityManager implements IdentityManager RegistryClient regClient = new RegistryClient(); LocalAuthority localAuth = new LocalAuthority(); URI serviceURI = localAuth.getServiceURI("gms"); URL serviceURL = regClient.getServiceURL(serviceURI, Standards.GMS_01_URI, AuthMethod.ANON); URL availURL = new URL(serviceURL.toExternalForm() + "/availability"); URL serviceURL = regClient.getServiceURL(serviceURI, Standards.GMS_GROUPS_01, AuthMethod.ANON); // Hack to strip off the groups endpoint to get the base url of the service. String serviceUrl = serviceURL.toExternalForm(); int index = serviceUrl.lastIndexOf('/'); URL availURL = new URL(serviceUrl.substring(0, index)+ "/availability"); return new CheckWebService(availURL.toExternalForm()); } catch (MalformedURLException e) Loading
cadcAccessControl-Identity/src/ca/nrc/cadc/auth/AuthenticatorImpl.java +6 −2 Original line number Diff line number Diff line Loading @@ -75,8 +75,12 @@ public class AuthenticatorImpl implements Authenticator RegistryClient regClient = new RegistryClient(); LocalAuthority localAuth = new LocalAuthority(); URI serviceURI = localAuth.getServiceURI("gms"); URL serviceURL = regClient.getServiceURL(serviceURI, Standards.GMS_01_URI, AuthMethod.ANON); URL availURL = new URL(serviceURL.toExternalForm() + "/availability"); URL serviceURL = regClient.getServiceURL(serviceURI, Standards.GMS_GROUPS_01, AuthMethod.ANON); // Hack to strip off the groups endpoint to get the base url of the service. String serviceUrl = serviceURL.toExternalForm(); int index = serviceUrl.lastIndexOf('/'); URL availURL = new URL(serviceUrl.substring(0, index)+ "/availability"); return new CheckWebService(availURL.toExternalForm()); } catch (MalformedURLException e) Loading
cadcAccessControl/src/ca/nrc/cadc/ac/client/GMSClient.java +11 −11 Original line number Diff line number Diff line Loading @@ -183,7 +183,7 @@ public class GMSClient implements TransferListener UserNotFoundException, WriterException, IOException { URL createGroupURL = getRegistryClient() .getServiceURL(this.serviceID, Standards.GMS_GROUPS_01_URI, AuthMethod.CERT); .getServiceURL(this.serviceID, Standards.GMS_GROUPS_01, AuthMethod.CERT); log.debug("createGroupURL request to " + createGroupURL.toString()); // reset the state of the cache Loading Loading @@ -255,7 +255,7 @@ public class GMSClient implements TransferListener throws GroupNotFoundException, AccessControlException, IOException { URL groupsURL = getRegistryClient() .getServiceURL(this.serviceID, Standards.GMS_GROUPS_01_URI, AuthMethod.CERT); .getServiceURL(this.serviceID, Standards.GMS_GROUPS_01, AuthMethod.CERT); URL getGroupURL = new URL(groupsURL.toExternalForm() + "/" + groupName); log.debug("getGroup request to " + getGroupURL.toString()); Loading Loading @@ -311,7 +311,7 @@ public class GMSClient implements TransferListener throws AccessControlException, IOException { URL getGroupNamesURL = getRegistryClient() .getServiceURL(this.serviceID, Standards.GMS_GROUPS_01_URI, AuthMethod.CERT); .getServiceURL(this.serviceID, Standards.GMS_GROUPS_01, AuthMethod.CERT); log.debug("getGroupNames request to " + getGroupNamesURL.toString()); Loading Loading @@ -389,7 +389,7 @@ public class GMSClient implements TransferListener AccessControlException, WriterException, IOException { URL groupsURL = getRegistryClient() .getServiceURL(this.serviceID, Standards.GMS_GROUPS_01_URI, AuthMethod.CERT); .getServiceURL(this.serviceID, Standards.GMS_GROUPS_01, AuthMethod.CERT); URL updateGroupURL = new URL(groupsURL.toExternalForm() + "/" + group.getID()); log.debug("updateGroup request to " + updateGroupURL.toString()); Loading Loading @@ -458,7 +458,7 @@ public class GMSClient implements TransferListener throws GroupNotFoundException, AccessControlException, IOException { URL groupsURL = getRegistryClient() .getServiceURL(this.serviceID, Standards.GMS_GROUPS_01_URI, AuthMethod.CERT); .getServiceURL(this.serviceID, Standards.GMS_GROUPS_01, AuthMethod.CERT); URL deleteGroupURL = new URL(groupsURL.toExternalForm() + "/" + groupName); log.debug("deleteGroup request to " + deleteGroupURL.toString()); Loading Loading @@ -527,7 +527,7 @@ public class GMSClient implements TransferListener String path = targetGroupName + "/groupMembers/" + groupMemberName; URL groupsURL = getRegistryClient() .getServiceURL(this.serviceID, Standards.GMS_GROUPS_01_URI, AuthMethod.CERT); .getServiceURL(this.serviceID, Standards.GMS_GROUPS_01, AuthMethod.CERT); URL addGroupMemberURL = new URL(groupsURL.toExternalForm() + "/" + path); log.debug("addGroupMember request to " + addGroupMemberURL.toString()); Loading Loading @@ -588,7 +588,7 @@ public class GMSClient implements TransferListener String userIDType = AuthenticationUtil.getPrincipalType(userID); String path = targetGroupName + "/userMembers/" + NetUtil.encode(userID.getName()) + "?idType=" + userIDType; URL groupsURL = getRegistryClient() .getServiceURL(this.serviceID, Standards.GMS_GROUPS_01_URI, AuthMethod.CERT); .getServiceURL(this.serviceID, Standards.GMS_GROUPS_01, AuthMethod.CERT); URL addUserMemberURL = new URL(groupsURL.toExternalForm() + "/" + path); log.debug("addUserMember request to " + addUserMemberURL.toString()); Loading Loading @@ -645,7 +645,7 @@ public class GMSClient implements TransferListener String path = targetGroupName + "/groupMembers/" + groupMemberName; URL groupsURL = getRegistryClient() .getServiceURL(this.serviceID, Standards.GMS_GROUPS_01_URI, AuthMethod.CERT); .getServiceURL(this.serviceID, Standards.GMS_GROUPS_01, AuthMethod.CERT); URL removeGroupMemberURL = new URL(groupsURL.toExternalForm() + "/" + path); log.debug("removeGroupMember request to " + removeGroupMemberURL.toString()); Loading Loading @@ -714,7 +714,7 @@ public class GMSClient implements TransferListener log.debug("removeUserMember: " + targetGroupName + " - " + userID.getName() + " type: " + userIDType); String path = targetGroupName + "/userMembers/" + NetUtil.encode(userID.getName()) + "?idType=" + userIDType; URL groupsURL = getRegistryClient() .getServiceURL(this.serviceID, Standards.GMS_GROUPS_01_URI, AuthMethod.CERT); .getServiceURL(this.serviceID, Standards.GMS_GROUPS_01, AuthMethod.CERT); URL removeUserMemberURL = new URL(groupsURL.toExternalForm() + "/" + path); log.debug("removeUserMember: " + removeUserMemberURL.toString()); Loading Loading @@ -826,7 +826,7 @@ public class GMSClient implements TransferListener searchGroupPath.append("&ROLE=").append(NetUtil.encode(roleString)); URL searchURL = getRegistryClient() .getServiceURL(this.serviceID, Standards.GMS_SEARCH_01_URI, AuthMethod.CERT); .getServiceURL(this.serviceID, Standards.GMS_SEARCH_01, AuthMethod.CERT); URL getMembershipsURL = new URL(searchURL.toExternalForm() + "/" + searchGroupPath.toString()); log.debug("getMemberships request to " + getMembershipsURL.toString()); Loading Loading @@ -937,7 +937,7 @@ public class GMSClient implements TransferListener searchGroupPath.append("&GROUPID=").append(NetUtil.encode(groupName)); URL searchURL = getRegistryClient() .getServiceURL(this.serviceID, Standards.GMS_SEARCH_01_URI, AuthMethod.CERT); .getServiceURL(this.serviceID, Standards.GMS_SEARCH_01, AuthMethod.CERT); URL getMembershipURL = new URL(searchURL.toExternalForm() + "/" + searchGroupPath.toString()); log.debug("getMembership request to " + getMembershipURL.toString()); Loading
cadcAccessControl/src/ca/nrc/cadc/ac/client/UserClient.java +7 −7 Original line number Diff line number Diff line Loading @@ -149,11 +149,11 @@ public class UserClient // augment subject calls are always https with client certs URL usersURL = getRegistryClient() .getServiceURL(this.serviceID, Standards.UMS_USERS_01_URI, AuthMethod.CERT); .getServiceURL(this.serviceID, Standards.UMS_USERS_01, AuthMethod.CERT); URL getUserURL = new URL(usersURL.toExternalForm() + path); if (getUserURL == null) throw new IllegalArgumentException("No service endpoint for uri " + Standards.UMS_USERS_01_URI); throw new IllegalArgumentException("No service endpoint for uri " + Standards.UMS_USERS_01); log.debug("augmentSubject request to " + getUserURL.toString()); ByteArrayOutputStream out = new ByteArrayOutputStream(); Loading Loading @@ -189,7 +189,7 @@ public class UserClient public List<User> getDisplayUsers() throws IOException { URL usersURL = getRegistryClient() .getServiceURL(this.serviceID, Standards.UMS_USERS_01_URI, AuthMethod.CERT); .getServiceURL(this.serviceID, Standards.UMS_USERS_01, AuthMethod.CERT); final List<User> webUsers = new ArrayList<User>(); HttpDownload httpDownload = new HttpDownload(usersURL, Loading Loading @@ -254,10 +254,10 @@ public class UserClient userWriter.write(user, userXML); URL createUserURL = getRegistryClient() .getServiceURL(this.serviceID, Standards.UMS_REQS_01_URI, AuthMethod.CERT); .getServiceURL(this.serviceID, Standards.UMS_REQS_01, AuthMethod.CERT); if (createUserURL == null) throw new IllegalArgumentException("No service endpoint for uri " + Standards.UMS_REQS_01_URI); throw new IllegalArgumentException("No service endpoint for uri " + Standards.UMS_REQS_01); log.debug("createUser request to " + createUserURL.toString()); ByteArrayInputStream in = new ByteArrayInputStream(userXML.toString().getBytes()); Loading Loading @@ -318,10 +318,10 @@ public class UserClient String path = "/" + id + "?idType=" + AuthenticationUtil.getPrincipalType(principal); URL usersURL = getRegistryClient() .getServiceURL(this.serviceID, Standards.UMS_USERS_01_URI, AuthMethod.CERT); .getServiceURL(this.serviceID, Standards.UMS_USERS_01, AuthMethod.CERT); URL getUserURL = new URL(usersURL.toExternalForm() + path); if (getUserURL == null) throw new IllegalArgumentException("No service endpoint for uri " + Standards.UMS_USERS_01_URI); throw new IllegalArgumentException("No service endpoint for uri " + Standards.UMS_USERS_01); log.debug("getUser request to " + getUserURL.toString()); ByteArrayOutputStream out = new ByteArrayOutputStream(); Loading
cadcAccessControl/test/src/ca/nrc/cadc/ac/client/GMSClientTest.java +2 −2 Original line number Diff line number Diff line Loading @@ -116,7 +116,7 @@ public class GMSClientTest final URI serviceID = URI.create("ivo://mysite.com/users"); expect(mockRegistryClient.getServiceURL(serviceID, Standards.UMS_USERS_01_URI, AuthMethod.CERT)) expect(mockRegistryClient.getServiceURL(serviceID, Standards.UMS_USERS_01, AuthMethod.CERT)) .andReturn(new URL("http://mysite.com/users")); replay(mockRegistryClient); Loading Loading @@ -154,7 +154,7 @@ public class GMSClientTest final RegistryClient mockRegistryClient = createMock(RegistryClient.class); expect(mockRegistryClient.getServiceURL(serviceID, Standards.GMS_GROUPS_01_URI, AuthMethod.CERT )) expect(mockRegistryClient.getServiceURL(serviceID, Standards.GMS_GROUPS_01, AuthMethod.CERT )) .andReturn(new URL("http://mysite.com/users")); replay(mockRegistryClient); Loading