代码优化
This commit is contained in:
+11
-5
@@ -24,21 +24,21 @@ import org.dromara.maxkey.authn.jwt.AuthTokenService;
|
||||
import org.dromara.maxkey.authn.session.Session;
|
||||
import org.dromara.maxkey.authn.session.SessionManager;
|
||||
import org.dromara.maxkey.entity.Message;
|
||||
import org.dromara.maxkey.util.StrUtils;
|
||||
import org.dromara.maxkey.web.WebContext;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.http.HttpStatus;
|
||||
import org.springframework.http.MediaType;
|
||||
import org.springframework.http.ResponseEntity;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import jakarta.servlet.http.HttpServletRequest;
|
||||
|
||||
@Controller
|
||||
@RestController
|
||||
@RequestMapping(value = "/auth")
|
||||
public class AuthTokenRefreshPoint {
|
||||
private static final Logger _logger = LoggerFactory.getLogger(AuthTokenRefreshPoint.class);
|
||||
@@ -52,7 +52,13 @@ public class AuthTokenRefreshPoint {
|
||||
@Autowired
|
||||
SessionManager sessionManager;
|
||||
|
||||
@RequestMapping(value={"/token/refresh"}, produces = {MediaType.APPLICATION_JSON_VALUE})
|
||||
@GetMapping(value={"/token/refresh"})
|
||||
public ResponseEntity<?> refreshGet(HttpServletRequest request,
|
||||
@RequestParam(name = "refresh_token", required = false) String refreshToken) {
|
||||
return refresh(request,refreshToken);
|
||||
}
|
||||
|
||||
@PostMapping(value={"/token/refresh"})
|
||||
public ResponseEntity<?> refresh(HttpServletRequest request,
|
||||
@RequestParam(name = "refresh_token", required = false) String refreshToken) {
|
||||
_logger.debug("try to refresh token " );
|
||||
|
||||
+4
-5
@@ -27,10 +27,9 @@ import org.dromara.maxkey.persistence.service.FileUploadService;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.http.ResponseEntity;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.web.bind.annotation.ModelAttribute;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.ResponseBody;
|
||||
|
||||
import jakarta.servlet.http.HttpServletRequest;
|
||||
@@ -44,9 +43,9 @@ public class FileUploadEndpoint {
|
||||
@Autowired
|
||||
FileUploadService fileUploadService;
|
||||
|
||||
@RequestMapping(value={"/file/upload/"})
|
||||
@PostMapping({"/file/upload/"})
|
||||
@ResponseBody
|
||||
public ResponseEntity<?> upload( HttpServletRequest request,
|
||||
public Message<Object> upload( HttpServletRequest request,
|
||||
HttpServletResponse response,
|
||||
@ModelAttribute FileUpload fileUpload,
|
||||
@CurrentUser UserInfo currentUser){
|
||||
@@ -68,7 +67,7 @@ public class FileUploadEndpoint {
|
||||
_logger.error("FileUpload IOException",e);
|
||||
}
|
||||
}
|
||||
return new Message<Object>(Message.SUCCESS,(Object)fileUpload.getId()).buildResponse();
|
||||
return new Message<Object>(Message.SUCCESS,(Object)fileUpload.getId());
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
+9
-10
@@ -25,22 +25,21 @@ import org.dromara.maxkey.persistence.repository.InstitutionsRepository;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.http.MediaType;
|
||||
import org.springframework.http.ResponseEntity;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.RequestHeader;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import jakarta.servlet.http.HttpServletRequest;
|
||||
|
||||
@Controller
|
||||
@RestController
|
||||
@RequestMapping(value = "/inst")
|
||||
public class InstitutionEndpoint {
|
||||
private static final Logger _logger = LoggerFactory.getLogger(InstitutionEndpoint.class);
|
||||
|
||||
public final static String HEADER_HOST = "host";
|
||||
public static final String HEADER_HOST = "host";
|
||||
|
||||
public final static String HEADER_HOSTNAME = "hostname";
|
||||
public static final String HEADER_HOSTNAME = "hostname";
|
||||
|
||||
@Autowired
|
||||
InstitutionsRepository institutionsRepository;
|
||||
@@ -48,8 +47,8 @@ public class InstitutionEndpoint {
|
||||
@Autowired
|
||||
ApplicationConfig applicationConfig;
|
||||
|
||||
@RequestMapping(value={"/get"}, produces = {MediaType.APPLICATION_JSON_VALUE})
|
||||
public ResponseEntity<?> get(
|
||||
@GetMapping(value={"/get"})
|
||||
public Message<Institutions> get(
|
||||
HttpServletRequest request,
|
||||
@RequestHeader(value = "Origin",required=false) String originURL,
|
||||
@RequestHeader(value = HEADER_HOSTNAME,required=false) String headerHostName,
|
||||
@@ -76,11 +75,11 @@ public class InstitutionEndpoint {
|
||||
Institutions inst = institutionsRepository.get(host);
|
||||
if(inst != null) {
|
||||
_logger.debug("inst {}",inst);
|
||||
return new Message<Institutions>(inst).buildResponse();
|
||||
return new Message<>(inst);
|
||||
}else {
|
||||
Institutions defaultInst = institutionsRepository.get("1");
|
||||
_logger.debug("default inst {}",inst);
|
||||
return new Message<Institutions>(defaultInst).buildResponse();
|
||||
return new Message<>(defaultInst);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+4
-4
@@ -56,10 +56,10 @@ public abstract class AbstractAuthenticationProvider {
|
||||
public static String PROVIDER_SUFFIX = "AuthenticationProvider";
|
||||
|
||||
public class AuthType{
|
||||
public final static String NORMAL = "normal";
|
||||
public final static String TFA = "tfa";
|
||||
public final static String MOBILE = "mobile";
|
||||
public final static String TRUSTED = "trusted";
|
||||
public static final String NORMAL = "normal";
|
||||
public static final String TFA = "tfa";
|
||||
public static final String MOBILE = "mobile";
|
||||
public static final String TRUSTED = "trusted";
|
||||
}
|
||||
|
||||
protected ApplicationConfig applicationConfig;
|
||||
|
||||
+1
-1
@@ -30,7 +30,7 @@ import org.slf4j.LoggerFactory;
|
||||
*
|
||||
*/
|
||||
public final class ActiveDirectoryServer implements IAuthenticationServer {
|
||||
private final static Logger _logger = LoggerFactory.getLogger(ActiveDirectoryServer.class);
|
||||
private static final Logger _logger = LoggerFactory.getLogger(ActiveDirectoryServer.class);
|
||||
|
||||
ActiveDirectoryUtils activeDirectoryUtils;
|
||||
|
||||
|
||||
+1
-1
@@ -30,7 +30,7 @@ import jakarta.validation.constraints.NotNull;
|
||||
import jakarta.validation.constraints.Size;
|
||||
|
||||
public class LdapAuthenticationRealm extends AbstractAuthenticationRealm{
|
||||
private final static Logger _logger = LoggerFactory.getLogger(LdapAuthenticationRealm.class);
|
||||
private static final Logger _logger = LoggerFactory.getLogger(LdapAuthenticationRealm.class);
|
||||
|
||||
@NotNull
|
||||
@Size(min=1)
|
||||
|
||||
+1
-1
@@ -35,7 +35,7 @@ import org.slf4j.LoggerFactory;
|
||||
*
|
||||
*/
|
||||
public final class StandardLdapServer implements IAuthenticationServer {
|
||||
private final static Logger _logger = LoggerFactory.getLogger(StandardLdapServer.class);
|
||||
private static final Logger _logger = LoggerFactory.getLogger(StandardLdapServer.class);
|
||||
|
||||
LdapUtils ldapUtils;
|
||||
|
||||
|
||||
+7
-6
@@ -22,6 +22,7 @@ import org.dromara.maxkey.authn.jwt.AuthTokenService;
|
||||
import org.dromara.maxkey.authn.provider.AbstractAuthenticationProvider;
|
||||
import org.dromara.maxkey.configuration.ApplicationConfig;
|
||||
import org.dromara.maxkey.constants.ConstsLoginType;
|
||||
import org.dromara.maxkey.entity.Institutions;
|
||||
import org.dromara.maxkey.entity.Message;
|
||||
import org.dromara.maxkey.web.WebConstants;
|
||||
import org.slf4j.Logger;
|
||||
@@ -54,7 +55,7 @@ public class HttpJwtEntryPoint {
|
||||
JwtLoginService jwtLoginService;
|
||||
|
||||
@RequestMapping(value={"/jwt"}, produces = {MediaType.APPLICATION_JSON_VALUE})
|
||||
public ResponseEntity<?> jwt(@RequestParam(value = WebConstants.JWT_TOKEN_PARAMETER, required = true) String jwt) {
|
||||
public Message<AuthJwt> jwt(@RequestParam(value = WebConstants.JWT_TOKEN_PARAMETER, required = true) String jwt) {
|
||||
try {
|
||||
//for jwt Login
|
||||
_logger.debug("jwt : " + jwt);
|
||||
@@ -67,13 +68,13 @@ public class HttpJwtEntryPoint {
|
||||
Authentication authentication = authenticationProvider.authenticate(loginCredential,true);
|
||||
_logger.debug("JWT Logined in , username " + username);
|
||||
AuthJwt authJwt = authTokenService.genAuthJwt(authentication);
|
||||
return new Message<AuthJwt>(authJwt).buildResponse();
|
||||
return new Message<AuthJwt>(authJwt);
|
||||
}
|
||||
}catch(Exception e) {
|
||||
_logger.error("Exception ",e);
|
||||
}
|
||||
|
||||
return new Message<AuthJwt>(Message.FAIL).buildResponse();
|
||||
return new Message<AuthJwt>(Message.FAIL);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -82,7 +83,7 @@ public class HttpJwtEntryPoint {
|
||||
* @return
|
||||
*/
|
||||
@RequestMapping(value={"/jwt/trust"}, produces = {MediaType.APPLICATION_JSON_VALUE})
|
||||
public ResponseEntity<?> jwtTrust(@RequestParam(value = WebConstants.JWT_TOKEN_PARAMETER, required = true) String jwt) {
|
||||
public Message<AuthJwt> jwtTrust(@RequestParam(value = WebConstants.JWT_TOKEN_PARAMETER, required = true) String jwt) {
|
||||
try {
|
||||
//for jwt Login
|
||||
_logger.debug("jwt : " + jwt);
|
||||
@@ -93,13 +94,13 @@ public class HttpJwtEntryPoint {
|
||||
Authentication authentication = authenticationProvider.authenticate(loginCredential,true);
|
||||
_logger.debug("JWT Logined in , username " + username);
|
||||
AuthJwt authJwt = authTokenService.genAuthJwt(authentication);
|
||||
return new Message<AuthJwt>(authJwt).buildResponse();
|
||||
return new Message<AuthJwt>(authJwt);
|
||||
}
|
||||
}catch(Exception e) {
|
||||
_logger.error("Exception ",e);
|
||||
}
|
||||
|
||||
return new Message<AuthJwt>(Message.FAIL).buildResponse();
|
||||
return new Message<AuthJwt>(Message.FAIL);
|
||||
}
|
||||
|
||||
|
||||
|
||||
+1
-1
@@ -22,7 +22,7 @@ import org.slf4j.LoggerFactory;
|
||||
|
||||
|
||||
public class WsFederationServiceImpl implements WsFederationService{
|
||||
final static Logger _logger = LoggerFactory.getLogger(WsFederationServiceImpl.class);
|
||||
static final Logger _logger = LoggerFactory.getLogger(WsFederationServiceImpl.class);
|
||||
|
||||
private WsFederationConfiguration wsFederationConfiguration;
|
||||
|
||||
|
||||
+1
-1
@@ -40,7 +40,7 @@ import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
public class AuthWeChatEnterpriseWebRequestCost extends AbstractAuthWeChatEnterpriseRequest {
|
||||
final static Logger _logger = LoggerFactory.getLogger(AuthWeChatEnterpriseWebRequestCost.class);
|
||||
static final Logger _logger = LoggerFactory.getLogger(AuthWeChatEnterpriseWebRequestCost.class);
|
||||
public AuthWeChatEnterpriseWebRequestCost(AuthConfig config) {
|
||||
super(config, AuthDefaultSource.WECHAT_ENTERPRISE_WEB);
|
||||
}
|
||||
|
||||
+1
-1
@@ -42,7 +42,7 @@ import me.zhyd.oauth.request.AuthRequest;
|
||||
*
|
||||
*/
|
||||
public class AbstractSocialSignOnEndpoint {
|
||||
final static Logger _logger = LoggerFactory.getLogger(AbstractSocialSignOnEndpoint.class);
|
||||
static final Logger _logger = LoggerFactory.getLogger(AbstractSocialSignOnEndpoint.class);
|
||||
|
||||
protected AuthRequest authRequest;
|
||||
|
||||
|
||||
+25
-25
@@ -51,12 +51,12 @@ import java.util.Map;
|
||||
@Controller
|
||||
@RequestMapping(value = "/logon/oauth20")
|
||||
public class SocialSignOnEndpoint extends AbstractSocialSignOnEndpoint{
|
||||
final static Logger _logger = LoggerFactory.getLogger(SocialSignOnEndpoint.class);
|
||||
static final Logger _logger = LoggerFactory.getLogger(SocialSignOnEndpoint.class);
|
||||
|
||||
@RequestMapping(value={"/authorize/{provider}"}, method = RequestMethod.GET)
|
||||
@ResponseBody
|
||||
public ResponseEntity<?> authorize( HttpServletRequest request,
|
||||
@PathVariable String provider
|
||||
public Message<Object> authorize( HttpServletRequest request,
|
||||
@PathVariable("provider") String provider
|
||||
) {
|
||||
_logger.trace("SocialSignOn provider : " + provider);
|
||||
String instId = WebContext.getInst().getId();
|
||||
@@ -69,12 +69,12 @@ public class SocialSignOnEndpoint extends AbstractSocialSignOnEndpoint{
|
||||
).authorize(authTokenService.genRandomJwt());
|
||||
|
||||
_logger.trace("authorize SocialSignOn : " + authorizationUrl);
|
||||
return new Message<Object>((Object)authorizationUrl).buildResponse();
|
||||
return new Message<Object>((Object)authorizationUrl);
|
||||
}
|
||||
|
||||
@RequestMapping(value={"/scanqrcode/{provider}"}, method = RequestMethod.GET)
|
||||
@ResponseBody
|
||||
public ResponseEntity<?> scanQRCode(HttpServletRequest request,
|
||||
public Message<SocialsProvider> scanQRCode(HttpServletRequest request,
|
||||
@PathVariable("provider") String provider) {
|
||||
String instId = WebContext.getInst().getId();
|
||||
String originURL =WebContext.getContextPath(request,false);
|
||||
@@ -102,12 +102,12 @@ public class SocialSignOnEndpoint extends AbstractSocialSignOnEndpoint{
|
||||
socialSignOnProviderService.setToken(state);
|
||||
}
|
||||
|
||||
return new Message<SocialsProvider>(scanQrProvider).buildResponse();
|
||||
return new Message<SocialsProvider>(scanQrProvider);
|
||||
}
|
||||
|
||||
|
||||
@RequestMapping(value={"/bind/{provider}"}, method = RequestMethod.GET)
|
||||
public ResponseEntity<?> bind(@PathVariable String provider,
|
||||
public Message<AuthJwt> bind(@PathVariable("provider") String provider,
|
||||
@CurrentUser UserInfo userInfo,
|
||||
HttpServletRequest request) {
|
||||
//auth call back may exception
|
||||
@@ -124,18 +124,18 @@ public class SocialSignOnEndpoint extends AbstractSocialSignOnEndpoint{
|
||||
_logger.debug("Social Bind : "+socialsAssociate);
|
||||
this.socialsAssociateService.delete(socialsAssociate);
|
||||
this.socialsAssociateService.insert(socialsAssociate);
|
||||
return new Message<AuthJwt>().buildResponse();
|
||||
return new Message<AuthJwt>();
|
||||
}catch(Exception e) {
|
||||
_logger.error("callback Exception ",e);
|
||||
}
|
||||
|
||||
return new Message<AuthJwt>(Message.ERROR).buildResponse();
|
||||
return new Message<AuthJwt>(Message.ERROR);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@RequestMapping(value={"/callback/{provider}"}, method = RequestMethod.GET)
|
||||
public ResponseEntity<?> callback(@PathVariable String provider,
|
||||
public Message<AuthJwt> callback(@PathVariable("provider") String provider,
|
||||
HttpServletRequest request) {
|
||||
//auth call back may exception
|
||||
try {
|
||||
@@ -152,7 +152,7 @@ public class SocialSignOnEndpoint extends AbstractSocialSignOnEndpoint{
|
||||
//如果存在第三方ID并且在数据库无法找到映射关系,则进行绑定逻辑
|
||||
if (StringUtils.isNotEmpty(socialsAssociate.getSocialUserId())) {
|
||||
//返回message为第三方用户标识
|
||||
return new Message<AuthJwt>(Message.PROMPT,socialsAssociate.getSocialUserId()).buildResponse();
|
||||
return new Message<AuthJwt>(Message.PROMPT,socialsAssociate.getSocialUserId());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -171,10 +171,10 @@ public class SocialSignOnEndpoint extends AbstractSocialSignOnEndpoint{
|
||||
//socialsAssociate.setExAttribute(JsonUtils.object2Json(accessToken.getResponseObject()));
|
||||
|
||||
this.socialsAssociateService.update(socialsAssociate);
|
||||
return new Message<AuthJwt>(authTokenService.genAuthJwt(authentication)).buildResponse();
|
||||
return new Message<AuthJwt>(authTokenService.genAuthJwt(authentication));
|
||||
}catch(Exception e) {
|
||||
_logger.error("callback Exception ",e);
|
||||
return new Message<AuthJwt>(Message.ERROR).buildResponse();
|
||||
return new Message<AuthJwt>(Message.ERROR);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -184,13 +184,13 @@ public class SocialSignOnEndpoint extends AbstractSocialSignOnEndpoint{
|
||||
* @return
|
||||
*/
|
||||
@RequestMapping(value={"/workweixin/qr/auth/login"}, method = {RequestMethod.POST})
|
||||
public ResponseEntity<?> qrAuthLogin(
|
||||
public Message<AuthJwt> qrAuthLogin(
|
||||
@RequestParam Map<String, String> param,
|
||||
HttpServletRequest request) {
|
||||
|
||||
try {
|
||||
if (null == param){
|
||||
return new Message<AuthJwt>(Message.ERROR).buildResponse();
|
||||
return new Message<AuthJwt>(Message.ERROR);
|
||||
}
|
||||
String token = param.get("token");
|
||||
String username = param.get("username");
|
||||
@@ -200,15 +200,15 @@ public class SocialSignOnEndpoint extends AbstractSocialSignOnEndpoint{
|
||||
//设置token和用户绑定
|
||||
boolean flag = this.socialSignOnProviderService.bindtoken(token,username);
|
||||
if (flag) {
|
||||
return new Message<AuthJwt>().buildResponse();
|
||||
return new Message<AuthJwt>();
|
||||
}
|
||||
} else {
|
||||
return new Message<AuthJwt>(Message.WARNING,"Invalid token").buildResponse();
|
||||
return new Message<AuthJwt>(Message.WARNING,"Invalid token");
|
||||
}
|
||||
}catch(Exception e) {
|
||||
_logger.error("qrAuthLogin Exception ",e);
|
||||
}
|
||||
return new Message<AuthJwt>(Message.ERROR).buildResponse();
|
||||
return new Message<AuthJwt>(Message.ERROR);
|
||||
}
|
||||
|
||||
|
||||
@@ -220,22 +220,22 @@ public class SocialSignOnEndpoint extends AbstractSocialSignOnEndpoint{
|
||||
* @return
|
||||
*/
|
||||
@RequestMapping(value={"/qrcallback/{provider}/{state}"}, method = RequestMethod.GET)
|
||||
public ResponseEntity<?> qrcallback(@PathVariable String provider,@PathVariable String state,
|
||||
public Message<AuthJwt> qrcallback(@PathVariable("provider") String provider,@PathVariable("state") String state,
|
||||
HttpServletRequest request) {
|
||||
try {
|
||||
//判断只有maxkey扫码
|
||||
if (!provider.equalsIgnoreCase(AuthMaxkeyRequest.KEY)) {
|
||||
return new Message<AuthJwt>(Message.ERROR).buildResponse();
|
||||
return new Message<AuthJwt>(Message.ERROR);
|
||||
}
|
||||
|
||||
String loginName = socialSignOnProviderService.getToken(state);
|
||||
if (StringUtils.isEmpty(loginName)) {
|
||||
//二维码过期
|
||||
return new Message<AuthJwt>(Message.PROMPT).buildResponse();
|
||||
return new Message<AuthJwt>(Message.PROMPT);
|
||||
}
|
||||
if("-1".equalsIgnoreCase(loginName)){
|
||||
//暂无用户扫码
|
||||
return new Message<AuthJwt>(Message.WARNING).buildResponse();
|
||||
return new Message<AuthJwt>(Message.WARNING);
|
||||
}
|
||||
String instId = WebContext.getInst().getId();
|
||||
|
||||
@@ -250,7 +250,7 @@ public class SocialSignOnEndpoint extends AbstractSocialSignOnEndpoint{
|
||||
_logger.debug("qrcallback Loaded SocialSignOn Socials Associate : "+socialsAssociate);
|
||||
|
||||
if(null == socialsAssociate) {
|
||||
return new Message<AuthJwt>(Message.ERROR).buildResponse();
|
||||
return new Message<AuthJwt>(Message.ERROR);
|
||||
}
|
||||
|
||||
_logger.debug("qrcallback Social Sign On from {} mapping to user {}", socialsAssociate.getProvider(),socialsAssociate.getUsername());
|
||||
@@ -266,10 +266,10 @@ public class SocialSignOnEndpoint extends AbstractSocialSignOnEndpoint{
|
||||
//socialsAssociate.setExAttribute(JsonUtils.object2Json(accessToken.getResponseObject()));
|
||||
|
||||
this.socialsAssociateService.update(socialsAssociate);
|
||||
return new Message<AuthJwt>(authTokenService.genAuthJwt(authentication)).buildResponse();
|
||||
return new Message<AuthJwt>(authTokenService.genAuthJwt(authentication));
|
||||
}catch(Exception e) {
|
||||
_logger.error("qrcallback Exception ",e);
|
||||
return new Message<AuthJwt>(Message.ERROR).buildResponse();
|
||||
return new Message<AuthJwt>(Message.ERROR);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -33,7 +33,7 @@ import com.nimbusds.jose.util.Base64URL;
|
||||
|
||||
public class HMAC512Service {
|
||||
|
||||
public final static String MXK_AUTH_JWK = "mxk_auth_jwk";
|
||||
public static final String MXK_AUTH_JWK = "mxk_auth_jwk";
|
||||
|
||||
JWSSigner signer;
|
||||
|
||||
|
||||
+1
-1
@@ -37,7 +37,7 @@ import com.nimbusds.jose.jwk.JWKSet;
|
||||
*
|
||||
*/
|
||||
public class RecipientJwtEncryptionAndDecryptionServiceBuilder {
|
||||
final static Logger _logger = LoggerFactory.getLogger(RecipientJwtEncryptionAndDecryptionServiceBuilder.class);
|
||||
static final Logger _logger = LoggerFactory.getLogger(RecipientJwtEncryptionAndDecryptionServiceBuilder.class);
|
||||
|
||||
//private HttpClient httpClient = HttpClientBuilder.create().useSystemProperties().build();
|
||||
//private HttpComponentsClientHttpRequestFactory httpFactory = new HttpComponentsClientHttpRequestFactory(httpClient);
|
||||
|
||||
+1
-1
@@ -46,7 +46,7 @@ import com.nimbusds.jose.jwk.RSAKey;
|
||||
import com.nimbusds.jwt.SignedJWT;
|
||||
|
||||
public class DefaultJwtSigningAndValidationService implements JwtSigningAndValidationService {
|
||||
final static Logger _logger = LoggerFactory.getLogger(DefaultJwtSigningAndValidationService.class);
|
||||
static final Logger _logger = LoggerFactory.getLogger(DefaultJwtSigningAndValidationService.class);
|
||||
|
||||
// map of identifier to signer
|
||||
private Map<String, JWSSigner> signers = new HashMap<String, JWSSigner>();
|
||||
|
||||
+1
-1
@@ -37,7 +37,7 @@ import com.nimbusds.jose.jwk.JWK;
|
||||
* Builder Symmetric Signing Service
|
||||
*/
|
||||
public class SymmetricSigningAndValidationServiceBuilder {
|
||||
final static Logger _logger = LoggerFactory.getLogger(SymmetricSigningAndValidationServiceBuilder.class);
|
||||
static final Logger _logger = LoggerFactory.getLogger(SymmetricSigningAndValidationServiceBuilder.class);
|
||||
public static final String SYMMETRIC_KEY = "SYMMETRIC-KEY";
|
||||
/**
|
||||
*
|
||||
|
||||
@@ -21,12 +21,12 @@ import org.springframework.http.ResponseEntity;
|
||||
|
||||
public class Message<T> {
|
||||
|
||||
public final static int SUCCESS = 0; //成功
|
||||
public final static int ERROR = 1; //错误
|
||||
public final static int FAIL = 2; //失败
|
||||
public final static int INFO = 101; //信息
|
||||
public final static int PROMPT = 102; //提示
|
||||
public final static int WARNING = 103; //警告
|
||||
public static final int SUCCESS = 0; //成功
|
||||
public static final int ERROR = 1; //错误
|
||||
public static final int FAIL = 2; //失败
|
||||
public static final int INFO = 101; //信息
|
||||
public static final int PROMPT = 102; //提示
|
||||
public static final int WARNING = 103; //警告
|
||||
|
||||
int code;
|
||||
|
||||
@@ -89,7 +89,7 @@ public class Message<T> {
|
||||
public void setData(T data) {
|
||||
this.data = data;
|
||||
}
|
||||
|
||||
|
||||
public ResponseEntity<?> buildResponse() {
|
||||
return ResponseEntity.ok(this);
|
||||
}
|
||||
|
||||
@@ -18,7 +18,7 @@
|
||||
package org.dromara.maxkey.pretty;
|
||||
|
||||
public interface Pretty {
|
||||
public final static String LINE_BREAK = "\n";
|
||||
public static final String LINE_BREAK = "\n";
|
||||
|
||||
public String format(String source);
|
||||
|
||||
|
||||
@@ -30,33 +30,33 @@ import org.joda.time.chrono.ISOChronology;
|
||||
|
||||
|
||||
public class DateUtils {
|
||||
public final static String FORMAT_DATE_DEFAULT = "yyyy-MM-dd";
|
||||
public static final String FORMAT_DATE_DEFAULT = "yyyy-MM-dd";
|
||||
|
||||
public final static String FORMAT_DATE_YYYYMMDD = "yyyyMMdd";
|
||||
public static final String FORMAT_DATE_YYYYMMDD = "yyyyMMdd";
|
||||
|
||||
public final static String FORMAT_DATE_YYYY_MM_DD = "yyyy-MM-dd";
|
||||
public static final String FORMAT_DATE_YYYY_MM_DD = "yyyy-MM-dd";
|
||||
|
||||
public final static String FORMAT_DATE_PATTERN_1="yyyy/MM/dd";
|
||||
public final static String FORMAT_DATE_PATTERN_2="yyyy/M/dd";
|
||||
public final static String FORMAT_DATE_PATTERN_3="yyyy/MM/d";
|
||||
public final static String FORMAT_DATE_PATTERN_4="yyyy/M/d";
|
||||
public final static String FORMAT_DATE_YYYYMMDDHHMMSS = "yyyyMMddHHmmss";
|
||||
public static final String FORMAT_DATE_PATTERN_1="yyyy/MM/dd";
|
||||
public static final String FORMAT_DATE_PATTERN_2="yyyy/M/dd";
|
||||
public static final String FORMAT_DATE_PATTERN_3="yyyy/MM/d";
|
||||
public static final String FORMAT_DATE_PATTERN_4="yyyy/M/d";
|
||||
public static final String FORMAT_DATE_YYYYMMDDHHMMSS = "yyyyMMddHHmmss";
|
||||
|
||||
public final static String FORMAT_DATE_ISO_TIMESTAMP="yyyy-MM-dd'T'HH:mm:ss.SSS'Z'";
|
||||
public static final String FORMAT_DATE_ISO_TIMESTAMP="yyyy-MM-dd'T'HH:mm:ss.SSS'Z'";
|
||||
|
||||
public final static String FORMAT_DATE_YYYY_MM_DD_HH_MM_SS = "yyyy-MM-dd HH:mm:ss";
|
||||
public static final String FORMAT_DATE_YYYY_MM_DD_HH_MM_SS = "yyyy-MM-dd HH:mm:ss";
|
||||
|
||||
public final static String FORMAT_DATE_YYYY_MM_DD_HHMM = "yyyy-MM-dd HHmm";
|
||||
public static final String FORMAT_DATE_YYYY_MM_DD_HHMM = "yyyy-MM-dd HHmm";
|
||||
|
||||
public final static String FORMAT_DATE_YYYY_MM_DD_HH_MM = "yyyy-MM-dd HH:mm";
|
||||
public static final String FORMAT_DATE_YYYY_MM_DD_HH_MM = "yyyy-MM-dd HH:mm";
|
||||
|
||||
public final static String FORMAT_DATE_HH_MM = "HH:mm";
|
||||
public static final String FORMAT_DATE_HH_MM = "HH:mm";
|
||||
|
||||
public final static String FORMAT_DATE_HH_MM_SS = "HH:mm:ss";
|
||||
public static final String FORMAT_DATE_HH_MM_SS = "HH:mm:ss";
|
||||
|
||||
public final static String FORMAT_DATE_HHMM = "HHmm";
|
||||
public static final String FORMAT_DATE_HHMM = "HHmm";
|
||||
|
||||
public final static String FORMAT_DATE_HHMMSS = "HHmmss";
|
||||
public static final String FORMAT_DATE_HHMMSS = "HHmmss";
|
||||
|
||||
public static final String FORMAT_WORK_TIME = "yyyy-MM-dd HHmmss";
|
||||
/**
|
||||
@@ -74,7 +74,7 @@ public class DateUtils {
|
||||
* stringValue2.
|
||||
* @since 1.2
|
||||
*/
|
||||
public final static int compareDate(String stringValue1, String stringValue2)
|
||||
public static final int compareDate(String stringValue1, String stringValue2)
|
||||
throws ParseException {
|
||||
Date date1 = tryParse(stringValue1);
|
||||
if (date1 == null) {
|
||||
@@ -95,11 +95,11 @@ public class DateUtils {
|
||||
*
|
||||
* @see #FORMAT_DATE_DEFAULT
|
||||
*/
|
||||
public final static String getCurrentDateAsString() {
|
||||
public static final String getCurrentDateAsString() {
|
||||
return getCurrentDateAsString(FORMAT_DATE_DEFAULT);
|
||||
}
|
||||
|
||||
public final static String getCurrentDateTimeAsString() {
|
||||
public static final String getCurrentDateTimeAsString() {
|
||||
return getCurrentDateAsString(FORMAT_DATE_YYYY_MM_DD_HH_MM_SS);
|
||||
}
|
||||
|
||||
@@ -112,12 +112,12 @@ public class DateUtils {
|
||||
* @return current system date.
|
||||
*
|
||||
*/
|
||||
public final static String getCurrentDateAsString(String formatPattern) {
|
||||
public static final String getCurrentDateAsString(String formatPattern) {
|
||||
Date date = new Date();
|
||||
return format(date, formatPattern);
|
||||
}
|
||||
|
||||
public final static String getFormtPattern1ToPattern2(String stringValue,String formatPattern1,String formatPattern2){
|
||||
public static final String getFormtPattern1ToPattern2(String stringValue,String formatPattern1,String formatPattern2){
|
||||
Date date = parse(stringValue, formatPattern1);
|
||||
return format(date, formatPattern2);
|
||||
}
|
||||
@@ -127,7 +127,7 @@ public class DateUtils {
|
||||
*
|
||||
* @return current system date.
|
||||
*/
|
||||
public final static Date getCurrentDate() {
|
||||
public static final Date getCurrentDate() {
|
||||
return new Date();
|
||||
}
|
||||
|
||||
@@ -135,7 +135,7 @@ public class DateUtils {
|
||||
* 0������, 1����һ, 2���ڶ�, 3������, 4������, 5������,6������
|
||||
* @return
|
||||
*/
|
||||
public final static String getTodayOfWeek(){
|
||||
public static final String getTodayOfWeek(){
|
||||
Calendar calendar = Calendar.getInstance();
|
||||
Date date = new Date();
|
||||
calendar.setTime(date);
|
||||
@@ -149,7 +149,7 @@ public class DateUtils {
|
||||
* @param endTime
|
||||
* @return
|
||||
*/
|
||||
public final static boolean compareTime(String startTime,String endTime) throws ParseException{
|
||||
public static final boolean compareTime(String startTime,String endTime) throws ParseException{
|
||||
SimpleDateFormat sdf = new SimpleDateFormat("hh:mm:ss");
|
||||
Date start = sdf.parse(startTime);
|
||||
Date end = sdf.parse(endTime);
|
||||
@@ -180,7 +180,7 @@ public class DateUtils {
|
||||
*
|
||||
* @see #FORMAT_DATE_DEFAULT
|
||||
*/
|
||||
public final static String format(Date date) {
|
||||
public static final String format(Date date) {
|
||||
if (date == null) {
|
||||
return "";
|
||||
}
|
||||
@@ -196,7 +196,7 @@ public class DateUtils {
|
||||
*
|
||||
* @see #FORMAT_DATE_DEFAULT
|
||||
*/
|
||||
public final static String formatDateTime(Date date) {
|
||||
public static final String formatDateTime(Date date) {
|
||||
if (date == null) {
|
||||
return "";
|
||||
}
|
||||
@@ -212,7 +212,7 @@ public class DateUtils {
|
||||
*
|
||||
* @see #FORMAT_DATE_DEFAULT
|
||||
*/
|
||||
public final static String formatTimestamp(Date date) {
|
||||
public static final String formatTimestamp(Date date) {
|
||||
if (date == null) {
|
||||
return "";
|
||||
}
|
||||
@@ -228,7 +228,7 @@ public class DateUtils {
|
||||
*
|
||||
* @see #FORMAT_DATE_DEFAULT
|
||||
*/
|
||||
public final static Date parseTimestamp(String date) {
|
||||
public static final Date parseTimestamp(String date) {
|
||||
if (date == null) {
|
||||
return null;
|
||||
}
|
||||
@@ -250,7 +250,7 @@ public class DateUtils {
|
||||
* @see #FORMAT_DATE_YYYY_MM_DD_HH_MM_SS
|
||||
* @see #FORMAT_DATE_YYYY_MM_DD_HHMMSS
|
||||
*/
|
||||
public final static String format(Date date, String formatPattern) {
|
||||
public static final String format(Date date, String formatPattern) {
|
||||
if (date == null) {
|
||||
return "";
|
||||
}
|
||||
@@ -265,7 +265,7 @@ public class DateUtils {
|
||||
* @return Date represents stringValue.
|
||||
* @see #FORMAT_DATE_DEFAULT
|
||||
*/
|
||||
public final static Date parse(String stringValue) {
|
||||
public static final Date parse(String stringValue) {
|
||||
return parse(stringValue, FORMAT_DATE_DEFAULT);
|
||||
}
|
||||
|
||||
@@ -279,7 +279,7 @@ public class DateUtils {
|
||||
* @return Date represents stringValue, null while parse exception occurred.
|
||||
* @see #FORMAT_DATE_DEFAULT
|
||||
*/
|
||||
public final static Date parse(String stringValue, String formatPattern) {
|
||||
public static final Date parse(String stringValue, String formatPattern) {
|
||||
SimpleDateFormat format = new SimpleDateFormat(formatPattern);
|
||||
try {
|
||||
return format.parse(stringValue);
|
||||
@@ -297,7 +297,7 @@ public class DateUtils {
|
||||
* string value.
|
||||
* @return Date represents stringValue, null while parse exception occurred.
|
||||
*/
|
||||
public final static Date tryParse(String stringValue) {
|
||||
public static final Date tryParse(String stringValue) {
|
||||
Date date = parse(stringValue, FORMAT_DATE_YYYY_MM_DD);
|
||||
if (date != null) {
|
||||
return date;
|
||||
|
||||
@@ -35,7 +35,7 @@ public class EthernetAddress
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
private final static char[] HEX_CHARS = "0123456789abcdefABCDEF".toCharArray();
|
||||
private static final char[] HEX_CHARS = "0123456789abcdefABCDEF".toCharArray();
|
||||
|
||||
/**
|
||||
* We may need a random number generator, for creating dummy ethernet
|
||||
|
||||
@@ -31,28 +31,28 @@ public class SnowFlakeId {
|
||||
/**
|
||||
* 起始的时间戳
|
||||
*/
|
||||
private final static long START_STMP = 1480166465631L;
|
||||
private static final long START_STMP = 1480166465631L;
|
||||
|
||||
/**
|
||||
* 每一部分占用的位数
|
||||
*/
|
||||
private final static long SEQUENCE_BIT = 12; //序列号占用的位数
|
||||
private final static long MACHINE_BIT = 5; //机器标识占用的位数
|
||||
private final static long DATACENTER_BIT = 5;//数据中心占用的位数
|
||||
private static final long SEQUENCE_BIT = 12; //序列号占用的位数
|
||||
private static final long MACHINE_BIT = 5; //机器标识占用的位数
|
||||
private static final long DATACENTER_BIT = 5;//数据中心占用的位数
|
||||
|
||||
/**
|
||||
* 每一部分的最大值
|
||||
*/
|
||||
private final static long MAX_DATACENTER_NUM = -1L ^ (-1L << DATACENTER_BIT);
|
||||
private final static long MAX_MACHINE_NUM = -1L ^ (-1L << MACHINE_BIT);
|
||||
private final static long MAX_SEQUENCE = -1L ^ (-1L << SEQUENCE_BIT);
|
||||
private static final long MAX_DATACENTER_NUM = -1L ^ (-1L << DATACENTER_BIT);
|
||||
private static final long MAX_MACHINE_NUM = -1L ^ (-1L << MACHINE_BIT);
|
||||
private static final long MAX_SEQUENCE = -1L ^ (-1L << SEQUENCE_BIT);
|
||||
|
||||
/**
|
||||
* 每一部分向左的位移
|
||||
*/
|
||||
private final static long MACHINE_LEFT = SEQUENCE_BIT;
|
||||
private final static long DATACENTER_LEFT = SEQUENCE_BIT + MACHINE_BIT;
|
||||
private final static long TIMESTMP_LEFT = DATACENTER_LEFT + DATACENTER_BIT;
|
||||
private static final long MACHINE_LEFT = SEQUENCE_BIT;
|
||||
private static final long DATACENTER_LEFT = SEQUENCE_BIT + MACHINE_BIT;
|
||||
private static final long TIMESTMP_LEFT = DATACENTER_LEFT + DATACENTER_BIT;
|
||||
|
||||
private long datacenterId; //数据中心
|
||||
private long machineId; //机器标识
|
||||
|
||||
@@ -32,7 +32,7 @@ public class WebConstants {
|
||||
|
||||
public static final String CURRENT_INST = "current_inst";
|
||||
|
||||
public final static String INST_COOKIE_NAME = "mxk_inst";
|
||||
public static final String INST_COOKIE_NAME = "mxk_inst";
|
||||
|
||||
// SPRING_SECURITY_SAVED_REQUEST
|
||||
public static final String FIRST_SAVED_REQUEST_PARAMETER
|
||||
|
||||
+1
-1
@@ -35,7 +35,7 @@ public class AccountsStrategyService extends JpaService<AccountsStrategy> imple
|
||||
*/
|
||||
private static final long serialVersionUID = -921086134545225302L;
|
||||
|
||||
final static Logger _logger = LoggerFactory.getLogger(AccountsStrategyService.class);
|
||||
static final Logger _logger = LoggerFactory.getLogger(AccountsStrategyService.class);
|
||||
/*
|
||||
@JsonIgnore
|
||||
@Autowired
|
||||
|
||||
+1
-1
@@ -30,7 +30,7 @@ import com.github.benmanes.caffeine.cache.Caffeine;
|
||||
@Repository
|
||||
public class AppsCasDetailsService extends JpaService<AppsCasDetails>{
|
||||
|
||||
protected final static Cache<String, AppsCasDetails> detailsCache =
|
||||
protected static final Cache<String, AppsCasDetails> detailsCache =
|
||||
Caffeine.newBuilder()
|
||||
.expireAfterWrite(30, TimeUnit.MINUTES)
|
||||
.maximumSize(200000)
|
||||
|
||||
+1
-1
@@ -30,7 +30,7 @@ import com.github.benmanes.caffeine.cache.Caffeine;
|
||||
@Repository
|
||||
public class AppsFormBasedDetailsService extends JpaService<AppsFormBasedDetails>{
|
||||
|
||||
protected final static Cache<String, AppsFormBasedDetails> detailsCache =
|
||||
protected static final Cache<String, AppsFormBasedDetails> detailsCache =
|
||||
Caffeine.newBuilder()
|
||||
.expireAfterWrite(30, TimeUnit.MINUTES)
|
||||
.maximumSize(200000)
|
||||
|
||||
+1
-1
@@ -30,7 +30,7 @@ import com.github.benmanes.caffeine.cache.Caffeine;
|
||||
@Repository
|
||||
public class AppsJwtDetailsService extends JpaService<AppsJwtDetails>{
|
||||
|
||||
protected final static Cache<String, AppsJwtDetails> detailsCache =
|
||||
protected static final Cache<String, AppsJwtDetails> detailsCache =
|
||||
Caffeine.newBuilder()
|
||||
.expireAfterWrite(30, TimeUnit.MINUTES)
|
||||
.maximumSize(200000)
|
||||
|
||||
+1
-1
@@ -30,7 +30,7 @@ import com.github.benmanes.caffeine.cache.Caffeine;
|
||||
@Repository
|
||||
public class AppsSaml20DetailsService extends JpaService<AppsSAML20Details>{
|
||||
|
||||
protected final static Cache<String, AppsSAML20Details> detailsCache =
|
||||
protected static final Cache<String, AppsSAML20Details> detailsCache =
|
||||
Caffeine.newBuilder()
|
||||
.expireAfterWrite(30, TimeUnit.MINUTES)
|
||||
.maximumSize(200000)
|
||||
|
||||
+3
-3
@@ -32,11 +32,11 @@ import com.github.benmanes.caffeine.cache.Caffeine;
|
||||
@Repository
|
||||
public class AppsService extends JpaService<Apps>{
|
||||
//maxkey-mgt
|
||||
public final static String MGT_APP_ID = "622076759805923328";
|
||||
public static final String MGT_APP_ID = "622076759805923328";
|
||||
|
||||
public final static String DETAIL_SUFFIX = "_detail";
|
||||
public static final String DETAIL_SUFFIX = "_detail";
|
||||
|
||||
protected final static Cache<String, Apps> detailsCacheStore =
|
||||
protected static final Cache<String, Apps> detailsCacheStore =
|
||||
Caffeine.newBuilder()
|
||||
.expireAfterWrite(30, TimeUnit.MINUTES)
|
||||
.build();
|
||||
|
||||
+1
-1
@@ -30,7 +30,7 @@ import com.github.benmanes.caffeine.cache.Caffeine;
|
||||
@Repository
|
||||
public class AppsTokenBasedDetailsService extends JpaService<AppsTokenBasedDetails>{
|
||||
|
||||
protected final static Cache<String, AppsTokenBasedDetails> detailsCache =
|
||||
protected static final Cache<String, AppsTokenBasedDetails> detailsCache =
|
||||
Caffeine.newBuilder()
|
||||
.expireAfterWrite(30, TimeUnit.MINUTES)
|
||||
.maximumSize(200000)
|
||||
|
||||
+1
-1
@@ -26,7 +26,7 @@ import org.springframework.stereotype.Repository;
|
||||
|
||||
@Repository
|
||||
public class ConnectorsService extends JpaService<Connectors>{
|
||||
final static Logger _logger = LoggerFactory.getLogger(ConnectorsService.class);
|
||||
static final Logger _logger = LoggerFactory.getLogger(ConnectorsService.class);
|
||||
|
||||
public ConnectorsService() {
|
||||
super(ConnectorsMapper.class);
|
||||
|
||||
+1
-1
@@ -31,7 +31,7 @@ import org.springframework.stereotype.Repository;
|
||||
|
||||
@Repository
|
||||
public class GroupMemberService extends JpaService<GroupMember>{
|
||||
final static Logger _logger = LoggerFactory.getLogger(GroupMemberService.class);
|
||||
static final Logger _logger = LoggerFactory.getLogger(GroupMemberService.class);
|
||||
|
||||
public GroupMemberService() {
|
||||
super(GroupMemberMapper.class);
|
||||
|
||||
+1
-1
@@ -45,7 +45,7 @@ public class GroupsService extends JpaService<Groups> implements Serializable {
|
||||
*/
|
||||
private static final long serialVersionUID = -4156671926199393550L;
|
||||
|
||||
final static Logger _logger = LoggerFactory.getLogger(GroupsService.class);
|
||||
static final Logger _logger = LoggerFactory.getLogger(GroupsService.class);
|
||||
@JsonIgnore
|
||||
@Autowired
|
||||
GroupMemberService groupMemberService;
|
||||
|
||||
+1
-1
@@ -28,7 +28,7 @@ import org.springframework.stereotype.Repository;
|
||||
@Repository
|
||||
public class OrganizationsCastService extends JpaService<OrganizationsCast>{
|
||||
|
||||
final static Logger _logger = LoggerFactory.getLogger(OrganizationsCastService.class);
|
||||
static final Logger _logger = LoggerFactory.getLogger(OrganizationsCastService.class);
|
||||
|
||||
|
||||
public OrganizationsCastService() {
|
||||
|
||||
+1
-1
@@ -15,7 +15,7 @@ import org.springframework.stereotype.Repository;
|
||||
|
||||
@Repository
|
||||
public class RoleMemberService extends JpaService<RoleMember>{
|
||||
final static Logger _logger = LoggerFactory.getLogger(RoleMemberService.class);
|
||||
static final Logger _logger = LoggerFactory.getLogger(RoleMemberService.class);
|
||||
|
||||
public RoleMemberService() {
|
||||
super(RoleMemberMapper.class);
|
||||
|
||||
+1
-1
@@ -26,7 +26,7 @@ import org.springframework.stereotype.Repository;
|
||||
|
||||
@Repository
|
||||
public class SocialsProviderService extends JpaService<SocialsProvider>{
|
||||
final static Logger _logger = LoggerFactory.getLogger(SocialsProviderService.class);
|
||||
static final Logger _logger = LoggerFactory.getLogger(SocialsProviderService.class);
|
||||
|
||||
|
||||
public SocialsProviderService() {
|
||||
|
||||
+1
-1
@@ -26,7 +26,7 @@ import org.springframework.stereotype.Repository;
|
||||
|
||||
@Repository
|
||||
public class SynchronizersService extends JpaService<Synchronizers>{
|
||||
final static Logger _logger = LoggerFactory.getLogger(SynchronizersService.class);
|
||||
static final Logger _logger = LoggerFactory.getLogger(SynchronizersService.class);
|
||||
|
||||
public SynchronizersService() {
|
||||
super(SynchronizersMapper.class);
|
||||
|
||||
+1
-1
@@ -47,7 +47,7 @@ import org.springframework.stereotype.Repository;
|
||||
*/
|
||||
@Repository
|
||||
public class UserInfoService extends JpaService<UserInfo> {
|
||||
final static Logger _logger = LoggerFactory.getLogger(UserInfoService.class);
|
||||
static final Logger _logger = LoggerFactory.getLogger(UserInfoService.class);
|
||||
|
||||
@Autowired
|
||||
private PasswordEncoder passwordEncoder;
|
||||
|
||||
+1
-1
@@ -42,7 +42,7 @@ import org.springframework.web.servlet.ModelAndView;
|
||||
*
|
||||
*/
|
||||
public class AuthorizeBaseEndpoint {
|
||||
final static Logger _logger = LoggerFactory.getLogger(AuthorizeBaseEndpoint.class);
|
||||
static final Logger _logger = LoggerFactory.getLogger(AuthorizeBaseEndpoint.class);
|
||||
|
||||
@Autowired
|
||||
protected ApplicationConfig applicationConfig;
|
||||
|
||||
+8
-8
@@ -31,6 +31,7 @@ import org.dromara.maxkey.entity.idm.UserInfo;
|
||||
import org.springframework.http.ResponseEntity;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.web.bind.annotation.ResponseBody;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
@@ -39,13 +40,12 @@ import org.springframework.web.bind.annotation.RequestMapping;
|
||||
* @author Crystal.Sea
|
||||
*
|
||||
*/
|
||||
@Controller
|
||||
@RestController
|
||||
@RequestMapping(value = { "/authz/credential" })
|
||||
public class AuthorizeCredentialEndpoint extends AuthorizeBaseEndpoint{
|
||||
|
||||
@RequestMapping("/get/{appId}")
|
||||
@ResponseBody
|
||||
public ResponseEntity<?> get(
|
||||
public Message<Accounts> get(
|
||||
@PathVariable("appId") String appId,
|
||||
@CurrentUser UserInfo currentUser){
|
||||
Apps app = getApp(appId);
|
||||
@@ -64,11 +64,11 @@ public class AuthorizeCredentialEndpoint extends AuthorizeBaseEndpoint{
|
||||
account.setCreateType("manual");
|
||||
account.setStatus(ConstsStatus.ACTIVE);
|
||||
}
|
||||
return new Message<Accounts>(account).buildResponse();
|
||||
return new Message<Accounts>(account);
|
||||
}
|
||||
|
||||
@RequestMapping("/update")
|
||||
public ResponseEntity<?> update(
|
||||
public Message<Accounts> update(
|
||||
@RequestBody Accounts account,
|
||||
@CurrentUser UserInfo currentUser){
|
||||
if(StringUtils.isNotEmpty(account.getRelatedPassword())
|
||||
@@ -78,16 +78,16 @@ public class AuthorizeCredentialEndpoint extends AuthorizeBaseEndpoint{
|
||||
PasswordReciprocal.getInstance().encode(account.getRelatedPassword()));
|
||||
if(accountsService.get(account.getId()) == null) {
|
||||
if(accountsService.insert(account)){
|
||||
return new Message<Accounts>().buildResponse();
|
||||
return new Message<Accounts>();
|
||||
}
|
||||
}else {
|
||||
if(accountsService.update(account)){
|
||||
return new Message<Accounts>().buildResponse();
|
||||
return new Message<Accounts>();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return new Message<Accounts>(Message.FAIL).buildResponse();
|
||||
return new Message<Accounts>(Message.FAIL);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
+1
-1
@@ -45,7 +45,7 @@ import jakarta.servlet.http.HttpServletRequest;
|
||||
@Tag(name = "1-2认证总地址文档模块")
|
||||
@Controller
|
||||
public class AuthorizeEndpoint extends AuthorizeBaseEndpoint{
|
||||
final static Logger _logger = LoggerFactory.getLogger(AuthorizeEndpoint.class);
|
||||
static final Logger _logger = LoggerFactory.getLogger(AuthorizeEndpoint.class);
|
||||
|
||||
@Autowired
|
||||
AppsCasDetailsService casDetailsService;
|
||||
|
||||
+1
-1
@@ -36,7 +36,7 @@ import org.slf4j.LoggerFactory;
|
||||
import org.springframework.web.servlet.ModelAndView;
|
||||
|
||||
public abstract class AbstractAuthorizeAdapter {
|
||||
final static Logger _logger = LoggerFactory.getLogger(AbstractAuthorizeAdapter.class);
|
||||
static final Logger _logger = LoggerFactory.getLogger(AbstractAuthorizeAdapter.class);
|
||||
|
||||
protected Apps app;
|
||||
|
||||
|
||||
+1
-1
@@ -45,7 +45,7 @@ import jakarta.servlet.http.HttpServletResponse;
|
||||
@Controller
|
||||
public class Cas10AuthorizeEndpoint extends CasBaseAuthorizeEndpoint{
|
||||
|
||||
final static Logger _logger = LoggerFactory.getLogger(Cas10AuthorizeEndpoint.class);
|
||||
static final Logger _logger = LoggerFactory.getLogger(Cas10AuthorizeEndpoint.class);
|
||||
|
||||
/**
|
||||
* @param request
|
||||
|
||||
+1
-1
@@ -57,7 +57,7 @@ import jakarta.servlet.http.HttpServletResponse;
|
||||
@Controller
|
||||
public class Cas20AuthorizeEndpoint extends CasBaseAuthorizeEndpoint{
|
||||
|
||||
final static Logger _logger = LoggerFactory.getLogger(Cas20AuthorizeEndpoint.class);
|
||||
static final Logger _logger = LoggerFactory.getLogger(Cas20AuthorizeEndpoint.class);
|
||||
|
||||
/**
|
||||
* @param request
|
||||
|
||||
+1
-1
@@ -55,7 +55,7 @@ import jakarta.servlet.http.HttpServletResponse;
|
||||
@Controller
|
||||
public class Cas30AuthorizeEndpoint extends CasBaseAuthorizeEndpoint{
|
||||
|
||||
final static Logger _logger = LoggerFactory.getLogger(Cas30AuthorizeEndpoint.class);
|
||||
static final Logger _logger = LoggerFactory.getLogger(Cas30AuthorizeEndpoint.class);
|
||||
|
||||
@Operation(summary = "CAS 3.0 ticket验证接口", description = "通过ticket获取当前登录用户信息")
|
||||
@RequestMapping(value=CasConstants.ENDPOINT.ENDPOINT_SERVICE_VALIDATE_V3,method={RequestMethod.GET,RequestMethod.POST})
|
||||
|
||||
+1
-1
@@ -54,7 +54,7 @@ import jakarta.servlet.http.HttpServletResponse;
|
||||
@Controller
|
||||
public class CasAuthorizeEndpoint extends CasBaseAuthorizeEndpoint{
|
||||
|
||||
final static Logger _logger = LoggerFactory.getLogger(CasAuthorizeEndpoint.class);
|
||||
static final Logger _logger = LoggerFactory.getLogger(CasAuthorizeEndpoint.class);
|
||||
|
||||
@Operation(summary = "CAS页面跳转service认证接口", description = "传递参数service",method="GET")
|
||||
@GetMapping(CasConstants.ENDPOINT.ENDPOINT_LOGIN)
|
||||
|
||||
+1
-1
@@ -30,7 +30,7 @@ import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.beans.factory.annotation.Qualifier;
|
||||
|
||||
public class CasBaseAuthorizeEndpoint extends AuthorizeBaseEndpoint{
|
||||
final static Logger _logger = LoggerFactory.getLogger(CasBaseAuthorizeEndpoint.class);
|
||||
static final Logger _logger = LoggerFactory.getLogger(CasBaseAuthorizeEndpoint.class);
|
||||
|
||||
@Autowired
|
||||
protected AppsCasDetailsService casDetailsService;
|
||||
|
||||
+1
-1
@@ -44,7 +44,7 @@ import jakarta.servlet.http.HttpServletResponse;
|
||||
@Controller
|
||||
public class CasLogoutEndpoint extends CasBaseAuthorizeEndpoint{
|
||||
|
||||
final static Logger _logger = LoggerFactory.getLogger(CasLogoutEndpoint.class);
|
||||
static final Logger _logger = LoggerFactory.getLogger(CasLogoutEndpoint.class);
|
||||
|
||||
/**
|
||||
* for cas logout then redirect to logout
|
||||
|
||||
+1
-1
@@ -29,7 +29,7 @@ import org.slf4j.LoggerFactory;
|
||||
import org.springframework.web.servlet.ModelAndView;
|
||||
|
||||
public class CasDefaultAdapter extends AbstractAuthorizeAdapter {
|
||||
final static Logger _logger = LoggerFactory.getLogger(CasDefaultAdapter.class);
|
||||
static final Logger _logger = LoggerFactory.getLogger(CasDefaultAdapter.class);
|
||||
|
||||
static String Charset_UTF8="UTF-8";
|
||||
|
||||
|
||||
+1
-1
@@ -26,7 +26,7 @@ import org.slf4j.LoggerFactory;
|
||||
import org.springframework.web.servlet.ModelAndView;
|
||||
|
||||
public class CasPlainAdapter extends AbstractAuthorizeAdapter {
|
||||
final static Logger _logger = LoggerFactory.getLogger(CasPlainAdapter.class);
|
||||
static final Logger _logger = LoggerFactory.getLogger(CasPlainAdapter.class);
|
||||
|
||||
ServiceResponseBuilder serviceResponseBuilder;
|
||||
|
||||
|
||||
+1
-1
@@ -25,7 +25,7 @@ import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
public class CasServiceResponse {
|
||||
final static Logger _logger = LoggerFactory.getLogger(CasServiceResponse.class);
|
||||
static final Logger _logger = LoggerFactory.getLogger(CasServiceResponse.class);
|
||||
|
||||
protected String code;
|
||||
protected String description;
|
||||
|
||||
+1
-1
@@ -25,7 +25,7 @@ import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
public class ServiceResponseBuilder extends CasServiceResponse {
|
||||
final static Logger _logger = LoggerFactory.getLogger(ServiceResponseBuilder.class);
|
||||
static final Logger _logger = LoggerFactory.getLogger(ServiceResponseBuilder.class);
|
||||
|
||||
|
||||
public ServiceResponseBuilder(){
|
||||
|
||||
+3
-3
@@ -21,12 +21,12 @@ package org.dromara.maxkey.authz.cas.endpoint.ticket;
|
||||
public class CasConstants {
|
||||
/* CAS Protocol Parameters. **/
|
||||
public static final class PARAMETER{
|
||||
public final static String ENDPOINT_CAS_DETAILS = "CAS_AUTHORIZE_ENDPOINT_CAS_DETAILS";
|
||||
public static final String ENDPOINT_CAS_DETAILS = "CAS_AUTHORIZE_ENDPOINT_CAS_DETAILS";
|
||||
|
||||
public final static String PARAMETER_MAP = "CAS_AUTHORIZE_ENDPOINT_PARAMETER_MAP";
|
||||
public static final String PARAMETER_MAP = "CAS_AUTHORIZE_ENDPOINT_PARAMETER_MAP";
|
||||
|
||||
/** Constant representing the ticket parameter in the request. */
|
||||
public final static String TICKET = "ticket";
|
||||
public static final String TICKET = "ticket";
|
||||
|
||||
/** Constant representing the service parameter in the request. */
|
||||
public static final String SERVICE = "service";
|
||||
|
||||
+1
-1
@@ -28,7 +28,7 @@ import com.github.benmanes.caffeine.cache.Caffeine;
|
||||
|
||||
public class InMemoryProxyGrantingTicketServices extends RandomServiceTicketServices {
|
||||
|
||||
protected final static Cache<String, Ticket> casTicketStore =
|
||||
protected static final Cache<String, Ticket> casTicketStore =
|
||||
Caffeine.newBuilder()
|
||||
.expireAfterWrite(60, TimeUnit.MINUTES)
|
||||
.build();
|
||||
|
||||
+1
-1
@@ -28,7 +28,7 @@ import com.github.benmanes.caffeine.cache.Caffeine;
|
||||
|
||||
public class InMemoryTicketServices extends RandomServiceTicketServices {
|
||||
|
||||
protected final static Cache<String, Ticket> casTicketStore =
|
||||
protected static final Cache<String, Ticket> casTicketStore =
|
||||
Caffeine.newBuilder()
|
||||
.expireAfterWrite(60, TimeUnit.MINUTES)
|
||||
.build();
|
||||
|
||||
+1
-1
@@ -28,7 +28,7 @@ import com.github.benmanes.caffeine.cache.Caffeine;
|
||||
|
||||
public class InMemoryTicketGrantingTicketServices extends RandomServiceTicketServices {
|
||||
|
||||
protected final static Cache<String, Ticket> casTicketGrantingTicketStore =
|
||||
protected static final Cache<String, Ticket> casTicketGrantingTicketStore =
|
||||
Caffeine.newBuilder()
|
||||
.expireAfterWrite(2, TimeUnit.DAYS)
|
||||
.build();
|
||||
|
||||
+1
-1
@@ -35,7 +35,7 @@ import jakarta.servlet.http.HttpServletResponse;
|
||||
@Tag(name = "2-8-ExtendApi接口文档模块-元数据")
|
||||
@Controller
|
||||
public class ExtendApiMetadata {
|
||||
final static Logger _logger = LoggerFactory.getLogger(ExtendApiMetadata.class);
|
||||
static final Logger _logger = LoggerFactory.getLogger(ExtendApiMetadata.class);
|
||||
|
||||
@Operation(summary = "netease qiye mail RSA Key", description = "网易企业邮箱RSA Key生成器",method="GET")
|
||||
@RequestMapping(
|
||||
|
||||
+1
-1
@@ -38,7 +38,7 @@ import org.springframework.web.servlet.ModelAndView;
|
||||
*
|
||||
*/
|
||||
public class ExtendApiCndnsApiMailAdapter extends AbstractAuthorizeAdapter {
|
||||
final static Logger _logger = LoggerFactory.getLogger(ExtendApiCndnsApiMailAdapter.class);
|
||||
static final Logger _logger = LoggerFactory.getLogger(ExtendApiCndnsApiMailAdapter.class);
|
||||
//sign no parameter
|
||||
//sign=md5(action=getDomainInfo&appid=***&time=1579736456 + md5(token))
|
||||
//sign with parameter
|
||||
|
||||
+1
-1
@@ -35,7 +35,7 @@ import org.springframework.web.servlet.ModelAndView;
|
||||
*
|
||||
*/
|
||||
public class ExtendApiNeteaseQiyeMailAdapter extends AbstractAuthorizeAdapter {
|
||||
final static Logger _logger = LoggerFactory.getLogger(ExtendApiNeteaseQiyeMailAdapter.class);
|
||||
static final Logger _logger = LoggerFactory.getLogger(ExtendApiNeteaseQiyeMailAdapter.class);
|
||||
//https://entryhz.qiye.163.com
|
||||
static String REDIRECT_PARAMETER = "domain=%s&account_name=%s&time=%s&enc=%s&lang=%s";
|
||||
|
||||
|
||||
+2
-2
@@ -41,13 +41,13 @@ import com.github.benmanes.caffeine.cache.Caffeine;
|
||||
*
|
||||
*/
|
||||
public class ExtendApiQQExmailAdapter extends AbstractAuthorizeAdapter {
|
||||
final static Logger _logger = LoggerFactory.getLogger(ExtendApiQQExmailAdapter.class);
|
||||
static final Logger _logger = LoggerFactory.getLogger(ExtendApiQQExmailAdapter.class);
|
||||
//https://exmail.qq.com/qy_mng_logic/doc#10003
|
||||
static String TOKEN_URI = "https://api.exmail.qq.com/cgi-bin/gettoken?corpid=%s&corpsecret=%s";
|
||||
//https://exmail.qq.com/qy_mng_logic/doc#10036
|
||||
static String AUTHKEY_URI = "https://api.exmail.qq.com/cgi-bin/service/get_login_url?access_token=%s&userid=%s";
|
||||
|
||||
final static Cache<String, String> tokenCache = Caffeine.newBuilder()
|
||||
static final Cache<String, String> tokenCache = Caffeine.newBuilder()
|
||||
.expireAfterWrite(7200, TimeUnit.SECONDS)
|
||||
.build();
|
||||
|
||||
|
||||
+1
-1
@@ -41,7 +41,7 @@ import org.springframework.web.servlet.ModelAndView;
|
||||
*
|
||||
*/
|
||||
public class ExtendApiTimestampSignAdapter extends AbstractAuthorizeAdapter {
|
||||
final static Logger _logger = LoggerFactory.getLogger(ExtendApiTimestampSignAdapter.class);
|
||||
static final Logger _logger = LoggerFactory.getLogger(ExtendApiTimestampSignAdapter.class);
|
||||
|
||||
Accounts account;
|
||||
|
||||
|
||||
+1
-1
@@ -40,7 +40,7 @@ import org.springframework.web.servlet.ModelAndView;
|
||||
*
|
||||
*/
|
||||
public class ExtendApiZentaoAdapter extends AbstractAuthorizeAdapter {
|
||||
final static Logger _logger = LoggerFactory.getLogger(ExtendApiZentaoAdapter.class);
|
||||
static final Logger _logger = LoggerFactory.getLogger(ExtendApiZentaoAdapter.class);
|
||||
static String login_url_template="api.php?m=user&f=apilogin&account=%s&code=%s&time=%s&token=%s";
|
||||
static String login_url_m_template="account=%s&code=%s&time=%s&token=%s";
|
||||
|
||||
|
||||
+1
-1
@@ -39,7 +39,7 @@ import org.slf4j.LoggerFactory;
|
||||
|
||||
public class NeteaseRSATool {
|
||||
|
||||
final static Logger _logger = LoggerFactory.getLogger(NeteaseRSATool.class);
|
||||
static final Logger _logger = LoggerFactory.getLogger(NeteaseRSATool.class);
|
||||
|
||||
private static final char[] bcdLookup = { '0', '1', '2', '3', '4', '5',
|
||||
'6', '7', '8', '9', 'a', 'b', 'c', 'd', 'e', 'f' };
|
||||
|
||||
+1
-1
@@ -51,7 +51,7 @@ import jakarta.servlet.http.HttpServletRequest;
|
||||
@Tag(name = "2-7-FormBased接口文档模块")
|
||||
@Controller
|
||||
public class FormBasedAuthorizeEndpoint extends AuthorizeBaseEndpoint{
|
||||
final static Logger _logger = LoggerFactory.getLogger(FormBasedAuthorizeEndpoint.class);
|
||||
static final Logger _logger = LoggerFactory.getLogger(FormBasedAuthorizeEndpoint.class);
|
||||
|
||||
@Autowired
|
||||
AppsFormBasedDetailsService formBasedDetailsService;
|
||||
|
||||
+1
-1
@@ -44,7 +44,7 @@ import com.nimbusds.jwt.PlainJWT;
|
||||
import com.nimbusds.jwt.SignedJWT;
|
||||
|
||||
public class JwtAdapter extends AbstractAuthorizeAdapter {
|
||||
final static Logger _logger = LoggerFactory.getLogger(JwtAdapter.class);
|
||||
static final Logger _logger = LoggerFactory.getLogger(JwtAdapter.class);
|
||||
|
||||
AppsJwtDetails jwtDetails;
|
||||
|
||||
|
||||
+1
-1
@@ -62,7 +62,7 @@ import jakarta.servlet.http.HttpServletResponse;
|
||||
@Controller
|
||||
public class JwtAuthorizeEndpoint extends AuthorizeBaseEndpoint{
|
||||
|
||||
final static Logger _logger = LoggerFactory.getLogger(JwtAuthorizeEndpoint.class);
|
||||
static final Logger _logger = LoggerFactory.getLogger(JwtAuthorizeEndpoint.class);
|
||||
|
||||
@Autowired
|
||||
AppsJwtDetailsService jwtDetailsService;
|
||||
|
||||
+11
-11
@@ -107,26 +107,26 @@ public class OAuth2Constants {
|
||||
|
||||
public static class ENDPOINT{
|
||||
|
||||
public final static String ENDPOINT_BASE = "/authz/oauth/v20";
|
||||
public static final String ENDPOINT_BASE = "/authz/oauth/v20";
|
||||
|
||||
public final static String ENDPOINT_AUTHORIZE = ENDPOINT_BASE + "/authorize";
|
||||
public static final String ENDPOINT_AUTHORIZE = ENDPOINT_BASE + "/authorize";
|
||||
|
||||
public final static String ENDPOINT_TOKEN = ENDPOINT_BASE + "/token";
|
||||
public static final String ENDPOINT_TOKEN = ENDPOINT_BASE + "/token";
|
||||
|
||||
public final static String ENDPOINT_CHECK_TOKEN = ENDPOINT_BASE + "/check_token";
|
||||
public static final String ENDPOINT_CHECK_TOKEN = ENDPOINT_BASE + "/check_token";
|
||||
|
||||
public final static String ENDPOINT_TOKEN_KEY = ENDPOINT_BASE + "/token_key";
|
||||
public static final String ENDPOINT_TOKEN_KEY = ENDPOINT_BASE + "/token_key";
|
||||
|
||||
public final static String ENDPOINT_APPROVAL_CONFIRM = ENDPOINT_BASE + "/approval_confirm";
|
||||
public static final String ENDPOINT_APPROVAL_CONFIRM = ENDPOINT_BASE + "/approval_confirm";
|
||||
|
||||
public final static String ENDPOINT_ERROR = ENDPOINT_BASE + "/error";
|
||||
public static final String ENDPOINT_ERROR = ENDPOINT_BASE + "/error";
|
||||
|
||||
public final static String ENDPOINT_USERINFO = "/api/oauth/v20/me";
|
||||
public static final String ENDPOINT_USERINFO = "/api/oauth/v20/me";
|
||||
|
||||
public final static String ENDPOINT_OPENID_CONNECT_USERINFO = "/api/connect/v10/userinfo";
|
||||
public static final String ENDPOINT_OPENID_CONNECT_USERINFO = "/api/connect/v10/userinfo";
|
||||
|
||||
public final static String ENDPOINT_TENCENT_IOA_AUTHORIZE = "/oauth2/authorize";
|
||||
public final static String ENDPOINT_TENCENT_IOA_TOKEN = "/oauth2/token";
|
||||
public static final String ENDPOINT_TENCENT_IOA_AUTHORIZE = "/oauth2/authorize";
|
||||
public static final String ENDPOINT_TENCENT_IOA_TOKEN = "/oauth2/token";
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
+17
-17
@@ -26,17 +26,17 @@ package org.dromara.maxkey.authz.oauth2.jwt.codec;
|
||||
final class Base64Codec {
|
||||
|
||||
/** No options specified. Value is zero. */
|
||||
public final static int NO_OPTIONS = 0;
|
||||
public static final int NO_OPTIONS = 0;
|
||||
|
||||
/** Specify encoding in first bit. Value is one. */
|
||||
public final static int ENCODE = 1;
|
||||
public static final int ENCODE = 1;
|
||||
|
||||
|
||||
/** Specify decoding in first bit. Value is zero. */
|
||||
public final static int DECODE = 0;
|
||||
public static final int DECODE = 0;
|
||||
|
||||
/** Do break lines when encoding. Value is 8. */
|
||||
public final static int DO_BREAK_LINES = 8;
|
||||
public static final int DO_BREAK_LINES = 8;
|
||||
|
||||
/**
|
||||
* Encode using Base64-like encoding that is URL- and Filename-safe as described
|
||||
@@ -46,36 +46,36 @@ final class Base64Codec {
|
||||
* or at the very least should not be called Base64 without also specifying that is
|
||||
* was encoded using the URL- and Filename-safe dialect.
|
||||
*/
|
||||
public final static int URL_SAFE = 16;
|
||||
public static final int URL_SAFE = 16;
|
||||
|
||||
|
||||
/**
|
||||
* Encode using the special "ordered" dialect of Base64 described here:
|
||||
* <a href="http://www.faqs.org/qa/rfcc-1940.html">http://www.faqs.org/qa/rfcc-1940.html</a>.
|
||||
*/
|
||||
public final static int ORDERED = 32;
|
||||
public static final int ORDERED = 32;
|
||||
|
||||
|
||||
/** Maximum line length (76) of Base64 output. */
|
||||
private final static int MAX_LINE_LENGTH = 76;
|
||||
private static final int MAX_LINE_LENGTH = 76;
|
||||
|
||||
|
||||
/** The equals sign (=) as a byte. */
|
||||
private final static byte EQUALS_SIGN = (byte)'=';
|
||||
private static final byte EQUALS_SIGN = (byte)'=';
|
||||
|
||||
|
||||
/** The new line character (\n) as a byte. */
|
||||
private final static byte NEW_LINE = (byte)'\n';
|
||||
private static final byte NEW_LINE = (byte)'\n';
|
||||
|
||||
private final static byte WHITE_SPACE_ENC = -5; // Indicates white space in encoding
|
||||
private final static byte EQUALS_SIGN_ENC = -1; // Indicates equals sign in encoding
|
||||
private static final byte WHITE_SPACE_ENC = -5; // Indicates white space in encoding
|
||||
private static final byte EQUALS_SIGN_ENC = -1; // Indicates equals sign in encoding
|
||||
|
||||
|
||||
/* ******** S T A N D A R D B A S E 6 4 A L P H A B E T ******** */
|
||||
|
||||
/** The 64 valid Base64 values. */
|
||||
/* Host platform me be something funny like EBCDIC, so we hardcode these values. */
|
||||
private final static byte[] _STANDARD_ALPHABET = {
|
||||
private static final byte[] _STANDARD_ALPHABET = {
|
||||
(byte)'A', (byte)'B', (byte)'C', (byte)'D', (byte)'E', (byte)'F', (byte)'G',
|
||||
(byte)'H', (byte)'I', (byte)'J', (byte)'K', (byte)'L', (byte)'M', (byte)'N',
|
||||
(byte)'O', (byte)'P', (byte)'Q', (byte)'R', (byte)'S', (byte)'T', (byte)'U',
|
||||
@@ -93,7 +93,7 @@ final class Base64Codec {
|
||||
* Translates a Base64 value to either its 6-bit reconstruction value
|
||||
* or a negative number indicating some other meaning.
|
||||
**/
|
||||
private final static byte[] _STANDARD_DECODABET = {
|
||||
private static final byte[] _STANDARD_DECODABET = {
|
||||
-9,-9,-9,-9,-9,-9,-9,-9,-9, // Decimal 0 - 8
|
||||
-5,-5, // Whitespace: Tab and Linefeed
|
||||
-9,-9, // Decimal 11 - 12
|
||||
@@ -135,7 +135,7 @@ final class Base64Codec {
|
||||
* <a href="http://www.faqs.org/rfcs/rfc3548.html">http://www.faqs.org/rfcs/rfc3548.html</a>.
|
||||
* Notice that the last two bytes become "hyphen" and "underscore" instead of "plus" and "slash."
|
||||
*/
|
||||
private final static byte[] _URL_SAFE_ALPHABET = {
|
||||
private static final byte[] _URL_SAFE_ALPHABET = {
|
||||
(byte)'A', (byte)'B', (byte)'C', (byte)'D', (byte)'E', (byte)'F', (byte)'G',
|
||||
(byte)'H', (byte)'I', (byte)'J', (byte)'K', (byte)'L', (byte)'M', (byte)'N',
|
||||
(byte)'O', (byte)'P', (byte)'Q', (byte)'R', (byte)'S', (byte)'T', (byte)'U',
|
||||
@@ -151,7 +151,7 @@ final class Base64Codec {
|
||||
/**
|
||||
* Used in decoding URL- and Filename-safe dialects of Base64.
|
||||
*/
|
||||
private final static byte[] _URL_SAFE_DECODABET = {
|
||||
private static final byte[] _URL_SAFE_DECODABET = {
|
||||
-9,-9,-9,-9,-9,-9,-9,-9,-9, // Decimal 0 - 8
|
||||
-5,-5, // Whitespace: Tab and Linefeed
|
||||
-9,-9, // Decimal 11 - 12
|
||||
@@ -198,7 +198,7 @@ final class Base64Codec {
|
||||
* and it is described here:
|
||||
* <a href="http://www.faqs.org/qa/rfcc-1940.html">http://www.faqs.org/qa/rfcc-1940.html</a>.
|
||||
*/
|
||||
private final static byte[] _ORDERED_ALPHABET = {
|
||||
private static final byte[] _ORDERED_ALPHABET = {
|
||||
(byte)'-',
|
||||
(byte)'0', (byte)'1', (byte)'2', (byte)'3', (byte)'4',
|
||||
(byte)'5', (byte)'6', (byte)'7', (byte)'8', (byte)'9',
|
||||
@@ -216,7 +216,7 @@ final class Base64Codec {
|
||||
/**
|
||||
* Used in decoding the "ordered" dialect of Base64.
|
||||
*/
|
||||
private final static byte[] _ORDERED_DECODABET = {
|
||||
private static final byte[] _ORDERED_DECODABET = {
|
||||
-9,-9,-9,-9,-9,-9,-9,-9,-9, // Decimal 0 - 8
|
||||
-5,-5, // Whitespace: Tab and Linefeed
|
||||
-9,-9, // Decimal 11 - 12
|
||||
|
||||
+11
-12
@@ -37,17 +37,15 @@ import org.dromara.maxkey.entity.apps.oauth2.provider.ClientDetails;
|
||||
import org.dromara.maxkey.entity.idm.UserInfo;
|
||||
import org.dromara.maxkey.persistence.cache.MomentaryService;
|
||||
import org.dromara.maxkey.persistence.service.AppsService;
|
||||
import org.dromara.maxkey.util.StrUtils;
|
||||
import org.dromara.maxkey.web.WebContext;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.beans.factory.annotation.Qualifier;
|
||||
import org.springframework.http.ResponseEntity;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
import org.springframework.web.bind.annotation.ResponseBody;
|
||||
import org.springframework.web.servlet.ModelAndView;
|
||||
|
||||
/**
|
||||
@@ -103,7 +101,7 @@ public class OAuth20AccessConfirmationEndpoint {
|
||||
model.put("auth_request", clientAuth);
|
||||
model.put("client", client);
|
||||
model.put("oauth_version", "oauth 2.0");
|
||||
Map<String, String> scopes = new LinkedHashMap<String, String>();
|
||||
Map<String, String> scopes = new LinkedHashMap<>();
|
||||
for (String scope : clientAuth.getScope()) {
|
||||
scopes.put(OAuth2Constants.PARAMETER.SCOPE_PREFIX + scope, "false");
|
||||
}
|
||||
@@ -127,7 +125,7 @@ public class OAuth20AccessConfirmationEndpoint {
|
||||
ModelAndView modelAndView = new ModelAndView("authorize/oauth_access_confirmation");
|
||||
_logger.trace("Confirmation details ");
|
||||
for (Object key : model.keySet()) {
|
||||
_logger.trace("key " + key +"=" + model.get(key));
|
||||
_logger.trace("key {} = {}" , key, model.get(key));
|
||||
}
|
||||
|
||||
model.put("authorizeApproveUri", applicationConfig.getFrontendUri()+"/#/authz/oauth2approve");
|
||||
@@ -137,11 +135,12 @@ public class OAuth20AccessConfirmationEndpoint {
|
||||
}
|
||||
|
||||
@RequestMapping(OAuth2Constants.ENDPOINT.ENDPOINT_APPROVAL_CONFIRM+"/get/{oauth_approval}")
|
||||
public ResponseEntity<?> getAccess(
|
||||
@PathVariable("oauth_approval") String oauth_approval,
|
||||
@ResponseBody
|
||||
public Message<Map<String, Object>> getAccess(
|
||||
@PathVariable("oauth_approval") String oauthApproval,
|
||||
@CurrentUser UserInfo currentUser) {
|
||||
Map<String, Object> model = new HashMap<String, Object>();
|
||||
if(authTokenService.validateJwtToken(oauth_approval)) {
|
||||
Map<String, Object> model = new HashMap<>();
|
||||
if(authTokenService.validateJwtToken(oauthApproval)) {
|
||||
try {
|
||||
AuthorizationRequest clientAuth =
|
||||
(AuthorizationRequest) momentaryService.get(currentUser.getSessionId(), "authorizationRequest");
|
||||
@@ -156,7 +155,7 @@ public class OAuth20AccessConfirmationEndpoint {
|
||||
model.put("appName", app.getAppName());
|
||||
model.put("iconBase64", app.getIconBase64());
|
||||
model.put("oauth_version", "oauth 2.0");
|
||||
Map<String, String> scopes = new LinkedHashMap<String, String>();
|
||||
Map<String, String> scopes = new LinkedHashMap<>();
|
||||
for (String scope : clientAuth.getScope()) {
|
||||
scopes.put(OAuth2Constants.PARAMETER.SCOPE_PREFIX + scope, "false");
|
||||
}
|
||||
@@ -179,10 +178,10 @@ public class OAuth20AccessConfirmationEndpoint {
|
||||
|
||||
_logger.trace("Confirmation details ");
|
||||
for (Object key : model.keySet()) {
|
||||
_logger.trace("key " + key +"=" + model.get(key));
|
||||
_logger.trace("key {} = {}" ,key,model.get(key));
|
||||
}
|
||||
}
|
||||
return new Message<Map<String, Object>>(model).buildResponse();
|
||||
return new Message<>(model);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
+1
-1
@@ -34,7 +34,7 @@ import jakarta.servlet.http.HttpServletRequest;
|
||||
*/
|
||||
public class BearerTokenExtractor implements TokenExtractor {
|
||||
|
||||
private final static Log logger = LogFactory.getLog(BearerTokenExtractor.class);
|
||||
private static final Log logger = LogFactory.getLog(BearerTokenExtractor.class);
|
||||
|
||||
@Override
|
||||
public Authentication extract(HttpServletRequest request) {
|
||||
|
||||
+1
-1
@@ -58,7 +58,7 @@ public class JdbcClientDetailsService implements ClientDetailsService, ClientReg
|
||||
|
||||
private static final Log logger = LogFactory.getLog(JdbcClientDetailsService.class);
|
||||
|
||||
protected final static Cache<String, ClientDetails> detailsCache =
|
||||
protected static final Cache<String, ClientDetails> detailsCache =
|
||||
Caffeine.newBuilder()
|
||||
.expireAfterWrite(30, TimeUnit.MINUTES)
|
||||
.maximumSize(200000)
|
||||
|
||||
+1
-1
@@ -31,7 +31,7 @@ import com.github.benmanes.caffeine.cache.Caffeine;
|
||||
* @author Dave Syer
|
||||
*/
|
||||
public class InMemoryAuthorizationCodeServices extends RandomValueAuthorizationCodeServices {
|
||||
protected final static Cache<String, OAuth2Authentication> authorizationCodeStore =
|
||||
protected static final Cache<String, OAuth2Authentication> authorizationCodeStore =
|
||||
Caffeine.newBuilder()
|
||||
.expireAfterWrite(3, TimeUnit.MINUTES)
|
||||
.build();
|
||||
|
||||
+14
-14
@@ -61,7 +61,9 @@ import org.springframework.security.core.Authentication;
|
||||
import org.springframework.security.core.AuthenticationException;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.util.StringUtils;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMethod;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
@@ -96,7 +98,7 @@ import jakarta.servlet.http.HttpServletResponse;
|
||||
@Tag(name = "2-1-OAuth v2.0 API文档模块")
|
||||
@Controller
|
||||
public class AuthorizationEndpoint extends AbstractEndpoint {
|
||||
final static Logger _logger = LoggerFactory.getLogger(AuthorizationEndpoint.class);
|
||||
static final Logger _logger = LoggerFactory.getLogger(AuthorizationEndpoint.class);
|
||||
|
||||
private static final String OAUTH_V20_AUTHORIZATION_URL = "" + OAuth2Constants.ENDPOINT.ENDPOINT_AUTHORIZE + "?client_id=%s&response_type=code&redirect_uri=%s&approval_prompt=auto";
|
||||
|
||||
@@ -118,13 +120,13 @@ public class AuthorizationEndpoint extends AbstractEndpoint {
|
||||
}
|
||||
|
||||
@Operation(summary = "OAuth 2.0 认证接口", description = "传递参数应用ID,自动完成跳转认证拼接",method="GET")
|
||||
@RequestMapping(value = {OAuth2Constants.ENDPOINT.ENDPOINT_BASE + "/{id}"},method = RequestMethod.GET)
|
||||
@GetMapping(value = {OAuth2Constants.ENDPOINT.ENDPOINT_BASE + "/{id}"})
|
||||
public ModelAndView authorize(
|
||||
HttpServletRequest request,
|
||||
HttpServletResponse response,
|
||||
@PathVariable("id") String id){
|
||||
ClientDetails clientDetails =getClientDetailsService().loadClientByClientId(id,true);
|
||||
_logger.debug(""+clientDetails);
|
||||
_logger.debug("clientDetails {}",clientDetails);
|
||||
String authorizationUrl = "";
|
||||
try {
|
||||
authorizationUrl = String.format(OAUTH_V20_AUTHORIZATION_URL,
|
||||
@@ -140,11 +142,10 @@ public class AuthorizationEndpoint extends AbstractEndpoint {
|
||||
}
|
||||
|
||||
@Operation(summary = "OAuth 2.0 认证接口", description = "传递参数client_id,response_type,redirect_uri等",method="GET")
|
||||
@RequestMapping(value = {
|
||||
@GetMapping(value = {
|
||||
OAuth2Constants.ENDPOINT.ENDPOINT_AUTHORIZE,
|
||||
OAuth2Constants.ENDPOINT.ENDPOINT_TENCENT_IOA_AUTHORIZE
|
||||
},
|
||||
method = RequestMethod.GET)
|
||||
})
|
||||
public ModelAndView authorize(
|
||||
Map<String, Object> model,
|
||||
@RequestParam Map<String, String> parameters,
|
||||
@@ -238,10 +239,9 @@ public class AuthorizationEndpoint extends AbstractEndpoint {
|
||||
}
|
||||
|
||||
//approval must post
|
||||
@RequestMapping(value = {OAuth2Constants.ENDPOINT.ENDPOINT_AUTHORIZE+"/approval"},
|
||||
params = OAuth2Constants.PARAMETER.USER_OAUTH_APPROVAL,
|
||||
method = RequestMethod.POST)
|
||||
public ResponseEntity<?> authorizeApproveOrDeny(
|
||||
@PostMapping(value = {OAuth2Constants.ENDPOINT.ENDPOINT_AUTHORIZE+"/approval"},
|
||||
params = OAuth2Constants.PARAMETER.USER_OAUTH_APPROVAL)
|
||||
public Message< Object> authorizeApproveOrDeny(
|
||||
@RequestParam Map<String, String> approvalParameters,
|
||||
@CurrentUser UserInfo currentUser,
|
||||
SessionStatus sessionStatus) {
|
||||
@@ -281,16 +281,16 @@ public class AuthorizationEndpoint extends AbstractEndpoint {
|
||||
new UserDeniedAuthorizationException("User denied access"),
|
||||
responseTypes.contains(OAuth2Constants.PARAMETER.TOKEN)
|
||||
)
|
||||
).buildResponse();
|
||||
);
|
||||
}
|
||||
|
||||
if (responseTypes.contains(OAuth2Constants.PARAMETER.TOKEN)) {
|
||||
return new Message< Object>((Object)
|
||||
getImplicitGrantResponse(authorizationRequest)).buildResponse();
|
||||
getImplicitGrantResponse(authorizationRequest));
|
||||
}
|
||||
|
||||
return new Message< Object>((Object)
|
||||
getAuthorizationCodeResponse(authorizationRequest, (Authentication) principal)).buildResponse();
|
||||
getAuthorizationCodeResponse(authorizationRequest, (Authentication) principal));
|
||||
}
|
||||
finally {
|
||||
sessionStatus.setComplete();
|
||||
@@ -341,7 +341,7 @@ public class AuthorizationEndpoint extends AbstractEndpoint {
|
||||
authorizationRequest,
|
||||
generateCode(authorizationRequest, authUser)
|
||||
);
|
||||
_logger.debug("successfulRedirect " + successfulRedirect);
|
||||
_logger.debug("successfulRedirect {}" , successfulRedirect);
|
||||
return successfulRedirect;
|
||||
}
|
||||
catch (OAuth2Exception e) {
|
||||
|
||||
+1
-1
@@ -45,7 +45,7 @@ import jakarta.servlet.http.HttpServletResponse;
|
||||
@Tag(name = "2-1-OAuth v2.0 API文档模块")
|
||||
@Controller
|
||||
public class IntrospectEndpoint {
|
||||
final static Logger _logger = LoggerFactory.getLogger(IntrospectEndpoint.class);
|
||||
static final Logger _logger = LoggerFactory.getLogger(IntrospectEndpoint.class);
|
||||
@Autowired
|
||||
@Qualifier("oauth20JdbcClientDetailsService")
|
||||
private ClientDetailsService clientDetailsService;
|
||||
|
||||
+1
-1
@@ -41,7 +41,7 @@ import jakarta.servlet.http.HttpServletResponse;
|
||||
@Tag(name = "2-1-OAuth v2.0 API文档模块")
|
||||
@Controller
|
||||
public class OauthJwksEndpoint extends AbstractEndpoint {
|
||||
final static Logger _logger = LoggerFactory.getLogger(OauthJwksEndpoint.class);
|
||||
static final Logger _logger = LoggerFactory.getLogger(OauthJwksEndpoint.class);
|
||||
|
||||
@Operation(summary = "OAuth JWk 元数据接口", description = "参数mxk_metadata_APPID",method="GET")
|
||||
@RequestMapping(
|
||||
|
||||
+1
-1
@@ -86,7 +86,7 @@ import jakarta.servlet.http.HttpServletResponse;
|
||||
OAuth2Constants.ENDPOINT.ENDPOINT_TENCENT_IOA_TOKEN+"/*"})
|
||||
public class TokenEndpointAuthenticationFilter implements Filter {
|
||||
|
||||
final static Logger _logger = LoggerFactory.getLogger(TokenEndpointAuthenticationFilter.class);
|
||||
static final Logger _logger = LoggerFactory.getLogger(TokenEndpointAuthenticationFilter.class);
|
||||
|
||||
private AuthenticationDetailsSource<HttpServletRequest, ?> authenticationDetailsSource = new WebAuthenticationDetailsSource();
|
||||
boolean allowOnlyPost;
|
||||
|
||||
+1
-1
@@ -28,7 +28,7 @@ import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
public class OAuthDefaultUserInfoAdapter extends AbstractAuthorizeAdapter {
|
||||
final static Logger _logger = LoggerFactory.getLogger(OAuthDefaultUserInfoAdapter.class);
|
||||
static final Logger _logger = LoggerFactory.getLogger(OAuthDefaultUserInfoAdapter.class);
|
||||
ClientDetails clientDetails;
|
||||
|
||||
public OAuthDefaultUserInfoAdapter() {}
|
||||
|
||||
+1
-1
@@ -54,7 +54,7 @@ import jakarta.servlet.http.HttpServletResponse;
|
||||
@Tag(name = "2-1-OAuth v2.0 API文档模块")
|
||||
@Controller
|
||||
public class UserInfoEndpoint {
|
||||
final static Logger _logger = LoggerFactory.getLogger(UserInfoEndpoint.class);
|
||||
static final Logger _logger = LoggerFactory.getLogger(UserInfoEndpoint.class);
|
||||
@Autowired
|
||||
@Qualifier("oauth20JdbcClientDetailsService")
|
||||
private ClientDetailsService clientDetailsService;
|
||||
|
||||
+1
-1
@@ -74,7 +74,7 @@ import com.nimbusds.jwt.SignedJWT;
|
||||
@Tag(name = "2-1-OAuth v2.0 API文档模块")
|
||||
@Controller
|
||||
public class UserInfoOIDCEndpoint {
|
||||
final static Logger _logger = LoggerFactory.getLogger(UserInfoOIDCEndpoint.class);
|
||||
static final Logger _logger = LoggerFactory.getLogger(UserInfoOIDCEndpoint.class);
|
||||
@Autowired
|
||||
@Qualifier("oauth20JdbcClientDetailsService")
|
||||
private ClientDetailsService clientDetailsService;
|
||||
|
||||
+1
-1
@@ -44,7 +44,7 @@ import jakarta.servlet.http.HttpServletResponse;
|
||||
@Tag(name = "2-1-OAuth v2.0 API文档模块")
|
||||
@Controller
|
||||
public class OauthAuthorizationServerEndpoint extends AbstractEndpoint {
|
||||
final static Logger _logger = LoggerFactory.getLogger(OauthAuthorizationServerEndpoint.class);
|
||||
static final Logger _logger = LoggerFactory.getLogger(OauthAuthorizationServerEndpoint.class);
|
||||
|
||||
@Operation(summary = "OAuth v2 metadata 元数据接口", description = "参数client_id",method="GET,POST")
|
||||
@RequestMapping(
|
||||
|
||||
+1
-1
@@ -38,7 +38,7 @@ import java.util.Set;
|
||||
@Tag(name = "2-1-OAuth v2.0 API文档模块")
|
||||
@Controller
|
||||
public class OpenidConfigurationEndpoint extends AbstractEndpoint {
|
||||
final static Logger _logger = LoggerFactory.getLogger(OpenidConfigurationEndpoint.class);
|
||||
static final Logger _logger = LoggerFactory.getLogger(OpenidConfigurationEndpoint.class);
|
||||
|
||||
|
||||
@Operation(summary = "OpenID Connect metadata 元数据接口", description = "参数client_id",method="GET,POST")
|
||||
|
||||
+2
-2
@@ -62,9 +62,9 @@ import com.nimbusds.jwt.SignedJWT;
|
||||
*
|
||||
*/
|
||||
public class OIDCIdTokenEnhancer implements TokenEnhancer {
|
||||
private final static Logger _logger = LoggerFactory.getLogger(OIDCIdTokenEnhancer.class);
|
||||
private static final Logger _logger = LoggerFactory.getLogger(OIDCIdTokenEnhancer.class);
|
||||
|
||||
public final static String ID_TOKEN_SCOPE="openid";
|
||||
public static final String ID_TOKEN_SCOPE="openid";
|
||||
|
||||
private OIDCProviderMetadata providerMetadata;
|
||||
|
||||
|
||||
+1
-1
@@ -29,7 +29,7 @@ import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
public class EndpointGenerator {
|
||||
private final static Logger logger = LoggerFactory.getLogger(EndpointGenerator.class);
|
||||
private static final Logger logger = LoggerFactory.getLogger(EndpointGenerator.class);
|
||||
|
||||
public Endpoint generateEndpoint( String location) {
|
||||
logger.debug("end point location: {}", location);
|
||||
|
||||
+1
-1
@@ -48,7 +48,7 @@ import org.springframework.beans.factory.InitializingBean;
|
||||
*/
|
||||
public class SignatureSecurityPolicyRule implements InitializingBean, SecurityPolicyRule {
|
||||
|
||||
private final static Logger logger = LoggerFactory.getLogger(SignatureSecurityPolicyRule.class);
|
||||
private static final Logger logger = LoggerFactory.getLogger(SignatureSecurityPolicyRule.class);
|
||||
|
||||
private final CredentialResolver credentialResolver;
|
||||
private final SAMLSignatureProfileValidator samlSignatureProfileValidator;
|
||||
|
||||
+1
-1
@@ -42,7 +42,7 @@ import org.springframework.beans.factory.InitializingBean;
|
||||
import jakarta.servlet.http.HttpServletRequest;
|
||||
|
||||
public class ExtractPostBindingAdapter implements ExtractBindingAdapter, InitializingBean{
|
||||
private final static Logger _logger = LoggerFactory.getLogger(ExtractPostBindingAdapter.class);
|
||||
private static final Logger _logger = LoggerFactory.getLogger(ExtractPostBindingAdapter.class);
|
||||
|
||||
static final String SAML_REQUEST_POST_PARAM_NAME = "SAMLRequest";
|
||||
static final String SAML_RESPONSE_POST_PARAM_NAME = "SAMLResponse";
|
||||
|
||||
+1
-1
@@ -54,7 +54,7 @@ import jakarta.servlet.http.HttpServletRequest;
|
||||
import jakarta.servlet.http.HttpServletResponse;
|
||||
|
||||
public class PostBindingAdapter implements BindingAdapter, InitializingBean{
|
||||
private final static Logger logger = LoggerFactory.getLogger(PostBindingAdapter.class);
|
||||
private static final Logger logger = LoggerFactory.getLogger(PostBindingAdapter.class);
|
||||
|
||||
static final String SAML_REQUEST_POST_PARAM_NAME = "SAMLRequest";
|
||||
static final String SAML_RESPONSE_POST_PARAM_NAME = "SAMLResponse";
|
||||
|
||||
+1
-1
@@ -82,7 +82,7 @@ import jakarta.servlet.http.HttpServletResponse;
|
||||
@Controller
|
||||
public class ConsumerEndpoint {
|
||||
|
||||
private final static Logger logger = LoggerFactory.getLogger(ConsumerEndpoint.class);
|
||||
private static final Logger logger = LoggerFactory.getLogger(ConsumerEndpoint.class);
|
||||
|
||||
private BindingAdapter bindingAdapter;
|
||||
|
||||
|
||||
+1
-1
@@ -50,7 +50,7 @@ import jakarta.servlet.http.HttpServletResponse;
|
||||
public class RealAuthenticationFailureHandler implements
|
||||
AuthenticationFailureHandler {
|
||||
|
||||
private final static Logger logger = LoggerFactory
|
||||
private static final Logger logger = LoggerFactory
|
||||
.getLogger(RealAuthenticationFailureHandler.class);
|
||||
|
||||
private final RequestCache requestCache;
|
||||
|
||||
+1
-1
@@ -56,7 +56,7 @@ import org.w3c.dom.Element;
|
||||
*
|
||||
*/
|
||||
public class MetadataDescriptorUtil {
|
||||
private final static Logger logger = LoggerFactory.getLogger(MetadataDescriptorUtil.class);
|
||||
private static final Logger logger = LoggerFactory.getLogger(MetadataDescriptorUtil.class);
|
||||
|
||||
private static MetadataDescriptorUtil instance = null;
|
||||
|
||||
|
||||
+1
-1
@@ -95,7 +95,7 @@ import org.springframework.core.io.FileSystemResource;
|
||||
import java.security.KeyStore;
|
||||
|
||||
public class MetadataGenerator {
|
||||
private final static Logger logger = LoggerFactory.getLogger(MetadataGenerator.class);
|
||||
private static final Logger logger = LoggerFactory.getLogger(MetadataGenerator.class);
|
||||
|
||||
/** Parser manager used to parse XML. */
|
||||
protected static BasicParserPool parser;
|
||||
|
||||
+1
-1
@@ -58,7 +58,7 @@ import jakarta.servlet.http.HttpServletResponse;
|
||||
@Controller
|
||||
@RequestMapping(value = { "/metadata/saml20/" })
|
||||
public class SamlMetadataEndpoint {
|
||||
private final static Logger logger = LoggerFactory
|
||||
private static final Logger logger = LoggerFactory
|
||||
.getLogger(SamlMetadataEndpoint.class);
|
||||
|
||||
@Autowired
|
||||
|
||||
+1
-1
@@ -46,7 +46,7 @@ import jakarta.servlet.http.HttpServletResponse;
|
||||
|
||||
@Controller
|
||||
public class AssertionEndpoint {
|
||||
private final static Logger logger = LoggerFactory.getLogger(AssertionEndpoint.class);
|
||||
private static final Logger logger = LoggerFactory.getLogger(AssertionEndpoint.class);
|
||||
|
||||
private BindingAdapter bindingAdapter;
|
||||
|
||||
|
||||
+1
-1
@@ -52,7 +52,7 @@ import jakarta.servlet.http.HttpServletResponse;
|
||||
@Tag(name = "2-2-SAML v2.0 API文档模块")
|
||||
@Controller
|
||||
public class IdpInitEndpoint {
|
||||
private final static Logger logger = LoggerFactory.getLogger(IdpInitEndpoint.class);
|
||||
private static final Logger logger = LoggerFactory.getLogger(IdpInitEndpoint.class);
|
||||
|
||||
private BindingAdapter bindingAdapter;
|
||||
|
||||
|
||||
+1
-1
@@ -43,7 +43,7 @@ import jakarta.servlet.http.HttpServletResponse;
|
||||
@Tag(name = "2-2-SAML v2.0 API文档模块")
|
||||
@Controller
|
||||
public class LogoutSamlEndpoint {
|
||||
private final static Logger logger = LoggerFactory.getLogger(LogoutSamlEndpoint.class);
|
||||
private static final Logger logger = LoggerFactory.getLogger(LogoutSamlEndpoint.class);
|
||||
|
||||
@Autowired
|
||||
@Qualifier("extractRedirectBindingAdapter")
|
||||
|
||||
+1
-1
@@ -51,7 +51,7 @@ import jakarta.servlet.http.HttpServletResponse;
|
||||
@Tag(name = "2-2-SAML v2.0 API文档模块")
|
||||
@Controller
|
||||
public class SingleSignOnEndpoint {
|
||||
private final static Logger logger = LoggerFactory.getLogger(SingleSignOnEndpoint.class);
|
||||
private static final Logger logger = LoggerFactory.getLogger(SingleSignOnEndpoint.class);
|
||||
|
||||
private BindingAdapter bindingAdapter;
|
||||
|
||||
|
||||
+1
-1
@@ -51,7 +51,7 @@ import org.springframework.security.core.GrantedAuthority;
|
||||
import org.springframework.security.core.authority.SimpleGrantedAuthority;
|
||||
|
||||
public class AssertionGenerator {
|
||||
private final static Logger logger = LoggerFactory.getLogger(AssertionGenerator.class);
|
||||
private static final Logger logger = LoggerFactory.getLogger(AssertionGenerator.class);
|
||||
|
||||
private final IssuerGenerator issuerGenerator;
|
||||
private final SubjectGenerator subjectGenerator;
|
||||
|
||||
+1
-1
@@ -44,7 +44,7 @@ import org.slf4j.LoggerFactory;
|
||||
import org.springframework.security.core.GrantedAuthority;
|
||||
|
||||
public class AttributeStatementGenerator {
|
||||
private final static Logger logger = LoggerFactory.getLogger(AttributeStatementGenerator.class);
|
||||
private static final Logger logger = LoggerFactory.getLogger(AttributeStatementGenerator.class);
|
||||
|
||||
private final XMLObjectBuilderFactory builderFactory = Configuration.getBuilderFactory();
|
||||
|
||||
|
||||
+1
-1
@@ -44,7 +44,7 @@ import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
public class AuthnResponseGenerator {
|
||||
private final static Logger logger = LoggerFactory.getLogger(AuthnResponseGenerator.class);
|
||||
private static final Logger logger = LoggerFactory.getLogger(AuthnResponseGenerator.class);
|
||||
private String issuerName;
|
||||
private IDService idService;
|
||||
private TimeService timeService;
|
||||
|
||||
+1
-1
@@ -29,7 +29,7 @@ import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
public class AuthnStatementGenerator {
|
||||
private final static Logger logger = LoggerFactory.getLogger(AuthnStatementGenerator.class);
|
||||
private static final Logger logger = LoggerFactory.getLogger(AuthnStatementGenerator.class);
|
||||
|
||||
public AuthnStatement generateAuthnStatement(DateTime authnInstant) {
|
||||
//Response/Assertion/AuthnStatement/AuthContext/AuthContextClassRef
|
||||
|
||||
+1
-1
@@ -29,7 +29,7 @@ import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
public class ConditionsGenerator {
|
||||
private final static Logger logger = LoggerFactory.getLogger(ConditionsGenerator.class);
|
||||
private static final Logger logger = LoggerFactory.getLogger(ConditionsGenerator.class);
|
||||
|
||||
public Conditions generateConditions(String audienceUrl,int validInSeconds) {
|
||||
Conditions conditions = new ConditionsBuilder().buildObject();
|
||||
|
||||
+1
-1
@@ -55,7 +55,7 @@ import jakarta.servlet.http.HttpServletResponse;
|
||||
@Controller
|
||||
public class TokenBasedAuthorizeEndpoint extends AuthorizeBaseEndpoint{
|
||||
|
||||
final static Logger _logger = LoggerFactory.getLogger(TokenBasedAuthorizeEndpoint.class);
|
||||
static final Logger _logger = LoggerFactory.getLogger(TokenBasedAuthorizeEndpoint.class);
|
||||
@Autowired
|
||||
AppsTokenBasedDetailsService tokenBasedDetailsService;
|
||||
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user