mirror of
https://gitee.com/dromara/MaxKey.git
synced 2026-05-14 04:22:08 +08:00
getAppDetails rename to get & cached load
This commit is contained in:
@@ -22,5 +22,5 @@ import org.dromara.mybatis.jpa.service.IJpaService;
|
||||
|
||||
public interface AppsCasDetailsService extends IJpaService<AppsCasDetails>{
|
||||
|
||||
public AppsCasDetails getAppDetails(String id , boolean cached) ;
|
||||
public AppsCasDetails get(String id , boolean cached) ;
|
||||
}
|
||||
|
||||
@@ -22,5 +22,5 @@ import org.dromara.mybatis.jpa.service.IJpaService;
|
||||
|
||||
public interface AppsFormBasedDetailsService extends IJpaService<AppsFormBasedDetails>{
|
||||
|
||||
public AppsFormBasedDetails getAppDetails(String id,boolean cached) ;
|
||||
public AppsFormBasedDetails get(String id,boolean cached) ;
|
||||
}
|
||||
|
||||
@@ -22,5 +22,5 @@ import org.dromara.mybatis.jpa.service.IJpaService;
|
||||
|
||||
public interface AppsJwtDetailsService extends IJpaService<AppsJwtDetails>{
|
||||
|
||||
public AppsJwtDetails getAppDetails(String id , boolean cached) ;
|
||||
public AppsJwtDetails get(String id , boolean cached) ;
|
||||
}
|
||||
|
||||
@@ -22,5 +22,5 @@ import org.dromara.mybatis.jpa.service.IJpaService;
|
||||
|
||||
public interface AppsSaml20DetailsService extends IJpaService<AppsSAML20Details>{
|
||||
|
||||
public AppsSAML20Details getAppDetails(String id , boolean cached);
|
||||
public AppsSAML20Details get(String id , boolean cached);
|
||||
}
|
||||
|
||||
@@ -22,5 +22,5 @@ import org.dromara.mybatis.jpa.service.IJpaService;
|
||||
|
||||
public interface AppsTokenBasedDetailsService extends IJpaService<AppsTokenBasedDetails>{
|
||||
|
||||
public AppsTokenBasedDetails getAppDetails(String id , boolean cached) ;
|
||||
public AppsTokenBasedDetails get(String id , boolean cached) ;
|
||||
}
|
||||
|
||||
@@ -37,7 +37,7 @@ public class AppsCasDetailsServiceImpl extends JpaServiceImpl<AppsCasDetailsMap
|
||||
.maximumSize(200000)
|
||||
.build();
|
||||
|
||||
public AppsCasDetails getAppDetails(String id , boolean cached) {
|
||||
public AppsCasDetails get(String id , boolean cached) {
|
||||
AppsCasDetails details = null;
|
||||
if(cached) {
|
||||
details = detailsCache.getIfPresent(id);
|
||||
|
||||
@@ -37,7 +37,7 @@ public class AppsFormBasedDetailsServiceImpl extends JpaServiceImpl<AppsFormBas
|
||||
.maximumSize(200000)
|
||||
.build();
|
||||
|
||||
public AppsFormBasedDetails getAppDetails(String id,boolean cached) {
|
||||
public AppsFormBasedDetails get(String id,boolean cached) {
|
||||
AppsFormBasedDetails details = null;
|
||||
if(cached) {
|
||||
details = detailsCache.getIfPresent(id);
|
||||
|
||||
@@ -38,7 +38,7 @@ public class AppsJwtDetailsServiceImpl extends JpaServiceImpl<AppsJwtDetailsMap
|
||||
.build();
|
||||
|
||||
|
||||
public AppsJwtDetails getAppDetails(String id , boolean cached) {
|
||||
public AppsJwtDetails get(String id , boolean cached) {
|
||||
AppsJwtDetails details = null;
|
||||
if(cached) {
|
||||
details = detailsCache.getIfPresent(id);
|
||||
|
||||
@@ -37,7 +37,7 @@ public class AppsSaml20DetailsServiceImpl extends JpaServiceImpl<AppsSaml20Deta
|
||||
.maximumSize(200000)
|
||||
.build();
|
||||
|
||||
public AppsSAML20Details getAppDetails(String id , boolean cached){
|
||||
public AppsSAML20Details get(String id , boolean cached){
|
||||
AppsSAML20Details details = null;
|
||||
if(cached) {
|
||||
details = detailsCache.getIfPresent(id);
|
||||
|
||||
@@ -37,7 +37,7 @@ public class AppsTokenBasedDetailsServiceImpl extends JpaServiceImpl<AppsTokenB
|
||||
.maximumSize(200000)
|
||||
.build();
|
||||
|
||||
public AppsTokenBasedDetails getAppDetails(String id , boolean cached) {
|
||||
public AppsTokenBasedDetails get(String id , boolean cached) {
|
||||
AppsTokenBasedDetails details = null;
|
||||
if(cached) {
|
||||
details = detailsCache.getIfPresent(id);
|
||||
|
||||
@@ -61,7 +61,7 @@ public class CasAuthorizeEndpoint extends CasBaseAuthorizeEndpoint{
|
||||
){
|
||||
String queryService = HttpUtils.requestUrl(casService);
|
||||
_logger.debug("service {}" , queryService);
|
||||
AppsCasDetails casDetails = casDetailsService.getAppDetails(queryService , true);
|
||||
AppsCasDetails casDetails = casDetailsService.get(queryService , true);
|
||||
return buildCasModelAndView(request,response,casDetails,casService);
|
||||
}
|
||||
|
||||
@@ -72,7 +72,7 @@ public class CasAuthorizeEndpoint extends CasBaseAuthorizeEndpoint{
|
||||
HttpServletResponse response
|
||||
){
|
||||
|
||||
AppsCasDetails casDetails = casDetailsService.getAppDetails(id , true);
|
||||
AppsCasDetails casDetails = casDetailsService.get(id , true);
|
||||
|
||||
return buildCasModelAndView(request,response,casDetails,casDetails == null ? id : casDetails.getCallbackUrl());
|
||||
}
|
||||
|
||||
@@ -121,7 +121,7 @@ public class CasRestV1Endpoint extends CasBaseAuthorizeEndpoint{
|
||||
TicketGrantingTicketImpl ticketGrantingTicketImpl =
|
||||
(TicketGrantingTicketImpl) casTicketGrantingTicketServices.get(ticketGrantingTicket);
|
||||
|
||||
AppsCasDetails casDetails=casDetailsService.getAppDetails(casService , true);
|
||||
AppsCasDetails casDetails=casDetailsService.get(casService , true);
|
||||
|
||||
ServiceTicketImpl serviceTicket=new ServiceTicketImpl(ticketGrantingTicketImpl.getAuthentication(),casDetails);
|
||||
String ticket = ticketServices.createTicket(serviceTicket);
|
||||
|
||||
@@ -65,7 +65,7 @@ public class FormBasedAuthorizeEndpoint extends AuthorizeBaseEndpoint{
|
||||
@PathVariable String id,
|
||||
@CurrentUser UserInfo currentUser){
|
||||
|
||||
AppsFormBasedDetails formBasedDetails = formBasedDetailsService.getAppDetails(id , true);
|
||||
AppsFormBasedDetails formBasedDetails = formBasedDetailsService.get(id , true);
|
||||
_logger.debug("formBasedDetails {}",formBasedDetails);
|
||||
Apps application = getApp(id);
|
||||
formBasedDetails.setAdapter(application.getAdapter());
|
||||
|
||||
@@ -75,7 +75,7 @@ public class JwtAuthorizeEndpoint extends AuthorizeBaseEndpoint{
|
||||
@CurrentUser UserInfo currentUser){
|
||||
ModelAndView modelAndView=new ModelAndView();
|
||||
Apps application = getApp(id);
|
||||
AppsJwtDetails jwtDetails = jwtDetailsService.getAppDetails(application.getId() , true);
|
||||
AppsJwtDetails jwtDetails = jwtDetailsService.get(application.getId() , true);
|
||||
_logger.debug("jwtDetails {}",jwtDetails);
|
||||
jwtDetails.setAdapter(application.getAdapter());
|
||||
jwtDetails.setIsAdapter(application.getIsAdapter());
|
||||
@@ -111,7 +111,7 @@ public class JwtAuthorizeEndpoint extends AuthorizeBaseEndpoint{
|
||||
HttpServletResponse response,
|
||||
@PathVariable("appid") String appId,
|
||||
@PathVariable String mediaType) {
|
||||
AppsJwtDetails jwtDetails = jwtDetailsService.getAppDetails(appId , true);
|
||||
AppsJwtDetails jwtDetails = jwtDetailsService.get(appId , true);
|
||||
if(jwtDetails != null) {
|
||||
String jwkSetString = "";
|
||||
if(!jwtDetails.getSignature().equalsIgnoreCase("none")) {
|
||||
|
||||
@@ -85,11 +85,11 @@ public class UserInfoEndpoint {
|
||||
try{
|
||||
oAuth2Authentication = oauth20tokenServices.loadAuthentication(access_token);
|
||||
|
||||
String client_id= oAuth2Authentication.getOAuth2Request().getClientId();
|
||||
String client_id = oAuth2Authentication.getOAuth2Request().getClientId();
|
||||
ClientDetails clientDetails =
|
||||
clientDetailsService.loadClientByClientId(client_id,true);
|
||||
|
||||
Apps app = appsService.get(client_id);
|
||||
Apps app = appsService.get(client_id,true);
|
||||
|
||||
AbstractAuthorizeAdapter adapter;
|
||||
if(ConstsBoolean.isTrue(app.getIsAdapter())){
|
||||
|
||||
@@ -232,7 +232,7 @@ public class ConsumerEndpoint {
|
||||
*/
|
||||
private void initCredential(String appId) throws Exception {
|
||||
// 1. 获取 sp keyStore
|
||||
AppsSAML20Details saml20Details = saml20DetailsService.get(appId);
|
||||
AppsSAML20Details saml20Details = saml20DetailsService.get(appId,true);
|
||||
if (saml20Details == null) {
|
||||
logger.error("appId[" + appId + "] not exists");
|
||||
throw new Exception();
|
||||
|
||||
@@ -92,7 +92,7 @@ public class IdpInitEndpoint {
|
||||
HttpServletResponse response,
|
||||
@PathVariable("appid") String appId)throws Exception {
|
||||
logger.debug("SAML IDP init , app id is "+appId);
|
||||
AppsSAML20Details saml20Details = saml20DetailsService.getAppDetails(appId , true);
|
||||
AppsSAML20Details saml20Details = saml20DetailsService.get(appId , true);
|
||||
WebContext.setAttribute(WebConstants.AUTHORIZE_SIGN_ON_APP, saml20Details);
|
||||
if (saml20Details == null) {
|
||||
logger.error("samlId[" + appId + "] Error .");
|
||||
|
||||
@@ -113,7 +113,7 @@ public class SingleSignOnEndpoint {
|
||||
}
|
||||
|
||||
public void extractSaml20Detail(ExtractBindingAdapter extractBindingAdapter,String samlId) throws Exception{
|
||||
AppsSAML20Details saml20Details = saml20DetailsService.getAppDetails(samlId , true);
|
||||
AppsSAML20Details saml20Details = saml20DetailsService.get(samlId , true);
|
||||
WebContext.setAttribute(WebConstants.AUTHORIZE_SIGN_ON_APP, saml20Details);
|
||||
if (saml20Details == null) {
|
||||
logger.error("Request SAML APPID [" + samlId + "] is not exist .");
|
||||
|
||||
@@ -73,7 +73,7 @@ public class TokenBasedAuthorizeEndpoint extends AuthorizeBaseEndpoint{
|
||||
|
||||
|
||||
AppsTokenBasedDetails tokenBasedDetails=null;
|
||||
tokenBasedDetails=tokenBasedDetailsService.getAppDetails(id , true);
|
||||
tokenBasedDetails=tokenBasedDetailsService.get(id , true);
|
||||
_logger.debug(""+tokenBasedDetails);
|
||||
|
||||
Apps application= getApp(id);
|
||||
|
||||
@@ -86,7 +86,7 @@ public class SingleSignOnInterceptor implements AsyncHandlerInterceptor {
|
||||
|
||||
String requestURI = request.getRequestURI();
|
||||
if(requestURI.contains("/authz/cas/login")) {//for CAS service
|
||||
app = casDetailsService.getAppDetails(
|
||||
app = casDetailsService.get(
|
||||
request.getParameter(CasConstants.PARAMETER.SERVICE), true);
|
||||
}else if(requestURI.contains("/authz/jwt/")
|
||||
||requestURI.contains("/authz/api/")
|
||||
|
||||
@@ -52,7 +52,7 @@ public class CasDetailsController extends BaseAppContorller {
|
||||
|
||||
@GetMapping(value = { "/get/{id}" }, produces = {MediaType.APPLICATION_JSON_VALUE})
|
||||
public Message<AppsCasDetails> get(@PathVariable String id) {
|
||||
AppsCasDetails casDetails=casDetailsService.getAppDetails(id , false);
|
||||
AppsCasDetails casDetails=casDetailsService.get(id , false);
|
||||
super.decoderSecret(casDetails);
|
||||
casDetails.transIconBase64();
|
||||
return new Message<>(casDetails);
|
||||
|
||||
@@ -57,7 +57,7 @@ public class FormBasedDetailsController extends BaseAppContorller {
|
||||
|
||||
@RequestMapping(value = { "/get/{id}" }, produces = {MediaType.APPLICATION_JSON_VALUE})
|
||||
public Message<?> get(@PathVariable String id) {
|
||||
AppsFormBasedDetails formBasedDetails=formBasedDetailsService.getAppDetails(id , false);
|
||||
AppsFormBasedDetails formBasedDetails=formBasedDetailsService.get(id , false);
|
||||
decoderSecret(formBasedDetails);
|
||||
decoderSharedPassword(formBasedDetails);
|
||||
formBasedDetails.transIconBase64();
|
||||
|
||||
@@ -58,7 +58,7 @@ public class JwtDetailsController extends BaseAppContorller {
|
||||
|
||||
@RequestMapping(value = { "/get/{id}" }, produces = {MediaType.APPLICATION_JSON_VALUE})
|
||||
public Message<?> get(@PathVariable String id) {
|
||||
AppsJwtDetails jwtDetails=jwtDetailsService.getAppDetails(id , false);
|
||||
AppsJwtDetails jwtDetails=jwtDetailsService.get(id , false);
|
||||
decoderSecret(jwtDetails);
|
||||
jwtDetails.transIconBase64();
|
||||
return new Message<AppsJwtDetails>(jwtDetails);
|
||||
|
||||
@@ -81,7 +81,7 @@ public class SAML20DetailsController extends BaseAppContorller {
|
||||
|
||||
@RequestMapping(value = { "/get/{id}" }, produces = {MediaType.APPLICATION_JSON_VALUE})
|
||||
public Message<?> get(@PathVariable String id) {
|
||||
AppsSAML20Details saml20Details=saml20DetailsService.getAppDetails(id , false);
|
||||
AppsSAML20Details saml20Details=saml20DetailsService.get(id , false);
|
||||
decoderSecret(saml20Details);
|
||||
saml20Details.transIconBase64();
|
||||
//modelAndView.addObject("authzURI",applicationConfig.getAuthzUri());
|
||||
|
||||
@@ -56,7 +56,7 @@ public class TokenBasedDetailsController extends BaseAppContorller {
|
||||
|
||||
@GetMapping(value = { "/get/{id}" }, produces = {MediaType.APPLICATION_JSON_VALUE})
|
||||
public Message<?> get(@PathVariable String id) {
|
||||
AppsTokenBasedDetails tokenBasedDetails=tokenBasedDetailsService.getAppDetails(id , false);
|
||||
AppsTokenBasedDetails tokenBasedDetails=tokenBasedDetailsService.get(id , false);
|
||||
decoderSecret(tokenBasedDetails);
|
||||
String algorithmKey=passwordReciprocal.decoder(tokenBasedDetails.getAlgorithmKey());
|
||||
tokenBasedDetails.setAlgorithmKey(algorithmKey);
|
||||
|
||||
Reference in New Issue
Block a user