protected URL getServiceURL(URI serviceID, URI standard, AuthMethod authMethod) { RegistryClient registryClient = new RegistryClient(); return registryClient.getServiceURL(serviceID, standard, authMethod); }
/** * Obtain the Login URL. * @return URL for login */ private URL lookupLoginURL() { return this.registryClient .getServiceURL(this.groupManagementServiceURI, Standards.UMS_LOGIN_01, AuthMethod.ANON); }
public MultiHostCapabilitiesServlet() { super(); RegistryClient rc = new RegistryClient(); doTransform = rc.isRegistryLookupOverride(); } }
public static CheckResource getAvailabilityCheck() { RegistryClient regClient = new RegistryClient(); LocalAuthority localAuth = new LocalAuthority(); URI serviceURI = localAuth.getServiceURI(Standards.UMS_USERS_01.toASCIIString()); URL availURL = regClient.getServiceURL(serviceURI, Standards.VOSI_AVAILABILITY, AuthMethod.ANON); return new CheckWebService(availURL.toExternalForm()); } }
public AccessControlClient(final URI serviceURI) throws IllegalArgumentException { this(serviceURI, new RegistryClient()); }
public Object run() throws Exception { LocalAuthority localAuth = new LocalAuthority(); URI serviceURI = localAuth.getServiceURI(Standards.UMS_USERS_01.toASCIIString()); UserClient userClient = new UserClient(serviceURI); userClient.augmentSubject(subject); return null; } };
private NumericPrincipal createX500User(final X500Principal x500Principal) { PrivilegedExceptionAction<NumericPrincipal> action = new PrivilegedExceptionAction<NumericPrincipal>() { @Override public NumericPrincipal run() throws Exception { LocalAuthority localAuth = new LocalAuthority(); URI serviceURI = localAuth.getServiceURI(Standards.UMS_USERS_01.toASCIIString()); UserClient userClient = new UserClient(serviceURI); User newUser = userClient.createUser(x500Principal); Set<NumericPrincipal> set = newUser.getIdentities(NumericPrincipal.class); if (set.isEmpty()) { throw new IllegalStateException("missing internal id"); } return set.iterator().next(); } }; //Subject servopsSubject = SSLUtil.createSubject(privilegedPemFile); Subject servopsSubject = CredUtil.createOpsSubject(); try { return Subject.doAs(servopsSubject, action); } catch (Exception e) { throw new IllegalStateException("failed to create internal id for user " + x500Principal.getName(), e); } }
private URL getJobListURL() { AuthMethod am = AuthMethod.ANON; if (subject != null) { am = AuthenticationUtil.getAuthMethodFromCredentials(subject); } RegistryClient rc = new RegistryClient(); URL ret = rc.getServiceURL(resourceID, standardID, am, interfaceType); if (ret == null) { throw new RuntimeException("init FAIL, service not found:" + resourceID + " " + standardID + " " + am + " " + interfaceType); } log.info("jobListURL: " + ret); return ret; }
/** * The returned CheckResource is the same as the one from AuthenticatorImpl. * * @return the CheckResource */ public static CheckResource getAvailabilityCheck() { RegistryClient regClient = new RegistryClient(); LocalAuthority localAuth = new LocalAuthority(); URI serviceURI = localAuth.getServiceURI(Standards.UMS_USERS_01.toASCIIString()); URL availURL = regClient.getServiceURL(serviceURI, Standards.VOSI_AVAILABILITY, AuthMethod.ANON); return new CheckWebService(availURL.toExternalForm()); } }
protected RegistryClient getRegistryClient() { return new RegistryClient(); }
private URL lookupServiceURL(final URI standard) throws AccessControlException { Subject subject = AuthenticationUtil.getCurrentSubject(); AuthMethod am = AuthenticationUtil.getAuthMethodFromCredentials(subject); URL serviceURL = getRegistryClient().getServiceURL(this.serviceID, standard, am); if (serviceURL == null) { throw new RuntimeException( String.format("Unable to get Service URL for '%s', '%s', '%s'", serviceID.toString(), standard, am)); } return serviceURL; }
@Override public NumericPrincipal run() throws Exception { LocalAuthority localAuth = new LocalAuthority(); URI serviceURI = localAuth.getServiceURI(Standards.UMS_USERS_01.toASCIIString()); UserClient userClient = new UserClient(serviceURI); User newUser = userClient.createUser(x500Principal); Set<NumericPrincipal> set = newUser.getIdentities(NumericPrincipal.class); if (set.isEmpty()) { throw new IllegalStateException("missing internal id"); } return set.iterator().next(); } };
public void augmentSubject(final Subject subject) { if (subject == null ) { return; } // If the principal list is in the subject has aNumeric Principal // AND the list is greater than 1, then LDAP doesn't need to be // called here (subject has already been augmented) Set<Principal> principalSet = subject.getPrincipals(); Set<NumericPrincipal> nPrincipalSet = subject.getPrincipals(NumericPrincipal.class); if (principalSet.size() > 1 && !nPrincipalSet.isEmpty()) { return; } try { PrivilegedExceptionAction<Object> action = new PrivilegedExceptionAction<Object>() { public Object run() throws Exception { LocalAuthority localAuth = new LocalAuthority(); URI serviceURI = localAuth.getServiceURI(Standards.UMS_USERS_01.toASCIIString()); UserClient userClient = new UserClient(serviceURI); userClient.augmentSubject(subject); return null; } }; Subject servopsSubject = CredUtil.createOpsSubject(); Subject.doAs(servopsSubject, action); } catch (PrivilegedActionException e) { String msg = "Error augmenting subject " + subject; throw new RuntimeException(msg, e); } }
public AdSchemeHandler() { try { RegistryClient rc = new RegistryClient(); AuthMethod am = AuthenticationUtil.getAuthMethod(AuthenticationUtil.getCurrentSubject()); if (am == null) { am = AuthMethod.ANON; } URL serviceURL = rc.getServiceURL(URI.create(DATA_URI), Standards.DATA_10, am); this.baseURL = serviceURL.toExternalForm(); } catch (Throwable t) { log.error("failed to find CADC data service URL", t); throw new RuntimeException("BUG: failed to find CADC data service URL", t); } log.debug("CADC data service URL: " + baseURL); }
protected RegistryClient getRegistryClient() { return new RegistryClient(); }
final boolean maxDetail) final RegistryClient registryClient = new RegistryClient(); final URL resolverURL = registryClient.getServiceURL( URI.create("ivo://cadc.nrc.ca/resolver"), Standards.RESOLVER_10, AuthMethod.ANON);
protected RegistryClient getRegistryClient() { return new RegistryClient(); }
protected RegistryClient getRegistryClient() { return new RegistryClient(); }
public VOSDownloadGenerator() { this(new RegistryClient()); }
public DataLinkClient() { this.regClient = new RegistryClient(); this.resolver = new DataLinkServiceResolver(); skipSemantics.add("#preview"); skipSemantics.add("http://www.openadc.org/caom2#thumbnail"); skipSemantics.add("http://www.openadc.org/caom2#pkg"); }