【添加】添加IAM对接的空白实体
This commit is contained in:
@@ -22,6 +22,13 @@
|
||||
<groupId>com.jero.boot</groupId>
|
||||
<artifactId>laws-modules</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.banboocloud</groupId>
|
||||
<artifactId>bim-codec</artifactId>
|
||||
<version>1.0.0</version>
|
||||
<scope>system</scope>
|
||||
<systemPath>${project.basedir}/lib/bim-codec-1.0.0.jar</systemPath>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
</project>
|
||||
+4
@@ -0,0 +1,4 @@
|
||||
package com.jero.modules.docking.iam.controller.dto;
|
||||
|
||||
public class IamOrgDto {
|
||||
}
|
||||
+10
@@ -0,0 +1,10 @@
|
||||
package com.jero.modules.docking.iam.controller.dto;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
@Data
|
||||
public class IamUserDto {
|
||||
}
|
||||
@@ -155,13 +155,5 @@
|
||||
<classifier>jdk17</classifier>
|
||||
<systemPath>${project.basedir}/lib/aspose-words-21.1-jdk17-cracked.jar</systemPath>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.banboocloud</groupId>
|
||||
<artifactId>bim-codec</artifactId>
|
||||
<version>1.0.0</version>
|
||||
<scope>system</scope>
|
||||
<classifier>jdk17</classifier>
|
||||
<systemPath>${project.basedir}/lib/bim-codec-1.0.0.jar</systemPath>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
</project>
|
||||
@@ -1,84 +1,84 @@
|
||||
package com.jero.modules.iam;
|
||||
|
||||
import com.bamboocloud.codec.BamboocloudFacade;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import java.io.BufferedReader;
|
||||
import java.io.IOException;
|
||||
import java.util.Iterator;
|
||||
import java.util.Map;
|
||||
import java.util.TreeMap;
|
||||
@Slf4j
|
||||
public class BamboocloudUtils {
|
||||
public static void main(String[] args) {
|
||||
String aes = BamboocloudFacade.encrypt("{\"uid\":\"104\",\"bimRequestId\":\"95d73fe7aa7a4930a3edea779708a46c\",\"resultCode\":\"0\",\"message\":\"success\"}", "123456", "AES");
|
||||
System.out.println(aes);
|
||||
String aes1 = getPlaintext("KJ3jbIflWkNiEq3oxE2d5oxtKRLO3CC7edGrq57RIB02RSRgPljiNcTfuWYLS3sc1tbZMLm5fWG2guLK100g9MkWH9NhlxorPSlcP8LaYuP5NeZ1wFP8iKqr5RredwXfDA3J1fjOCAJfzPvJ4HSb1w==", "123456", "AES");
|
||||
System.out.println(aes1);
|
||||
}
|
||||
public static boolean checkUsernamePassword(String username, String password) {
|
||||
log.info("username --->" + username + " password --- >" + password + " ----ok");
|
||||
if("bbcadmin".equals(username)&&"P@ssw0rd".equals(password)) {
|
||||
return true;
|
||||
}
|
||||
else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
public static String getPlaintext(String ciphertext, String key, String type) {
|
||||
return BamboocloudFacade.decrypt(ciphertext, key, type);
|
||||
}
|
||||
|
||||
public static Boolean verify(Map<String, Object> reqmap, String type) {
|
||||
Map<String, Object> verifymap = new TreeMap<String, Object>();
|
||||
StringBuffer sb = new StringBuffer();
|
||||
Iterator<String> it = reqmap.keySet().iterator();
|
||||
while (it.hasNext()) {
|
||||
String key = (String) it.next();
|
||||
verifymap.put(key, reqmap.get(key));
|
||||
}
|
||||
Iterator<String> ittree = verifymap.keySet().iterator();
|
||||
while (ittree.hasNext()) {
|
||||
String key = (String) ittree.next();
|
||||
if (!"signature".equals(key)) {
|
||||
sb.append(key).append("=").append(verifymap.get(key)).append("&");
|
||||
}
|
||||
}
|
||||
sb.deleteCharAt(sb.length() - 1);
|
||||
System.out.println(reqmap.get("signature") + " now " + sb.toString());
|
||||
return BamboocloudFacade.verify(reqmap.get("signature").toString(), sb.toString(), type);
|
||||
}
|
||||
|
||||
public static String getRequestBody(HttpServletRequest request) {
|
||||
BufferedReader br = null;
|
||||
StringBuilder sb = new StringBuilder();
|
||||
String str = "";
|
||||
try {
|
||||
br = request.getReader();
|
||||
while ((str = br.readLine()) != null) {
|
||||
sb.append(str);
|
||||
}
|
||||
br.close();
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
if (br != null) {
|
||||
try {
|
||||
br.close();
|
||||
} catch (IOException eo) {
|
||||
eo.printStackTrace();
|
||||
}
|
||||
}
|
||||
} finally {
|
||||
if (br != null) {
|
||||
try {
|
||||
br.close();
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
}
|
||||
return sb.toString();
|
||||
}
|
||||
}
|
||||
//package com.jero.modules.iam;
|
||||
//
|
||||
//import com.bamboocloud.codec.BamboocloudFacade;
|
||||
//import lombok.extern.slf4j.Slf4j;
|
||||
//
|
||||
//import javax.servlet.http.HttpServletRequest;
|
||||
//import java.io.BufferedReader;
|
||||
//import java.io.IOException;
|
||||
//import java.util.Iterator;
|
||||
//import java.util.Map;
|
||||
//import java.util.TreeMap;
|
||||
//@Slf4j
|
||||
//public class BamboocloudUtils {
|
||||
// public static void main(String[] args) {
|
||||
// String aes = BamboocloudFacade.encrypt("{\"uid\":\"104\",\"bimRequestId\":\"95d73fe7aa7a4930a3edea779708a46c\",\"resultCode\":\"0\",\"message\":\"success\"}", "123456", "AES");
|
||||
// System.out.println(aes);
|
||||
// String aes1 = getPlaintext("KJ3jbIflWkNiEq3oxE2d5oxtKRLO3CC7edGrq57RIB02RSRgPljiNcTfuWYLS3sc1tbZMLm5fWG2guLK100g9MkWH9NhlxorPSlcP8LaYuP5NeZ1wFP8iKqr5RredwXfDA3J1fjOCAJfzPvJ4HSb1w==", "123456", "AES");
|
||||
// System.out.println(aes1);
|
||||
// }
|
||||
// public static boolean checkUsernamePassword(String username, String password) {
|
||||
// log.info("username --->" + username + " password --- >" + password + " ----ok");
|
||||
// if("bbcadmin".equals(username)&&"P@ssw0rd".equals(password)) {
|
||||
// return true;
|
||||
// }
|
||||
// else {
|
||||
// return false;
|
||||
// }
|
||||
// }
|
||||
//
|
||||
// public static String getPlaintext(String ciphertext, String key, String type) {
|
||||
// return BamboocloudFacade.decrypt(ciphertext, key, type);
|
||||
// }
|
||||
//
|
||||
// public static Boolean verify(Map<String, Object> reqmap, String type) {
|
||||
// Map<String, Object> verifymap = new TreeMap<String, Object>();
|
||||
// StringBuffer sb = new StringBuffer();
|
||||
// Iterator<String> it = reqmap.keySet().iterator();
|
||||
// while (it.hasNext()) {
|
||||
// String key = (String) it.next();
|
||||
// verifymap.put(key, reqmap.get(key));
|
||||
// }
|
||||
// Iterator<String> ittree = verifymap.keySet().iterator();
|
||||
// while (ittree.hasNext()) {
|
||||
// String key = (String) ittree.next();
|
||||
// if (!"signature".equals(key)) {
|
||||
// sb.append(key).append("=").append(verifymap.get(key)).append("&");
|
||||
// }
|
||||
// }
|
||||
// sb.deleteCharAt(sb.length() - 1);
|
||||
// System.out.println(reqmap.get("signature") + " now " + sb.toString());
|
||||
// return BamboocloudFacade.verify(reqmap.get("signature").toString(), sb.toString(), type);
|
||||
// }
|
||||
//
|
||||
// public static String getRequestBody(HttpServletRequest request) {
|
||||
// BufferedReader br = null;
|
||||
// StringBuilder sb = new StringBuilder();
|
||||
// String str = "";
|
||||
// try {
|
||||
// br = request.getReader();
|
||||
// while ((str = br.readLine()) != null) {
|
||||
// sb.append(str);
|
||||
// }
|
||||
// br.close();
|
||||
// } catch (IOException e) {
|
||||
// e.printStackTrace();
|
||||
// if (br != null) {
|
||||
// try {
|
||||
// br.close();
|
||||
// } catch (IOException eo) {
|
||||
// eo.printStackTrace();
|
||||
// }
|
||||
// }
|
||||
// } finally {
|
||||
// if (br != null) {
|
||||
// try {
|
||||
// br.close();
|
||||
// } catch (IOException e) {
|
||||
// e.printStackTrace();
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
// return sb.toString();
|
||||
// }
|
||||
//}
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user