@Test public void testSanitizeNoDivision() { String uri = RpcUriUtils.sanitize("vrpcb: assertThat(uri, startsWith("vrpcb: assertThat(uri, endsWith("@serverserv.vha.domain.ext:9060/FOO/BAR BAZ")); }
public static String sanitize(String uri, ConnectionSpec auth) { try { String sanitizedUserInfo = ""; if ((auth != null) && (StringUtils.hasText(auth.toString()))) { if (auth instanceof AccessVerifyConnectionSpec) { String password = ((AccessVerifyConnectionSpec) auth).getCredentials(); password = DigestUtils.md5DigestAsHex(password.getBytes("UTF-8")); String division = ((AccessVerifyConnectionSpec) auth).getDivision(); if (StringUtils.hasText(division)) { sanitizedUserInfo = division + DIVISION_CREDENTIALS_DELIMITER + password; } else { sanitizedUserInfo = password; } } } UriComponentsBuilder builder = UriComponentsBuilder.fromUriString(uri).userInfo(sanitizedUserInfo); return builder.build().toString(); } catch (UnsupportedEncodingException e) { return null; } }
RpcUriUtils { public static String sanitize(String uri, ConnectionSpec auth) { try { String sanitizedUserInfo = ""; if ((auth != null) && (StringUtils.hasText(auth.toString()))) { if (auth instanceof AccessVerifyConnectionSpec) { String password = ((AccessVerifyConnectionSpec) auth).getCredentials(); password = DigestUtils.md5DigestAsHex(password.getBytes("UTF-8")); String division = ((AccessVerifyConnectionSpec) auth).getDivision(); if (StringUtils.hasText(division)) { sanitizedUserInfo = division + DIVISION_CREDENTIALS_DELIMITER + password; } else { sanitizedUserInfo = password; } } } UriComponentsBuilder builder = UriComponentsBuilder.fromUriString(uri).userInfo(sanitizedUserInfo); return builder.build().toString(); } catch (UnsupportedEncodingException e) { return null; } } }
RpcUriUtils { public static String sanitize(String uri, ConnectionSpec auth) { try { String sanitizedUserInfo = ""; if ((auth != null) && (StringUtils.hasText(auth.toString()))) { if (auth instanceof AccessVerifyConnectionSpec) { String password = ((AccessVerifyConnectionSpec) auth).getCredentials(); password = DigestUtils.md5DigestAsHex(password.getBytes("UTF-8")); String division = ((AccessVerifyConnectionSpec) auth).getDivision(); if (StringUtils.hasText(division)) { sanitizedUserInfo = division + DIVISION_CREDENTIALS_DELIMITER + password; } else { sanitizedUserInfo = password; } } } UriComponentsBuilder builder = UriComponentsBuilder.fromUriString(uri).userInfo(sanitizedUserInfo); return builder.build().toString(); } catch (UnsupportedEncodingException e) { return null; } }  }
RpcUriUtils { public static String sanitize(String uri, ConnectionSpec auth) { try { String sanitizedUserInfo = ""; if ((auth != null) && (StringUtils.hasText(auth.toString()))) { if (auth instanceof AccessVerifyConnectionSpec) { String password = ((AccessVerifyConnectionSpec) auth).getCredentials(); password = DigestUtils.md5DigestAsHex(password.getBytes("UTF-8")); String division = ((AccessVerifyConnectionSpec) auth).getDivision(); if (StringUtils.hasText(division)) { sanitizedUserInfo = division + DIVISION_CREDENTIALS_DELIMITER + password; } else { sanitizedUserInfo = password; } } } UriComponentsBuilder builder = UriComponentsBuilder.fromUriString(uri).userInfo(sanitizedUserInfo); return builder.build().toString(); } catch (UnsupportedEncodingException e) { return null; } }  @Deprecated static void isVistaRpcUri(URI uri); @Deprecated static void isVistaLinkUri(URI uri); @Deprecated static URI toURI(RpcRequest request); @Deprecated static URI toURI(RpcHost host, String rpcContext, String rpcName, List params, int timeout); static UriComponents toUriComponents(String uri); static UriComponents toUriComponents(RpcRequest request); static UriComponents toUriComponents(RpcHost host, String rpcContext, String rpcName, List params, int timeout); static UriComponents toUriComponents(RpcHost host, ConnectionSpec auth); static String toUriString(RpcHost host, ConnectionSpec auth); static String toAuthority(String vistaId, String division, String accessCode, String verifyCode, String clientAddress, String clientHostName); static String toAuthority(String vistaId, String division, String accessCode, String verifyCode, String newVerifyCode, String confirmNewVerifyCode, String clientAddress, String clientHostName); static String toAuthority(RpcHost host, String division, String accessCode, String verifyCode); static String toAuthority(RpcHost host, String credentials); static String toAuthority(String vistaId, String division, String appHandle, String clientAddress, String clientHostName); static String toPath(String rpcContext, String rpcName); static String toQuery(RpcRequest request); static String toQuery(List params, int timeout); static String toCredentials(ConnectionSpec auth); static String toCredentials(String division, String accessCode, String verifyCode, String clientAddress, String clientHostName); static String toCredentials(String division, String accessCode, String verifyCode, String newVerifyCode, String confirmNewVerifyCode, String clientAddress, String clientHostName); static String toCredentials(String division, String appHandle, String clientAddress, String clientHostName); static String extractUserInfo(String uri); static String extractDivision(String uri); @Deprecated static String extractDivision(URI uri); static String extractAccessCode(String uri); static String extractVerifyCode(String uri); static String extractCredentials(String uri); @Deprecated static String extractCredentials(URI uri); @Deprecated static String extractAccessCode(URI uri); @Deprecated static String extractVerifyCode(URI uri); @Deprecated static String extractRpcContext(URI uri); @Deprecated static String extractRpcName(URI uri); static String extractScheme(String uri); @Deprecated static String extractScheme(URI uri); static String extractHostname(String uri); @Deprecated static String extractHostname(URI uri); static int extractPort(String uri); @Deprecated static int extractPort(URI uri); static RpcHost extractHost(String uri); @Deprecated static RpcHost extractHost(URI uri); static String extractRpcContext(String uri); static String extractRpcName(String uri); static String sanitize(String uri, ConnectionSpec auth); @Deprecated static String sanitize(URI uri, ConnectionSpec auth); @Deprecated static URI toURI(String location); @Deprecated static URI toURI(String uri, List params); @Deprecated static URI toSafeURI(String uriString); static ConnectionSpec extractConnectionSpec(String uriString); }
RpcUriUtils { public static String sanitize(String uri, ConnectionSpec auth) { try { String sanitizedUserInfo = ""; if ((auth != null) && (StringUtils.hasText(auth.toString()))) { if (auth instanceof AccessVerifyConnectionSpec) { String password = ((AccessVerifyConnectionSpec) auth).getCredentials(); password = DigestUtils.md5DigestAsHex(password.getBytes("UTF-8")); String division = ((AccessVerifyConnectionSpec) auth).getDivision(); if (StringUtils.hasText(division)) { sanitizedUserInfo = division + DIVISION_CREDENTIALS_DELIMITER + password; } else { sanitizedUserInfo = password; } } } UriComponentsBuilder builder = UriComponentsBuilder.fromUriString(uri).userInfo(sanitizedUserInfo); return builder.build().toString(); } catch (UnsupportedEncodingException e) { return null; } }  @Deprecated static void isVistaRpcUri(URI uri); @Deprecated static void isVistaLinkUri(URI uri); @Deprecated static URI toURI(RpcRequest request); @Deprecated static URI toURI(RpcHost host, String rpcContext, String rpcName, List params, int timeout); static UriComponents toUriComponents(String uri); static UriComponents toUriComponents(RpcRequest request); static UriComponents toUriComponents(RpcHost host, String rpcContext, String rpcName, List params, int timeout); static UriComponents toUriComponents(RpcHost host, ConnectionSpec auth); static String toUriString(RpcHost host, ConnectionSpec auth); static String toAuthority(String vistaId, String division, String accessCode, String verifyCode, String clientAddress, String clientHostName); static String toAuthority(String vistaId, String division, String accessCode, String verifyCode, String newVerifyCode, String confirmNewVerifyCode, String clientAddress, String clientHostName); static String toAuthority(RpcHost host, String division, String accessCode, String verifyCode); static String toAuthority(RpcHost host, String credentials); static String toAuthority(String vistaId, String division, String appHandle, String clientAddress, String clientHostName); static String toPath(String rpcContext, String rpcName); static String toQuery(RpcRequest request); static String toQuery(List params, int timeout); static String toCredentials(ConnectionSpec auth); static String toCredentials(String division, String accessCode, String verifyCode, String clientAddress, String clientHostName); static String toCredentials(String division, String accessCode, String verifyCode, String newVerifyCode, String confirmNewVerifyCode, String clientAddress, String clientHostName); static String toCredentials(String division, String appHandle, String clientAddress, String clientHostName); static String extractUserInfo(String uri); static String extractDivision(String uri); @Deprecated static String extractDivision(URI uri); static String extractAccessCode(String uri); static String extractVerifyCode(String uri); static String extractCredentials(String uri); @Deprecated static String extractCredentials(URI uri); @Deprecated static String extractAccessCode(URI uri); @Deprecated static String extractVerifyCode(URI uri); @Deprecated static String extractRpcContext(URI uri); @Deprecated static String extractRpcName(URI uri); static String extractScheme(String uri); @Deprecated static String extractScheme(URI uri); static String extractHostname(String uri); @Deprecated static String extractHostname(URI uri); static int extractPort(String uri); @Deprecated static int extractPort(URI uri); static RpcHost extractHost(String uri); @Deprecated static RpcHost extractHost(URI uri); static String extractRpcContext(String uri); static String extractRpcName(String uri); static String sanitize(String uri, ConnectionSpec auth); @Deprecated static String sanitize(URI uri, ConnectionSpec auth); @Deprecated static URI toURI(String location); @Deprecated static URI toURI(String uri, List params); @Deprecated static URI toSafeURI(String uriString); static ConnectionSpec extractConnectionSpec(String uriString); static final String VISTA_RPC_BROKER_SCHEME; static final String VISTALINK_SCHEME; static final int DEFAULT_PORT; static final String DIVISION_CREDENTIALS_DELIMITER; static final String ACCESS_VERIFY_CODE_DELIMITER; }