From 64740bdd29a1caf441826dcc062a9cfef2eea33c Mon Sep 17 00:00:00 2001 From: AlexBob <5199840@qq.com> Date: Mon, 8 Jul 2024 10:46:30 +0800 Subject: [PATCH] =?UTF-8?q?=E2=99=BB=EF=B8=8F=20refactor(SecurityControlle?= =?UTF-8?q?r.java):=20=E7=A7=BB=E9=99=A4=E6=9C=AA=E4=BD=BF=E7=94=A8?= =?UTF-8?q?=E7=9A=84=E5=AF=BC=E5=85=A5=E5=92=8C=E6=96=B9=E6=B3=95=20?= =?UTF-8?q?=E2=99=BB=EF=B8=8F=20refactor(package.json):=20=E6=9B=B4?= =?UTF-8?q?=E6=96=B0=E7=89=88=E6=9C=AC=E5=8F=B7=E8=87=B3=200.0.1=20?= =?UTF-8?q?=E2=9C=A8=20feat(launch.json):=20=E6=B7=BB=E5=8A=A0=20Microsoft?= =?UTF-8?q?=20Edge=20=E5=90=AF=E5=8A=A8=E9=85=8D=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../platform/boot/security/SecurityController.java | 11 ----------- ng-ui/.vscode/launch.json | 7 +++++++ ng-ui/package-lock.json | 4 ++-- ng-ui/package.json | 2 +- 4 files changed, 10 insertions(+), 14 deletions(-) diff --git a/boot/platform/src/main/java/com/platform/boot/security/SecurityController.java b/boot/platform/src/main/java/com/platform/boot/security/SecurityController.java index fa6b235d..071e9581 100644 --- a/boot/platform/src/main/java/com/platform/boot/security/SecurityController.java +++ b/boot/platform/src/main/java/com/platform/boot/security/SecurityController.java @@ -1,7 +1,6 @@ package com.platform.boot.security; import com.platform.boot.commons.exception.RestServerException; -import com.platform.boot.commons.utils.BeanUtils; import com.platform.boot.commons.utils.ContextUtils; import com.platform.boot.security.core.AuthenticationToken; import jakarta.validation.Valid; @@ -9,7 +8,6 @@ import lombok.Data; import lombok.RequiredArgsConstructor; import org.springframework.security.core.Authentication; -import org.springframework.security.core.context.ReactiveSecurityContextHolder; import org.springframework.security.core.userdetails.UserDetails; import org.springframework.security.crypto.password.PasswordEncoder; import org.springframework.security.oauth2.client.web.server.ServerOAuth2AuthorizedClientRepository; @@ -19,8 +17,6 @@ import org.springframework.web.server.WebSession; import reactor.core.publisher.Mono; -import java.util.Map; - /** * @author Alex bob */ @@ -33,18 +29,11 @@ public class SecurityController { private final PasswordEncoder passwordEncoder; private final ServerOAuth2AuthorizedClientRepository clientRepository; - @GetMapping("/realms/issuer") - public Mono> issuer(SecurityDetails principal) { - return ReactiveSecurityContextHolder.getContext().map(securityContext -> BeanUtils.beanToMap(securityContext - .getAuthentication().getDetails())); - } @GetMapping("token") public Mono token(WebSession session, Authentication authentication) { return Mono.defer(() -> Mono.just(AuthenticationToken.build(session, authentication))); } - - @GetMapping("csrf") public Mono csrfToken() { return Mono.deferContextual((contextView) -> { diff --git a/ng-ui/.vscode/launch.json b/ng-ui/.vscode/launch.json index 5826f2af..3744974c 100644 --- a/ng-ui/.vscode/launch.json +++ b/ng-ui/.vscode/launch.json @@ -15,6 +15,13 @@ "request": "launch", "preLaunchTask": "npm: test", "url": "http://localhost:9876/debug.html" + }, + { + "type": "msedge", + "request": "launch", + "name": "Launch Edge against localhost", + "url": "http://localhost:4200", + "webRoot": "${workspaceFolder}" } ] } \ No newline at end of file diff --git a/ng-ui/package-lock.json b/ng-ui/package-lock.json index 61a6164b..1f3eab6e 100644 --- a/ng-ui/package-lock.json +++ b/ng-ui/package-lock.json @@ -1,12 +1,12 @@ { "name": "ng-ui", - "version": "0.0.0", + "version": "0.0.1", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "ng-ui", - "version": "0.0.0", + "version": "0.0.1", "dependencies": { "@angular/animations": "^18.0.0", "@angular/common": "^18.0.0", diff --git a/ng-ui/package.json b/ng-ui/package.json index 80cdc7a2..42655cdb 100644 --- a/ng-ui/package.json +++ b/ng-ui/package.json @@ -1,6 +1,6 @@ { "name": "ng-ui", - "version": "0.0.0", + "version": "0.0.1", "scripts": { "ng": "ng", "start": "ng serve",