public String getRedirectUri() { if (this.redirectUri == null || this.redirectUri.length() == 0) { String redirectUri2 = this.globalRedirectUri; if (this.authority != null) { redirectUri2 = redirectUri2.replace("%authority%", this.authority.getAuthority()); redirectUri2 = redirectUri2.replace("%contextRoot%", this.contextRoot); redirectUri2 = redirectUri2.replace("%origin%", this.authority.getOrigin()); } this.redirectUri = redirectUri2; } return this.redirectUri; }
String gadgetUri = null; if (this.authority != null) { gadgetUri = gadgetUriS.replace("%authority%", this.authority.getAuthority()); gadgetUri = gadgetUri.replace("%contextRoot%", this.contextRoot); gadgetUri = gadgetUri.replace("%origin%", this.authority.getOrigin()); gadgetUri = gadgetUri.replace("%scheme%", this.authority.getScheme());
public <T> T filterFields(JSONObject object, Set<String> fields, Class<T> clz) throws JSONException { if (!fields.isEmpty()) { // Create a copy with just the specified fields object = new JSONObject(object, fields.toArray(new String[fields .size()])); } String objectVal = object.toString(); if (authority != null) { objectVal = objectVal.replace("%origin%", authority.getOrigin()); } else { //provide default for junit tests objectVal = objectVal.replace("%origin%", "http://localhost:8080"); } return converter.convertToObject(objectVal, clz); } }
private String getReqVal(String container, String key) { String val = config.getString(container, key); if (val == null) { throw new RuntimeException( "Missing required config '" + key + "' for container: " + container); } if (authority != null) { val = val.replace("%authority%", authority.getAuthority()); } return val; }
String endpointVal = endpoint; if ( endpoint.startsWith("//") && authority != null ){ endpointVal = authority.getScheme() + ':' + endpoint;
authorizationUrl = authorizationUrl.replace("%authority%", this.authority.getAuthority()); authorizationUrl = authorizationUrl.replace("%contextRoot%", this.contextRoot); authorizationUrl = authorizationUrl.replace("%origin%", this.authority.getOrigin()); authorizationUrl = authorizationUrl.replace("%scheme%", this.authority.getScheme()); tokenUrl = tokenUrl.replace("%authority%", this.authority.getAuthority()); tokenUrl = tokenUrl.replace("%contextRoot%", this.contextRoot); tokenUrl = tokenUrl.replace("%origin%", this.authority.getOrigin()); tokenUrl = tokenUrl.replace("%scheme%", this.authority.getScheme());
public <T> T filterFields(JSONObject object, Set<String> fields, Class<T> clz) throws JSONException { if (!fields.isEmpty()) { // Create a copy with just the specified fields object = new JSONObject(object, fields.toArray(new String[fields .size()])); } String objectVal = object.toString(); if (authority != null) { objectVal = objectVal.replace("%origin%", authority.getOrigin()); } else { //provide default for junit tests objectVal = objectVal.replace("%origin%", "http://localhost:8080"); } return converter.convertToObject(objectVal, clz); } }
private String checkSuffix(String suffix) { if (suffix != null) { Matcher m = this.authpattern.matcher(suffix); if (m.matches()) { if (LOG.isLoggable(Level.WARNING)) { LOG.warning("You should not be using %authority% replacement in a running environment!"); LOG.warning("Check your config and specify an explicit locked domain suffix."); LOG.warning("Found suffix: " + suffix); } if (this.authority != null) { suffix = m.replaceAll(this.authority.getAuthority()); } } } return suffix; }
redirectUri = redirectUri.replace("%authority%", this.authority.getAuthority()); redirectUri = redirectUri.replace("%contextRoot%", this.contextRoot); redirectUri = redirectUri.replace("%origin%", this.authority.getOrigin()); redirectUri = redirectUri.replace("%scheme", this.authority.getScheme());
private String getReqVal(String container, String key) { String val = config.getString(container, key); if (val == null) { throw new RuntimeException("Missing required container config param, key: " + key + ", container: " + container); } if (authority != null) { val = val.replace("%authority%", authority.getAuthority()); } return val; }
private String getReqConfig(String container, String key) { String val = config.getString(container, key); if (val == null) { throw new RuntimeException("Missing required container config key: " + key + " for " + "container: " + container); } if (authority != null) { val = val.replace("%authority%", authority.getAuthority()); } else{ //require this for test purpose, %host% needs to be replaced with default value eg. StyleTagProxyEmbeddedUrlsVisitorTest if (val.contains("%authority%")) { val = val.replace("%authority%", "localhost:8080"); } } return val; } }
private String getReqConfig(String container, String key) { String ret = config.getString(container, key); if (ret == null) { ret = config.getString(ContainerConfig.DEFAULT_CONTAINER, key); if (ret == null) { throw new RuntimeException("Container '" + container + "' missing config for required param: " + key); } } if (authority != null) { ret = ret.replace("%authority%", authority.getAuthority()); } return ret; }
callback = callback.replace("%authority%", authority.getAuthority());