Compare commits

...

5 Commits

Author SHA1 Message Date
shimingxy
e71e4c068f 新建 org.dromara.maxkey.id
uuid
SnowFlakeId
IdTimeSequence
2025-12-04 10:59:13 +08:00
shimingxy
ea2a012617 Merge branch 'main' of https://github.com/dromara/MaxKey 2025-12-04 09:28:34 +08:00
MaxKey
cf9e66ca3f 默认关闭 actuator,消除actuator 未授权访问漏洞 2025-12-03 20:22:06 +08:00
MaxKey
ff9a199e4f maxkey-starter-web-static 2025-12-03 20:13:00 +08:00
MaxKey
7f5e63e28b freemarker use slf4j 2025-12-03 20:12:35 +08:00
38 changed files with 60 additions and 36 deletions

View File

@ -143,6 +143,7 @@ subprojects {
//implementation group: 'org.apache.commons', name: 'commons-digester3', version: "${commonsdigester3Version}"
//implementation group: 'commons-digester', name: 'commons-digester', version: "${commonsdigesterVersion}"
implementation group: 'commons-io', name: 'commons-io', version: "${commonsioVersion}"
implementation group: 'commons-logging', name: 'commons-logging', version: "${commonsloggingVersion}"
implementation group: 'commons-lang', name: 'commons-lang', version: "${commonslangVersion}"
implementation group: 'org.apache.commons', name: 'commons-lang3', version: "${commonslang3Version}"
implementation group: 'commons-logging', name: 'commons-logging', version: "${commonsloggingVersion}"

View File

@ -64,7 +64,7 @@ commonsdigesterVersion =2.1
commonsioVersion =2.16.1
commonslangVersion =2.6
commonslang3Version =3.14.0
commonsloggingVersion =1.3.1
commonsloggingVersion =1.3.5
commonspool2Version =2.12.0
commonshttpclientVersion =3.1
commonsfileuploadVersion =1.5

View File

@ -19,8 +19,8 @@ package org.dromara.maxkey.authn.provider.scancode;
import org.dromara.maxkey.authn.session.Session;
import org.dromara.maxkey.exception.BusinessException;
import org.dromara.maxkey.id.IdGenerator;
import org.dromara.maxkey.persistence.cache.MomentaryService;
import org.dromara.maxkey.util.IdGenerator;
import org.dromara.maxkey.util.TimeJsonUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

View File

@ -15,7 +15,9 @@
*/
package org.dromara.maxkey.util;
package org.dromara.maxkey.id;
import org.dromara.maxkey.util.StringGenerator;
public class IdGenerator {

View File

@ -18,7 +18,7 @@
/**
*
*/
package org.dromara.maxkey.util;
package org.dromara.maxkey.id;
import java.util.Date;

View File

@ -15,11 +15,13 @@
*/
package org.dromara.maxkey.util;
package org.dromara.maxkey.id;
import java.util.Calendar;
import java.util.Date;
import org.dromara.maxkey.util.DateUtils;
/**
* 描述: Twitter的分布式自增ID雪花算法snowflake (Java版)
*

View File

@ -15,7 +15,7 @@
*/
package org.dromara.maxkey.util;
package org.dromara.maxkey.id;
import java.lang.management.ManagementFactory;
import java.security.MessageDigest;
@ -27,6 +27,8 @@ import java.util.Random;
import java.util.TimeZone;
import java.util.concurrent.atomic.AtomicInteger;
import org.dromara.maxkey.util.EthernetAddress;
/**
* See README.md for more information
@ -377,7 +379,7 @@ public final class UUIDGenerator {
}
public static void version(org.dromara.maxkey.util.UUIDGenerator generated){
public static void version(org.dromara.maxkey.id.UUIDGenerator generated){
System.out.println("UUID : " + generated.toString());
System.out.println("raw bytes : " + Arrays.toString(generated.getBytes()));
System.out.println("process id : " + generated.getProcessId());

View File

@ -15,7 +15,7 @@
*/
package org.dromara.maxkey.uuid;
package org.dromara.maxkey.id.uuid;
//$Id$

View File

@ -15,7 +15,7 @@
*/
package org.dromara.maxkey.uuid;
package org.dromara.maxkey.id.uuid;
/**
* An interface representing an object that generates UUIDs.

View File

@ -33,7 +33,7 @@
// such third party rights.
//
package org.dromara.maxkey.uuid;
package org.dromara.maxkey.id.uuid;
import java.security.*;

View File

@ -19,10 +19,11 @@ package org.dromara.maxkey.util;
import com.google.gson.Gson;
import com.google.gson.GsonBuilder;
import org.dromara.maxkey.adapter.LocalDateTimeAdapter;
import java.time.LocalDateTime;
import org.dromara.maxkey.adapter.LocalDateTimeAdapter;
/**
* @description:
* @author: orangeBabu

View File

@ -17,7 +17,7 @@
package org.maxkey.util;
import org.dromara.maxkey.util.SnowFlakeId;
import org.dromara.maxkey.id.SnowFlakeId;
import org.joda.time.DateTime;
import org.junit.Test;

View File

@ -20,8 +20,8 @@ package org.maxkey.util;
import java.util.Date;
//import java.util.UUID;
import org.dromara.maxkey.util.UUIDGenerator;
import org.dromara.maxkey.uuid.UUID;
import org.dromara.maxkey.id.UUIDGenerator;
import org.dromara.maxkey.id.uuid.UUID;
import org.junit.Test;
public class UUIDGeneratorTest {

View File

@ -48,9 +48,11 @@ public class ProductEnvironment {
keyValueSet.add(key);
}
// out
for (Iterator<String> it = keyValueSet.iterator(); it.hasNext();) {
String key = it.next();
logger.trace("{} = {}" , key , map.get(key));
if(logger.isTraceEnabled()) {
for (Iterator<String> it = keyValueSet.iterator(); it.hasNext();) {
String key = it.next();
logger.trace("{} = {}" , key , map.get(key));
}
}
logger.info("APP_HOME" + " = {}" , PathUtils.getInstance().getAppPath());
@ -84,5 +86,7 @@ public class ProductEnvironment {
logger.info(WebConstants.DELIMITER);
//WARN No Root logger was configured, creating default ERROR-level Root logger with Console appender
System.setProperty("nacos.logging.default.config.enabled", "false");
//freemarker use slf4j
System.setProperty(freemarker.log.Logger.SYSTEM_PROPERTY_NAME_LOGGER_LIBRARY, freemarker.log.Logger.LIBRARY_NAME_SLF4J);
}
}

View File

@ -28,8 +28,8 @@ import java.util.Map;
import org.apache.commons.logging.LogFactory;
import org.dromara.maxkey.configuration.ApplicationConfig;
import org.dromara.maxkey.entity.Institutions;
import org.dromara.maxkey.id.IdGenerator;
import org.dromara.maxkey.util.DateUtils;
import org.dromara.maxkey.util.IdGenerator;
import org.joda.time.DateTime;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

View File

@ -19,6 +19,7 @@ package org.dromara.maxkey.passkey.endpoint;
import org.dromara.maxkey.passkey.manager.PasskeyManager;
import org.dromara.maxkey.entity.Message;
import org.dromara.maxkey.entity.idm.UserInfo;
import org.dromara.maxkey.id.IdGenerator;
import org.dromara.maxkey.persistence.service.UserInfoService;
import org.dromara.maxkey.authn.web.AuthorizationUtils;
import org.dromara.maxkey.authn.session.Session;
@ -28,7 +29,6 @@ import org.dromara.maxkey.authn.session.SessionManager;
import org.dromara.maxkey.authn.jwt.AuthJwt;
import org.dromara.maxkey.authn.jwt.AuthTokenService;
import org.dromara.maxkey.authn.LoginCredential;
import org.dromara.maxkey.util.IdGenerator;
import org.dromara.maxkey.web.WebContext;
import org.springframework.security.web.authentication.WebAuthenticationDetails;
import org.slf4j.Logger;

View File

@ -18,11 +18,11 @@ package org.dromara.maxkey.passkey.service.impl;
import org.dromara.maxkey.passkey.service.PasskeyService;
import org.dromara.maxkey.entity.passkey.UserPasskey;
import org.dromara.maxkey.id.IdGenerator;
import org.dromara.maxkey.entity.passkey.PasskeyChallenge;
import org.dromara.maxkey.passkey.config.PasskeyProperties;
import org.dromara.maxkey.persistence.service.UserPasskeyService;
import org.dromara.maxkey.persistence.service.PasskeyChallengeService;
import org.dromara.maxkey.util.IdGenerator;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Service;

View File

@ -27,8 +27,8 @@ import com.webauthn4j.server.ServerProperty;
import org.apache.commons.codec.binary.Base64;
import org.dromara.maxkey.entity.passkey.PasskeyChallenge;
import org.dromara.maxkey.entity.passkey.UserPasskey;
import org.dromara.maxkey.id.IdGenerator;
import org.dromara.maxkey.passkey.config.PasskeyProperties;
import org.dromara.maxkey.util.IdGenerator;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

View File

@ -30,7 +30,7 @@ import org.dromara.maxkey.entity.Message;
import org.dromara.maxkey.entity.SocialsAssociate;
import org.dromara.maxkey.entity.SocialsProvider;
import org.dromara.maxkey.entity.idm.UserInfo;
import org.dromara.maxkey.uuid.UUID;
import org.dromara.maxkey.id.uuid.UUID;
import org.dromara.maxkey.web.WebContext;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

View File

@ -0,0 +1,7 @@
description = "maxkey-starter-web-static"
dependencies {
}

View File

Before

Width:  |  Height:  |  Size: 66 KiB

After

Width:  |  Height:  |  Size: 66 KiB

View File

@ -30,12 +30,12 @@ import org.dromara.maxkey.crypto.password.NoOpPasswordEncoder;
import org.dromara.maxkey.crypto.password.PasswordReciprocal;
import org.dromara.maxkey.crypto.password.SM3PasswordEncoder;
import org.dromara.maxkey.crypto.password.StandardPasswordEncoder;
import org.dromara.maxkey.id.IdGenerator;
import org.dromara.maxkey.id.SnowFlakeId;
import org.dromara.maxkey.persistence.cache.InMemoryMomentaryService;
import org.dromara.maxkey.persistence.cache.MomentaryService;
import org.dromara.maxkey.persistence.cache.RedisMomentaryService;
import org.dromara.maxkey.persistence.redis.RedisConnectionFactory;
import org.dromara.maxkey.util.IdGenerator;
import org.dromara.maxkey.util.SnowFlakeId;
import org.dromara.maxkey.web.WebContext;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

View File

@ -6,6 +6,7 @@ apply plugin: 'java'
dependencies {
implementation project(":maxkey-commons:maxkey-common")
implementation project(":maxkey-starter:maxkey-starter-web-static")
//spring-cloud gateway server
implementation group: 'org.springframework.cloud', name: 'spring-cloud-gateway-server', version: "${springcloudVersion}"

View File

@ -46,6 +46,7 @@ dependencies {
implementation project(":maxkey-starter:maxkey-starter-sms")
implementation project(":maxkey-starter:maxkey-starter-social")
implementation project(":maxkey-starter:maxkey-starter-web")
implementation project(":maxkey-starter:maxkey-starter-web-static")
implementation project(":maxkey-authentications:maxkey-authentication-core")
implementation project(":maxkey-authentications:maxkey-authentication-provider")

View File

@ -268,11 +268,11 @@ maxkey.saml.v20.sp.issuing.entity.id =client.maxkey.o
############################################################################
#Management endpoints configuration #
############################################################################
management.security.enabled =false
management.endpoints.enabled-by-default=false
#management.endpoints.jmx.exposure.include=health,info
#management.endpoints.web.exposure.include=metrics,health,info,env,prometheus
management.endpoints.web.exposure.include =*
management.endpoint.health.show-details =ALWAYS
#management.endpoints.web.exposure.include =*
#management.endpoint.health.show-details =ALWAYS
management.health.redis.enabled =false
management.health.mail.enabled =false

View File

@ -44,6 +44,7 @@ dependencies {
implementation project(":maxkey-starter:maxkey-starter-otp")
implementation project(":maxkey-starter:maxkey-starter-sms")
implementation project(":maxkey-starter:maxkey-starter-web")
implementation project(":maxkey-starter:maxkey-starter-web-static")
implementation project(":maxkey-authentications:maxkey-authentication-core")
implementation project(":maxkey-authentications:maxkey-authentication-provider-mgt")

View File

@ -197,11 +197,11 @@ maxkey.job.cron.enable =true
############################################################################
#Management endpoints configuration #
############################################################################
management.security.enabled =false
management.endpoints.enabled-by-default=false
#management.endpoints.jmx.exposure.include=health,info
#management.endpoints.web.exposure.include=metrics,health,info,env,prometheus
management.endpoints.web.exposure.include =*
management.endpoint.health.show-details =ALWAYS
#management.endpoints.web.exposure.include =*
#management.endpoint.health.show-details =ALWAYS
management.health.redis.enabled =false
management.health.mail.enabled =false

Binary file not shown.

Before

Width:  |  Height:  |  Size: 66 KiB

View File

@ -43,6 +43,7 @@ dependencies {
implementation project(":maxkey-starter:maxkey-starter-otp")
implementation project(":maxkey-starter:maxkey-starter-sms")
implementation project(":maxkey-starter:maxkey-starter-web")
implementation project(":maxkey-starter:maxkey-starter-web-static")
implementation project(":maxkey-authentications:maxkey-authentication-core")
implementation project(":maxkey-authentications:maxkey-authentication-provider")

View File

@ -195,11 +195,11 @@ maxkey.job.cron.enable =true
############################################################################
#Management endpoints configuration #
############################################################################
management.security.enabled =false
management.endpoints.enabled-by-default=false
#management.endpoints.jmx.exposure.include=health,info
#management.endpoints.web.exposure.include=metrics,health,info,env,prometheus
management.endpoints.web.exposure.include =*
management.endpoint.health.show-details =ALWAYS
#management.endpoints.web.exposure.include =*
#management.endpoint.health.show-details =ALWAYS
management.health.redis.enabled =false
management.health.mail.enabled =false

Binary file not shown.

Before

Width:  |  Height:  |  Size: 66 KiB

View File

@ -37,6 +37,7 @@ include ('maxkey-starter:maxkey-starter-otp')
include ('maxkey-starter:maxkey-starter-sms')
include ('maxkey-starter:maxkey-starter-social')
include ('maxkey-starter:maxkey-starter-web')
include ('maxkey-starter:maxkey-starter-web-static')
include ('maxkey-starter:maxkey-starter-passkey')
//authentications