mirror of
https://gitee.com/dromara/MaxKey.git
synced 2026-05-15 04:52:09 +08:00
m-11/6
This commit is contained in:
@@ -51,13 +51,13 @@ public abstract class AbstractAuthenticationRealm{
|
||||
|
||||
private static final String BADPASSWORDCOUNT_RESET_UPDATE_STATEMENT = "UPDATE USERINFO SET BADPASSWORDCOUNT = ? , ISLOCKED = ? ,UNLOCKTIME = ? WHERE ID = ?";
|
||||
|
||||
private static final String HISTORY_LOGIN_INSERT_STATEMENT = "INSERT INTO LOGIN_HISTORY (ID , SESSIONID , UID , USERNAME , DISPLAYNAME , LOGINTYPE , MESSAGE , CODE , PROVIDER , SOURCEIP , BROWSER , PLATFORM , APPLICATION , LOGINURL )VALUES( ? , ? , ? , ? , ?, ? , ? , ?, ? , ? , ?, ? , ? , ?)";
|
||||
private static final String HISTORY_LOGIN_INSERT_STATEMENT = "INSERT INTO HISTORY_LOGIN (ID , SESSIONID , UID , USERNAME , DISPLAYNAME , LOGINTYPE , MESSAGE , CODE , PROVIDER , SOURCEIP , BROWSER , PLATFORM , APPLICATION , LOGINURL )VALUES( ? , ? , ? , ? , ?, ? , ? , ?, ? , ? , ?, ? , ? , ?)";
|
||||
|
||||
private static final String LOGIN_USERINFO_UPDATE_STATEMENT = "UPDATE USERINFO SET LASTLOGINTIME = ? , LASTLOGINIP = ? , LOGINCOUNT = ?, ONLINE = "+UserInfo.ONLINE.ONLINE+" WHERE ID = ?";
|
||||
|
||||
private static final String LOGOUT_USERINFO_UPDATE_STATEMENT = "UPDATE USERINFO SET LASTLOGOFFTIME = ? , ONLINE = "+UserInfo.ONLINE.OFFLINE+" WHERE ID = ?";
|
||||
|
||||
private static final String HISTORY_LOGOUT_UPDATE_STATEMENT = "UPDATE LOGIN_HISTORY SET LOGOUTTIME = ? WHERE SESSIONID = ?";
|
||||
private static final String HISTORY_LOGOUT_UPDATE_STATEMENT = "UPDATE HISTORY_LOGIN SET LOGOUTTIME = ? WHERE SESSIONID = ?";
|
||||
|
||||
private static final String GROUPS_SELECT_STATEMENT = "SELECT DISTINCT G.ID,G.NAME FROM USERINFO U,GROUPS G,GROUP_MEMBER GM WHERE U.ID = ? AND U.ID=GM.MEMBERID AND GM.GROUPID=G.ID ";
|
||||
|
||||
|
||||
@@ -17,18 +17,13 @@ public final class PROTOCOLS {
|
||||
|
||||
public static final String FORMBASED = "Form_Based";
|
||||
|
||||
public static final String COOKIEBASED = "Cookie_Based";
|
||||
|
||||
public static final String TOKENBASED = "Token_Based";
|
||||
|
||||
public static final String LTPA = "LTPA";
|
||||
|
||||
//OAuth
|
||||
public static final String OAUTH10A = "OAuth v1.0a";
|
||||
public static final String OAUTH20 = "OAuth v2.0";
|
||||
public static final String OAUTH20 = "OAuth_v2.0";
|
||||
//SAML
|
||||
public static final String SAML11 = "SAML v1.1";
|
||||
public static final String SAML20 = "SAML v2.0";
|
||||
public static final String SAML20 = "SAML_v2.0";
|
||||
|
||||
public static final String OPEN_ID_CONNECT = "OpenID_Connect";
|
||||
|
||||
|
||||
@@ -8,7 +8,7 @@ import javax.persistence.GenerationType;
|
||||
import javax.persistence.Id;
|
||||
import javax.persistence.Table;
|
||||
|
||||
import org.maxkey.domain.apps.Applications;
|
||||
import org.maxkey.domain.apps.Apps;
|
||||
|
||||
|
||||
/*
|
||||
@@ -18,7 +18,7 @@ import org.maxkey.domain.apps.Applications;
|
||||
constraint PK_ROLES primary key clustered (ID)
|
||||
*/
|
||||
@Table(name = "GROUP_APP")
|
||||
public class GroupPrivileges extends Applications implements Serializable{
|
||||
public class GroupPrivileges extends Apps implements Serializable{
|
||||
|
||||
/**
|
||||
*
|
||||
|
||||
@@ -15,8 +15,8 @@ import org.apache.mybatis.jpa.persistence.JpaBaseDomain;
|
||||
* @author Crystal.Sea
|
||||
*
|
||||
*/
|
||||
@Table(name = "LOGIN_HISTORY")
|
||||
public class LoginHistory extends JpaBaseDomain implements Serializable{
|
||||
@Table(name = "HISTORY_LOGIN")
|
||||
public class HistoryLogin extends JpaBaseDomain implements Serializable{
|
||||
|
||||
/**
|
||||
*
|
||||
@@ -60,7 +60,7 @@ public class LoginHistory extends JpaBaseDomain implements Serializable{
|
||||
String startDate;
|
||||
String endDate;
|
||||
|
||||
public LoginHistory() {
|
||||
public HistoryLogin() {
|
||||
super();
|
||||
}
|
||||
|
||||
@@ -13,8 +13,8 @@ import org.apache.mybatis.jpa.persistence.JpaBaseDomain;
|
||||
*
|
||||
*/
|
||||
|
||||
@Table(name = "LOGIN_APPS_HISTORY")
|
||||
public class LoginAppsHistory extends JpaBaseDomain {
|
||||
@Table(name = "HISTORY_LOGIN_APPS")
|
||||
public class HistoryLoginApps extends JpaBaseDomain {
|
||||
|
||||
private static final long serialVersionUID = 5085201575292304749L;
|
||||
@Id
|
||||
@@ -42,7 +42,7 @@ public class LoginAppsHistory extends JpaBaseDomain {
|
||||
/**
|
||||
*
|
||||
*/
|
||||
public LoginAppsHistory() {
|
||||
public HistoryLoginApps() {
|
||||
super();
|
||||
// TODO Auto-generated constructor stub
|
||||
}
|
||||
@@ -68,7 +68,7 @@ public class LoginAppsHistory extends JpaBaseDomain {
|
||||
* @param sessionId
|
||||
* @param appId
|
||||
*/
|
||||
public LoginAppsHistory(String sessionId, String appId) {
|
||||
public HistoryLoginApps(String sessionId, String appId) {
|
||||
super();
|
||||
this.sessionId = sessionId;
|
||||
this.appId = appId;
|
||||
@@ -2,6 +2,8 @@ package org.maxkey.domain;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
import javax.persistence.Table;
|
||||
|
||||
import org.apache.mybatis.jpa.persistence.JpaBaseDomain;
|
||||
|
||||
|
||||
@@ -9,7 +11,8 @@ import org.apache.mybatis.jpa.persistence.JpaBaseDomain;
|
||||
* @author Crystal.Sea
|
||||
*
|
||||
*/
|
||||
public class Logs extends JpaBaseDomain implements Serializable {
|
||||
@Table(name = "HISTORY_LOGS")
|
||||
public class HistoryLogs extends JpaBaseDomain implements Serializable {
|
||||
|
||||
/**
|
||||
*
|
||||
@@ -31,11 +34,11 @@ public class Logs extends JpaBaseDomain implements Serializable {
|
||||
String startDate;
|
||||
String endDate;
|
||||
|
||||
public Logs() {
|
||||
public HistoryLogs() {
|
||||
super();
|
||||
}
|
||||
|
||||
public Logs(String serviceName, String code, String message,
|
||||
public HistoryLogs(String serviceName, String code, String message,
|
||||
String content, String messageType, String operateType,
|
||||
String createdBy, String username, String cname) {
|
||||
super();
|
||||
@@ -14,8 +14,8 @@ import org.maxkey.constants.BOOLEAN;
|
||||
import org.maxkey.domain.Accounts;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
@Table(name = "APPLICATIONS")
|
||||
public class Applications extends JpaBaseDomain implements Serializable{
|
||||
@Table(name = "APPS")
|
||||
public class Apps extends JpaBaseDomain implements Serializable{
|
||||
|
||||
/**
|
||||
*
|
||||
@@ -43,28 +43,33 @@ public class Applications extends JpaBaseDomain implements Serializable{
|
||||
/**
|
||||
*
|
||||
*/
|
||||
@Column
|
||||
private String name;
|
||||
/*
|
||||
* Login url
|
||||
*/
|
||||
@Column
|
||||
private String loginUrl;
|
||||
|
||||
@Column
|
||||
private String category;
|
||||
|
||||
@Column
|
||||
private String protocol;
|
||||
|
||||
@Column
|
||||
private String secret;
|
||||
/*
|
||||
* icon and icon upload field iconField
|
||||
*/
|
||||
@Column
|
||||
private byte[] icon;
|
||||
private MultipartFile iconFile;
|
||||
|
||||
@Column
|
||||
private int visible;
|
||||
/*
|
||||
* vendor
|
||||
*/
|
||||
@Column
|
||||
private String vendor;
|
||||
@Column
|
||||
private String vendorUrl;
|
||||
|
||||
/*
|
||||
@@ -74,13 +79,19 @@ public class Applications extends JpaBaseDomain implements Serializable{
|
||||
* SHARED
|
||||
* NONE
|
||||
*/
|
||||
@Column
|
||||
private int credential;
|
||||
@Column
|
||||
private String sharedUsername;
|
||||
@Column
|
||||
private String sharedPassword;
|
||||
@Column
|
||||
private String systemUserAttr;
|
||||
|
||||
//获取第三方token凭证
|
||||
@Column
|
||||
private String principal;
|
||||
@Column
|
||||
private String credentials;
|
||||
|
||||
/*
|
||||
@@ -98,19 +109,31 @@ public class Applications extends JpaBaseDomain implements Serializable{
|
||||
* issuer is domain name
|
||||
* subject is app id append domain name
|
||||
*/
|
||||
@Column
|
||||
private int isSignature;
|
||||
|
||||
@Column
|
||||
private int isAdapter;
|
||||
|
||||
@Column
|
||||
private String adapter;
|
||||
|
||||
protected Accounts appUser;
|
||||
|
||||
@Column
|
||||
protected int sortIndex;
|
||||
|
||||
@Column
|
||||
protected int status;
|
||||
@Column
|
||||
protected String createdBy;
|
||||
@Column
|
||||
protected String createdDate;
|
||||
@Column
|
||||
protected String modifiedBy;
|
||||
@Column
|
||||
protected String modifiedDate;
|
||||
@Column
|
||||
protected String description;
|
||||
|
||||
public Applications() {
|
||||
public Apps() {
|
||||
super();
|
||||
isSignature=BOOLEAN.FALSE;
|
||||
credential=CREDENTIALS.NONE;
|
||||
@@ -592,6 +615,46 @@ public class Applications extends JpaBaseDomain implements Serializable{
|
||||
this.credentials = credentials;
|
||||
}
|
||||
|
||||
public String getCreatedBy() {
|
||||
return createdBy;
|
||||
}
|
||||
|
||||
public void setCreatedBy(String createdBy) {
|
||||
this.createdBy = createdBy;
|
||||
}
|
||||
|
||||
public String getCreatedDate() {
|
||||
return createdDate;
|
||||
}
|
||||
|
||||
public void setCreatedDate(String createdDate) {
|
||||
this.createdDate = createdDate;
|
||||
}
|
||||
|
||||
public String getModifiedBy() {
|
||||
return modifiedBy;
|
||||
}
|
||||
|
||||
public void setModifiedBy(String modifiedBy) {
|
||||
this.modifiedBy = modifiedBy;
|
||||
}
|
||||
|
||||
public String getModifiedDate() {
|
||||
return modifiedDate;
|
||||
}
|
||||
|
||||
public void setModifiedDate(String modifiedDate) {
|
||||
this.modifiedDate = modifiedDate;
|
||||
}
|
||||
|
||||
public int getStatus() {
|
||||
return status;
|
||||
}
|
||||
|
||||
public void setStatus(int status) {
|
||||
this.status = status;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "Applications [name=" + name + ", loginUrl=" + loginUrl
|
||||
@@ -6,8 +6,8 @@ import javax.persistence.GenerationType;
|
||||
import javax.persistence.Id;
|
||||
import javax.persistence.Table;
|
||||
|
||||
@Table(name = "CAS_DETAILS")
|
||||
public class CasDetails extends Applications {
|
||||
@Table(name = "APPS_CAS_DETAILS")
|
||||
public class AppsCasDetails extends Apps {
|
||||
|
||||
/**
|
||||
*
|
||||
@@ -3,6 +3,8 @@
|
||||
*/
|
||||
package org.maxkey.domain.apps;
|
||||
|
||||
import javax.persistence.Table;
|
||||
|
||||
import org.maxkey.domain.Accounts;
|
||||
|
||||
|
||||
@@ -10,7 +12,8 @@ import org.maxkey.domain.Accounts;
|
||||
* @author Crystal.Sea
|
||||
*
|
||||
*/
|
||||
public class DesktopDetails extends Applications {
|
||||
@Table(name = "APPS_DESKTOP_DETAILS")
|
||||
public class AppsDesktopDetails extends Apps {
|
||||
|
||||
|
||||
public static final class ParameterType{
|
||||
@@ -52,7 +55,7 @@ public class DesktopDetails extends Applications {
|
||||
/**
|
||||
*
|
||||
*/
|
||||
public DesktopDetails() {
|
||||
public AppsDesktopDetails() {
|
||||
|
||||
}
|
||||
|
||||
@@ -1,7 +1,9 @@
|
||||
package org.maxkey.domain.apps;
|
||||
|
||||
import javax.persistence.Table;
|
||||
|
||||
public class ExtendApiDetails extends Applications {
|
||||
@Table(name = "APPS_EXTENDAPI_DETAILS")
|
||||
public class AppsExtendApiDetails extends Apps {
|
||||
|
||||
/**
|
||||
*
|
||||
@@ -10,8 +10,8 @@ import javax.persistence.Table;
|
||||
* @author Crystal.Sea
|
||||
*
|
||||
*/
|
||||
@Table(name = "FORM_BASED_DETAILS")
|
||||
public class FormBasedDetails extends Applications {
|
||||
@Table(name = "APPS_FORM_BASED_DETAILS")
|
||||
public class AppsFormBasedDetails extends Apps {
|
||||
/**
|
||||
*
|
||||
*/
|
||||
@@ -34,7 +34,7 @@ public class FormBasedDetails extends Applications {
|
||||
/**
|
||||
*
|
||||
*/
|
||||
public FormBasedDetails() {
|
||||
public AppsFormBasedDetails() {
|
||||
|
||||
}
|
||||
|
||||
@@ -1,10 +1,13 @@
|
||||
package org.maxkey.domain.apps;
|
||||
|
||||
import javax.persistence.Table;
|
||||
|
||||
import org.maxkey.domain.apps.oauth2.provider.client.BaseClientDetails;
|
||||
import org.springframework.util.StringUtils;
|
||||
|
||||
|
||||
public class OAuth20Details extends Applications {
|
||||
@Table(name = "APPS_OAUTH_CLIENT_DETAILS")
|
||||
public class AppsOAuth20Details extends Apps {
|
||||
|
||||
/**
|
||||
*
|
||||
@@ -46,7 +49,7 @@ public class OAuth20Details extends Applications {
|
||||
/**
|
||||
*
|
||||
*/
|
||||
public OAuth20Details() {
|
||||
public AppsOAuth20Details() {
|
||||
super();
|
||||
|
||||
}
|
||||
@@ -54,7 +57,7 @@ public class OAuth20Details extends Applications {
|
||||
/**
|
||||
*
|
||||
*/
|
||||
public OAuth20Details(Applications application,BaseClientDetails baseClientDetails) {
|
||||
public AppsOAuth20Details(Apps application,BaseClientDetails baseClientDetails) {
|
||||
super();
|
||||
this.id=application.getId();
|
||||
this.setName(application.getName());
|
||||
@@ -14,8 +14,8 @@ import org.springframework.web.multipart.MultipartFile;
|
||||
* @author Crystal.Sea
|
||||
*
|
||||
*/
|
||||
@Table(name = "SAML_V20_DETAILS")
|
||||
public class SAML20Details extends Applications {
|
||||
@Table(name = "APPS_SAML_V20_DETAILS")
|
||||
public class AppsSAML20Details extends Apps {
|
||||
|
||||
/**
|
||||
*
|
||||
@@ -66,12 +66,10 @@ public class SAML20Details extends Applications {
|
||||
/**
|
||||
* for upload
|
||||
*/
|
||||
@Column
|
||||
private MultipartFile certMetaFile;
|
||||
/**
|
||||
* metadata or certificate
|
||||
*/
|
||||
@Column
|
||||
private String fileType;
|
||||
|
||||
/**
|
||||
@@ -97,7 +95,7 @@ public class SAML20Details extends Applications {
|
||||
/**
|
||||
*
|
||||
*/
|
||||
public SAML20Details() {
|
||||
public AppsSAML20Details() {
|
||||
super();
|
||||
|
||||
}
|
||||
@@ -13,8 +13,8 @@ import javax.persistence.Table;
|
||||
* @author Crystal.Sea
|
||||
*
|
||||
*/
|
||||
@Table(name = "TOKEN_BASED_DETAILS")
|
||||
public class TokenBasedDetails extends Applications {
|
||||
@Table(name = "APPS_TOKEN_BASED_DETAILS")
|
||||
public class AppsTokenBasedDetails extends Apps {
|
||||
|
||||
/**
|
||||
*
|
||||
@@ -32,6 +32,8 @@ public class TokenBasedDetails extends Applications {
|
||||
private String redirectUri;
|
||||
//
|
||||
@Column
|
||||
private String tokenType;
|
||||
@Column
|
||||
private String cookieName;
|
||||
@Column
|
||||
private String algorithm;
|
||||
@@ -58,7 +60,7 @@ public class TokenBasedDetails extends Applications {
|
||||
|
||||
|
||||
|
||||
public TokenBasedDetails() {
|
||||
public AppsTokenBasedDetails() {
|
||||
super();
|
||||
}
|
||||
|
||||
@@ -172,6 +174,18 @@ public class TokenBasedDetails extends Applications {
|
||||
|
||||
|
||||
|
||||
public String getTokenType() {
|
||||
return tokenType;
|
||||
}
|
||||
|
||||
|
||||
|
||||
public void setTokenType(String tokenType) {
|
||||
this.tokenType = tokenType;
|
||||
}
|
||||
|
||||
|
||||
|
||||
public int getEmployeeNumber() {
|
||||
return employeeNumber;
|
||||
}
|
||||
@@ -7,7 +7,7 @@ package org.maxkey.domain.apps;
|
||||
* @author Crystal.Sea
|
||||
*
|
||||
*/
|
||||
public class UserApplications extends Applications {
|
||||
public class UserApps extends Apps {
|
||||
|
||||
/**
|
||||
*
|
||||
@@ -23,7 +23,7 @@ public class UserApplications extends Applications {
|
||||
/**
|
||||
*
|
||||
*/
|
||||
public UserApplications() {
|
||||
public UserApps() {
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user