Scope can be private
This commit is contained in:
parent
1ea1f0af96
commit
5973ccd522
5 changed files with 12 additions and 12 deletions
|
@ -12,7 +12,9 @@ import java.util.concurrent.atomic.AtomicLong;
|
||||||
* @version $Revision: 1 $
|
* @version $Revision: 1 $
|
||||||
*/
|
*/
|
||||||
public class AbstractOAuthClient {
|
public class AbstractOAuthClient {
|
||||||
public static final String OAUTH_TOKEN_REQUEST_STATE = "OAuth_Token_Request_State";
|
private static final String OAUTH_TOKEN_REQUEST_STATE = "OAuth_Token_Request_State";
|
||||||
|
private final AtomicLong counter = new AtomicLong();
|
||||||
|
|
||||||
protected String clientId;
|
protected String clientId;
|
||||||
protected Map<String, String> credentials;
|
protected Map<String, String> credentials;
|
||||||
protected String authUrl;
|
protected String authUrl;
|
||||||
|
@ -23,8 +25,6 @@ public class AbstractOAuthClient {
|
||||||
protected String stateCookiePath;
|
protected String stateCookiePath;
|
||||||
protected boolean isSecure;
|
protected boolean isSecure;
|
||||||
protected boolean publicClient;
|
protected boolean publicClient;
|
||||||
protected final AtomicLong counter = new AtomicLong();
|
|
||||||
|
|
||||||
protected String getStateCode() {
|
protected String getStateCode() {
|
||||||
return counter.getAndIncrement() + "/" + UUID.randomUUID().toString();
|
return counter.getAndIncrement() + "/" + UUID.randomUUID().toString();
|
||||||
}
|
}
|
||||||
|
|
|
@ -15,7 +15,7 @@ import java.security.NoSuchAlgorithmException;
|
||||||
* @version $Revision: 1 $
|
* @version $Revision: 1 $
|
||||||
*/
|
*/
|
||||||
public class HMACProvider {
|
public class HMACProvider {
|
||||||
public static String getJavaAlgorithm(Algorithm alg) {
|
private static String getJavaAlgorithm(Algorithm alg) {
|
||||||
switch (alg) {
|
switch (alg) {
|
||||||
case HS256:
|
case HS256:
|
||||||
return "HMACSHA256";
|
return "HMACSHA256";
|
||||||
|
@ -28,7 +28,7 @@ public class HMACProvider {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public static Mac getMAC(final Algorithm alg) {
|
private static Mac getMAC(final Algorithm alg) {
|
||||||
|
|
||||||
try {
|
try {
|
||||||
return Mac.getInstance(getJavaAlgorithm(alg));
|
return Mac.getInstance(getJavaAlgorithm(alg));
|
||||||
|
|
|
@ -4,7 +4,7 @@ package org.keycloak.representations.idm;
|
||||||
* @author <a href="mailto:sthorger@redhat.com">Stian Thorgersen</a>
|
* @author <a href="mailto:sthorger@redhat.com">Stian Thorgersen</a>
|
||||||
*/
|
*/
|
||||||
public class ErrorRepresentation {
|
public class ErrorRepresentation {
|
||||||
public String errorMessage;
|
private String errorMessage;
|
||||||
|
|
||||||
public ErrorRepresentation() {
|
public ErrorRepresentation() {
|
||||||
}
|
}
|
||||||
|
|
|
@ -268,7 +268,7 @@ public class Encode
|
||||||
return buf.toString();
|
return buf.toString();
|
||||||
}
|
}
|
||||||
|
|
||||||
public static boolean savePathParams(String segment, StringBuffer newSegment, List<String> params)
|
private static boolean savePathParams(String segment, StringBuffer newSegment, List<String> params)
|
||||||
{
|
{
|
||||||
boolean foundParam = false;
|
boolean foundParam = false;
|
||||||
// Regular expressions can have '{' and '}' characters. Replace them to do match
|
// Regular expressions can have '{' and '}' characters. Replace them to do match
|
||||||
|
@ -293,7 +293,7 @@ public class Encode
|
||||||
* @param encoding
|
* @param encoding
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
public static String encodeValue(String segment, String[] encoding)
|
private static String encodeValue(String segment, String[] encoding)
|
||||||
{
|
{
|
||||||
ArrayList<String> params = new ArrayList<String>();
|
ArrayList<String> params = new ArrayList<String>();
|
||||||
boolean foundParam = false;
|
boolean foundParam = false;
|
||||||
|
@ -395,7 +395,7 @@ public class Encode
|
||||||
return encodeFromArray(nameOrValue, queryNameValueEncoding, true);
|
return encodeFromArray(nameOrValue, queryNameValueEncoding, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
protected static String encodeFromArray(String segment, String[] encodingMap, boolean encodePercent)
|
private static String encodeFromArray(String segment, String[] encodingMap, boolean encodePercent)
|
||||||
{
|
{
|
||||||
StringBuffer result = new StringBuffer();
|
StringBuffer result = new StringBuffer();
|
||||||
for (int i = 0; i < segment.length(); i++)
|
for (int i = 0; i < segment.length(); i++)
|
||||||
|
@ -445,7 +445,7 @@ public class Encode
|
||||||
return encoded;
|
return encoded;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static String pathParamReplacement(String segment, List<String> params)
|
private static String pathParamReplacement(String segment, List<String> params)
|
||||||
{
|
{
|
||||||
StringBuffer newSegment = new StringBuffer();
|
StringBuffer newSegment = new StringBuffer();
|
||||||
Matcher matcher = PARAM_REPLACEMENT.matcher(segment);
|
Matcher matcher = PARAM_REPLACEMENT.matcher(segment);
|
||||||
|
|
|
@ -55,8 +55,8 @@ public class KeycloakUriBuilder {
|
||||||
return impl;
|
return impl;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static final Pattern opaqueUri = Pattern.compile("^([^:/?#]+):([^/].*)");
|
private static final Pattern opaqueUri = Pattern.compile("^([^:/?#]+):([^/].*)");
|
||||||
public static final Pattern hierarchicalUri = Pattern.compile("^(([^:/?#]+):)?(//([^/?#]*))?([^?#]*)(\\?([^#]*))?(#(.*))?");
|
private static final Pattern hierarchicalUri = Pattern.compile("^(([^:/?#]+):)?(//([^/?#]*))?([^?#]*)(\\?([^#]*))?(#(.*))?");
|
||||||
private static final Pattern hostPortPattern = Pattern.compile("([^/:]+):(\\d+)");
|
private static final Pattern hostPortPattern = Pattern.compile("([^/:]+):(\\d+)");
|
||||||
|
|
||||||
public static boolean compare(String s1, String s2) {
|
public static boolean compare(String s1, String s2) {
|
||||||
|
|
Loading…
Reference in a new issue