Gets client configuration uri.

@param registeredService the registered service
@param serverPrefix      the server prefix
@return the client configuration uri
@throws URISyntaxException the uri syntax exception
14068
public static String getClientConfigurationUri(final OidcRegisteredService registeredService,
                                                   final String serverPrefix) throws URISyntaxException {
        return new URIBuilder(serverPrefix
            .concat('/' + OidcConstants.BASE_OIDC_URL + '/' + OidcConstants.CLIENT_CONFIGURATION_URL))
            .addParameter(OidcConstants.CLIENT_REGISTRATION_CLIENT_ID, registeredService.getClientId())
            .build()
            .toString();
    }
422603
@Override
  public String getPrefix(String namespaceURI) {
    // per javax.xml.namespace.NamespaceContext doc
    if (namespaceURI == null)
      throw new IllegalArgumentException("Cannot find prefix for null namespace URI");
    if (XMLConstants.XML_NS_URI.equals(namespaceURI))
      return XMLConstants.XML_NS_PREFIX;
    if (XMLConstants.XMLNS_ATTRIBUTE_NS_URI.equals(namespaceURI))
      return XMLConstants.XMLNS_ATTRIBUTE;

    for (Map.Entry<String, String> entry: bindings.entrySet()) {
      if (namespaceURI.equals(entry.getValue()))
        return entry.getKey();
    }

    return null;
  }
1363060
@Override
  public String getPrefix(String namespaceURI)
  {
    if (namespaceURI == null || !namespaceURI.equals("http://www.christofreichardt.de/java/tracer"))
      throw new IllegalArgumentException("Accept only default namespace.");
    
    return "dns";
  }
302825
protected Location loadBaseURI(Scriptable cfg) throws URISyntaxException  {
		Object baseObj = cfg.get(BASEURL_CONFIGPARAM, cfg);
		Location result;
		if (baseObj == Scriptable.NOT_FOUND) {
			result = new Location(getConfigUri().resolve(".")); //$NON-NLS-1$
		} else {
			Location loc = loadLocation(baseObj, true);
			Location configLoc = new Location(getConfigUri(), loc.getOverride() != null ? getConfigUri() : null);
			result = configLoc.resolve(loc);
		}
		return result;
	}
1062818
static Proxy parseProxySettings(String spec) {

        try {
            if (spec == null || spec.length() == 0) {
                return null;
            }
            return new Proxy(spec);
        } catch (URISyntaxException e) {
            return null;
        }
    }
1142008
public String getJWTUri(String clientId, String redirectURI, String oAuthBasePath) {
    return UriBuilder.fromUri(oAuthBasePath)
    .scheme("https")
    .path("/oauth/auth")
    .queryParam("response_type", "code")
    .queryParam("scope", "signature%20impersonation")
    .queryParam("client_id", clientId)
    .queryParam("redirect_uri", redirectURI)
    .build().toString();
  }
636329
public String namespaceURI() {
        if (namespacePrefix == null || namespacePrefix.isEmpty()) return "";
        String uri = namespaceTagHints.get(namespacePrefix);
        return uri == null ? "" : uri;
    }
615258
@Override
    public String getEurekaServerURLContext() {
        return configInstance.getStringProperty(
                namespace + EUREKA_SERVER_URL_CONTEXT_KEY,
                configInstance.getStringProperty(namespace + EUREKA_SERVER_FALLBACK_URL_CONTEXT_KEY, null)
                        .get()).get();
    }
823820
@SneakyThrows
    public static OidcClientRegistrationResponse getClientRegistrationResponse(final OidcRegisteredService registeredService,
                                                                               final String serverPrefix) {
        val clientResponse = new OidcClientRegistrationResponse();
        clientResponse.setApplicationType(registeredService.getApplicationType());
        clientResponse.setClientId(registeredService.getClientId());
        clientResponse.setClientSecret(registeredService.getClientSecret());
        clientResponse.setSubjectType(registeredService.getSubjectType());
        clientResponse.setTokenEndpointAuthMethod(registeredService.getTokenEndpointAuthenticationMethod());
        clientResponse.setClientName(registeredService.getName());
        clientResponse.setRedirectUris(CollectionUtils.wrap(registeredService.getServiceId()));
        clientResponse.setContacts(
            registeredService.getContacts()
                .stream()
                .map(RegisteredServiceContact::getName)
                .filter(StringUtils::isNotBlank)
                .collect(Collectors.toList())
        );
        clientResponse.setGrantTypes(
            Arrays.stream(OAuth20GrantTypes.values())
                .map(type -> type.getType().toLowerCase())
                .collect(Collectors.toList()));

        clientResponse.setResponseTypes(
            Arrays.stream(OAuth20ResponseTypes.values())
                .map(type -> type.getType().toLowerCase())
                .collect(Collectors.toList()));

        val validator = new SimpleUrlValidatorFactoryBean(false).getObject();
        if (Objects.requireNonNull(validator).isValid(registeredService.getJwks())) {
            clientResponse.setJwksUri(registeredService.getJwks());
        } else {
            val jwks = new JsonWebKeySet(registeredService.getJwks());
            clientResponse.setJwks(jwks.toJson());
        }
        clientResponse.setLogo(registeredService.getLogo());
        clientResponse.setPolicyUri(registeredService.getInformationUrl());
        clientResponse.setTermsOfUseUri(registeredService.getPrivacyUrl());
        clientResponse.setRedirectUris(CollectionUtils.wrapList(registeredService.getServiceId()));
        val clientConfigUri = getClientConfigurationUri(registeredService, serverPrefix);
        clientResponse.setRegistrationClientUri(clientConfigUri);
        return clientResponse;
    }
