
io.getlime.security.powerauth.lib.util.http.PowerAuthRequestCanonizationUtils Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of powerauth-java-http Show documentation
Show all versions of powerauth-java-http Show documentation
PowerAuth 2.0 utility module for HTTP support
package io.getlime.security.powerauth.lib.util.http;
import java.io.UnsupportedEncodingException;
import java.net.URLDecoder;
import java.net.URLEncoder;
import java.util.ArrayList;
import java.util.Collections;
import java.util.Comparator;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
public class PowerAuthRequestCanonizationUtils {
/**
* Utility variable, used for the purpose of GET query attribute sorting (query attribute key).
*/
private static final String KEY = "key";
/**
* Utility variable, used for the purpose of GET query attribute sorting (query attribute value).
*/
private static final String VAL = "val";
/**
* Take the GET request query string (for example, "param1=key1¶m2=key2") and convert it to the
* canonized form by sorting the key value pairs primarily by keys and by values in case the keys are
* equal.
* @param queryString The original get query string, obtained for example by 'request.getQueryString();'.
* @return Canonized query string.
* @throws UnsupportedEncodingException In case UTF-8 is not supported.
*/
public static String canonizeGetParameters(String queryString) throws UnsupportedEncodingException {
List
© 2015 - 2025 Weber Informatics LLC | Privacy Policy