Skip to content

Commit

Permalink
Merge pull request #447 from zxy0728/master
Browse files Browse the repository at this point in the history
remove default account auth check & fix profile and monitor not matching
  • Loading branch information
zxy0728 authored Nov 16, 2018
2 parents e88c23a + 79af215 commit 8fce499
Show file tree
Hide file tree
Showing 5 changed files with 67 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ private static GUISSOClient createGUISSOClient(HttpServletRequest request) {
String ClientImplClassName = request.getServletContext().getInitParameter("uav.apphub.sso.implclass");

if (StringHelper.isEmpty(ClientImplClassName)) {
ClientImplClassName = "com.creditease.uav.apphub.sso.GUISSOLdapClient";
ClientImplClassName = "com.creditease.uav.apphub.sso.GUISSOSimpleClient";
}

GUISSOClient GUISSOClientImpl = null;
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
package com.creditease.uav.apphub.sso;

import java.util.List;
import java.util.Map;

import javax.servlet.http.HttpServletRequest;

public class GUISSOSimpleClient extends GUISSOClient {

@SuppressWarnings("unused")
private GUISSOSimpleClient() {

}

protected GUISSOSimpleClient(HttpServletRequest request) {
super(request);
}

@Override
protected Map<String, String> getUserByLoginImpl(String loginId, String loginPwd) {
// TODO Auto-generated method stub
return null;
}

@Override
public List<Map<String, String>> getUserByQuery(String email) {
// TODO Auto-generated method stub
return null;
}

@Override
public Map<String, Object> getEmailListByQuery(String email) {
// TODO Auto-generated method stub
return null;
}

}
2 changes: 1 addition & 1 deletion com.creditease.uav.console/src/main/webapp/WEB-INF/web.xml
Original file line number Diff line number Diff line change
Expand Up @@ -236,7 +236,7 @@

<context-param>
<param-name>uav.apphub.sso.implclass</param-name>
<param-value>com.creditease.uav.apphub.sso.GUISSOLdapClient</param-value>
<param-value>com.creditease.uav.apphub.sso.GUISSOSimpleClient</param-value>
</context-param>

<context-param>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1069,4 +1069,29 @@ public static String join(String[] array, String separator) {
}
return builder.toString();
}

public static String removeContinuousDupChars(String str, char ch) {

if(isEmpty(str)) {
return str;
}
char[] strChars = str.toCharArray();
int end = strChars.length;
for (int i = 0; i < end - 1 ; i++) {
if(strChars[i] == ch) {
while ((i + 1 < end) && (strChars[i + 1] == ch)) {
copyChars(strChars, i, i + 1, end - i - 1);
end--;
}
}
}
String newStr = new String(strChars, 0, end);
return newStr;
}

private static void copyChars(char[] chs, int dest, int src, int len) {
for(int pos = 0 ; pos < len; pos++) {
chs[pos + dest] = chs[pos + src];
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -452,7 +452,9 @@ public static String cleanRelativeURL(String reUrl) {
reUrl = StringHelper.getSubStrBeforeToken(reUrl, "=");
reUrl = StringHelper.getSubStrBeforeToken(reUrl, ":");
reUrl = StringHelper.getSubStrBeforeToken(reUrl, "&");

// Replace multi "/" to one "/"
reUrl = StringHelper.removeContinuousDupChars(reUrl, '/');

return reUrl;
}

Expand Down

0 comments on commit 8fce499

Please sign in to comment.