224079
protected WSFederationRegisteredService getWsFederationRegisteredService(final Service targetService) {
        val svc = wsFederationRequestConfigurationContext.getServicesManager().findServiceBy(targetService, WSFederationRegisteredService.class);
        RegisteredServiceAccessStrategyUtils.ensureServiceAccessIsAllowed(targetService, svc);
        return svc;
    }
1165200
@Deprecated
    public Signer getSignerByURI(URI uri) {
        return awsClient == null ? null : awsClient.getSignerByURI(uri);
    }
843389
@Override
  public String getNamespaceURI(String prefix) {
    // per javax.xml.namespace.NamespaceContext doc
    if (prefix == null)
      throw new IllegalArgumentException("Cannot get namespace URI for null prefix");
    if (XMLConstants.XML_NS_PREFIX.equals(prefix))
      return XMLConstants.XML_NS_URI;
    if (XMLConstants.XMLNS_ATTRIBUTE.equals(prefix))
      return XMLConstants.XMLNS_ATTRIBUTE_NS_URI;

    String namespaceURI = bindings.get(prefix);

    // per javax.xml.namespace.NamespaceContext doc
    return (namespaceURI != null) ? namespaceURI : XMLConstants.NULL_NS_URI;
  }
1312314
public ServerBuilder annotatedService(String pathPrefix, Object service,
                                          Function<Service<HttpRequest, HttpResponse>,
                                                  ? extends Service<HttpRequest, HttpResponse>> decorator,
                                          Iterable<?> exceptionHandlersAndConverters) {
        requireNonNull(pathPrefix, "pathPrefix");
        requireNonNull(service, "service");
        requireNonNull(decorator, "decorator");
        requireNonNull(exceptionHandlersAndConverters, "exceptionHandlersAndConverters");

        defaultVirtualHostBuilderUpdated();
        defaultVirtualHostBuilder.annotatedService(pathPrefix, service, decorator,
                                                   exceptionHandlersAndConverters);
        return this;
    }
789999
@Override
	public HttpClient.RequestSender uri(String uri) {
		return new HttpClientFinalizer(cachedConfiguration.bootstrap(b -> HttpClientConfiguration.uri(b, uri)));
	}
1192352
public URI rewriteURI(Request request) throws URISyntaxException {
        String path = request.path();
        if (!path.startsWith(prefix)) {
            return null;
        }

        StringBuilder uri = new StringBuilder(redirectTo);
        if (redirectTo.endsWith("/")) {
            uri.setLength(uri.length() - 1);
        }
        String rest = path.substring(prefix.length());
        if (!rest.startsWith("/") && !rest.isEmpty()) {
            uri.append("/");
        }
        uri.append(rest);

        // Do we have a query String
        int index = request.uri().indexOf("?");
        String query = null;
        if (index != -1) {
            // Remove the ?
            query = request.uri().substring(index + 1);
        }

        if (!Strings.isNullOrEmpty(query)) {
            uri.append("?").append(query);
        }

        return URI.create(uri.toString()).normalize();
    }
785158
public static String serviceURI() throws VictimsException {
        URL merged;
        try {
            merged = new URL(new URL(uri()), entry());
            return merged.toString();
        } catch (MalformedURLException e) {
            throw new VictimsException(
                    "Invalid configuration for service URI.", e);
        }
    }
993177
@NoAuth
    @RequestMapping(value = "/prefix", method = RequestMethod.GET)
    @ResponseBody
    public ValueVo getPrefixUrl() {

        ValueVo confItemVo = new ValueVo();
        confItemVo.setStatus(Constants.OK);
        confItemVo.setValue(zooConfig.getZookeeperUrlPrefix());

        return confItemVo;
    }