Skip to content

Commit

Permalink
[修复] 修复授权服务器 Security Security 没有捕获不会按照统一格式输出问题
Browse files Browse the repository at this point in the history
  • Loading branch information
herodotus-ecosystem committed May 28, 2024
1 parent d243254 commit fc623f3
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 24 deletions.
38 changes: 16 additions & 22 deletions configurations/docker/docker-compose/windows/herodotus/env.base.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,32 +29,26 @@ services:
- "9848:9848"
- "9849:9849"

zookeeper:
image: debezium/zookeeper:2.6
container_name: zookeeper
environment:
ZOOKEEPER_SERVER_ID: 1
ports:
- "2181:2181"
- "2888:2888"
- "3888:3888"

kafka:
image: debezium/kafka:2.6
image: apache/kafka:3.7.0
container_name: kafka
hostname: broker
environment:
KAFKA_NODE_ID: 1
KAFKA_LISTENER_SECURITY_PROTOCOL_MAP: 'CONTROLLER:PLAINTEXT,PLAINTEXT:PLAINTEXT,PLAINTEXT_HOST:PLAINTEXT'
KAFKA_ADVERTISED_LISTENERS: 'PLAINTEXT_HOST://192.168.101.10:9092,PLAINTEXT://broker:19092'
KAFKA_PROCESS_ROLES: 'broker,controller'
KAFKA_CONTROLLER_QUORUM_VOTERS: '1@broker:29093'
KAFKA_LISTENERS: 'CONTROLLER://:29093,PLAINTEXT_HOST://:9092,PLAINTEXT://:19092'
KAFKA_INTER_BROKER_LISTENER_NAME: 'PLAINTEXT'
KAFKA_CONTROLLER_LISTENER_NAMES: 'CONTROLLER'
KAFKA_OFFSETS_TOPIC_REPLICATION_FACTOR: 1
KAFKA_GROUP_INITIAL_REBALANCE_DELAY_MS: 0
KAFKA_TRANSACTION_STATE_LOG_MIN_ISR: 1
KAFKA_TRANSACTION_STATE_LOG_REPLICATION_FACTOR: 1
ports:
- "9092:9092"
environment:
BROKER_ID: 1
ZOOKEEPER_CONNECT: zookeeper:2181
KAFKA_LISTENERS: LISTENER_INNER://kafka:29092,LISTENER_OUTER://0.0.0.0:9092
KAFKA_ADVERTISED_LISTENERS: LISTENER_INNER://kafka:29092,LISTENER_OUTER://192.168.101.10:9092
KAFKA_LISTENER_SECURITY_PROTOCOL_MAP: LISTENER_INNER:PLAINTEXT,LISTENER_OUTER:PLAINTEXT
KAFKA_INTER_BROKER_LISTENER_NAME: LISTENER_INNER
KAFKA_ALLOW_PLAINTEXT_LISTENER: 'yes'
KAFKA_AUTO_CREATE_TOPICS_ENABLE: 'true'
depends_on:
- zookeeper

sentinel:
image: herodotus/sentinel-dashboard:1.8.7
container_name: sentinel-dashboard
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
import cn.herodotus.stirrup.core.identity.service.ClientDetailsService;
import cn.herodotus.stirrup.logic.identity.response.OAuth2DeviceVerificationResponseHandler;
import cn.herodotus.stirrup.oauth2.authentication.autoconfigure.customizer.OAuth2AuthorizationServerConfigurerCustomizer;
import cn.herodotus.stirrup.oauth2.authentication.autoconfigure.customizer.OAuth2ExceptionHandlingConfigurerCustomizer;
import cn.herodotus.stirrup.oauth2.authentication.autoconfigure.response.OidcClientRegistrationResponseHandler;
import cn.herodotus.stirrup.oauth2.authentication.configurer.OAuth2AuthenticationProviderConfigurer;
import cn.herodotus.stirrup.oauth2.authentication.customizer.OAuth2FormLoginConfigurerCustomizer;
Expand Down Expand Up @@ -123,6 +124,7 @@ public SecurityFilterChain authorizationServerSecurityFilterChain(
.formLogin(oauth2FormLoginConfigurerCustomizer)
.sessionManagement(oauth2sessionManagementConfigurerCustomer)
.addFilterBefore(new MultiTenantFilter(), AuthorizationFilter.class)
.exceptionHandling(new OAuth2ExceptionHandlingConfigurerCustomizer())
// 不配置 oauth2ResourceServer 就不会启用BearerTokenAuthenticationFilter
.oauth2ResourceServer(oauth2ResourceServerConfigurerCustomer)
.with(new OAuth2AuthenticationProviderConfigurer(sessionRegistry, passwordEncoder, userDetailsService, oauth2AuthenticationProperties), (configurer) -> {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ logging:
com.ulisesbocchio: error
# 开发、调试需要的日志
cn.herodotus: debug
org.springframework.security: info
org.springframework.security: trace
org.springframework.web: info
com.alicp.jetcache: trace
org.springframework.cloud.bus: info
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ logging:
org.apache.kafka: warn
grpc:
server:
port: 6070
port: 5070

---
# spring cloud tencent 基础设施配置
Expand Down

0 comments on commit fc623f3

Please sign in to comment.