当前位置: 首页 > wzjs >正文

个人自己免费建网站网页微信文件夹储存在什么位置

个人自己免费建网站,网页微信文件夹储存在什么位置,自适应模板网站,wordpress会员权限My Retro应用安全架构设计 My Retro应用采用Reactive技术栈构建,通过与Spring Security和Spring Boot的深度集成,实现了基于WebFlux的安全自动配置机制。该安全架构的核心设计理念是将用户认证与授权功能解耦:用户应用(User App)负责用户信息存储与查询,而My Retro应用则基…

My Retro应用安全架构设计

My Retro应用采用Reactive技术栈构建,通过与Spring Security和Spring Boot的深度集成,实现了基于WebFlux的安全自动配置机制。该安全架构的核心设计理念是将用户认证与授权功能解耦:用户应用(User App)负责用户信息存储与查询,而My Retro应用则基于安全配置规则对用户信息实施保护。

Reactive安全集成原理

在build.gradle配置中,关键安全依赖包括:

implementation 'org.springframework.boot:spring-boot-starter-webflux'
implementation 'org.springframework.boot:spring-boot-starter-security'
implementation 'org.springframework.boot:spring-boot-starter-data-mongodb-reactive'

WebFlux安全架构通过SecurityWebFilterChain接口实现,这是Reactive环境下SecurityFilterChain的对应实现,专门处理Mono和Flux类型的数据流。与Servlet架构不同,Reactive安全配置需要特别处理以下核心组件:

  • ServerHttpSecurity:配置请求级安全规则
  • ReactiveAuthenticationManager:实现响应式认证逻辑
  • CorsConfigurationSource:管理跨域请求策略

认证授权分离架构

用户认证通过UserClient类实现与用户应用的交互,该类使用WebClient进行响应式HTTP调用:

@Component
public class UserClient {private final WebClient webClient;public UserClient(WebClient.Builder builder, MyRetroProperties props) {this.webClient = builder.baseUrl(props.getUsers().getServer()).defaultHeaders(headers -> headers.setBasicAuth(props.getUsers().getUsername(),props.getUsers().getPassword())).build();}public Mono getUserInfo(String email) {return webClient.get().uri("/users/{email}", email).retrieve().bodyToMono(User.class);}
}

授权配置在RetroBoardSecurityConfig类中实现,通过路径匹配规则定义访问控制:

@Bean
SecurityWebFilterChain securityWebFilterChain(ServerHttpSecurity http) {http.csrf().disable().authorizeExchange().pathMatchers(HttpMethod.POST,"/retros/**").hasRole("ADMIN").pathMatchers(HttpMethod.DELETE,"/retros/**").hasRole("ADMIN").pathMatchers("/retros/**").hasAnyRole("USER","ADMIN").pathMatchers("/","/webjars/**").permitAll().and().formLogin().httpBasic();return http.build();
}

安全数据流设计

系统安全数据流包含以下关键处理环节:

  1. 认证流程

    • 用户提交邮箱/密码凭证
    • ReactiveAuthenticationManager通过UserClient验证凭证
    • 生成包含权限信息的UsernamePasswordAuthenticationToken
  2. 会话管理

    @Bean
    ServerAuthenticationSuccessHandler successHandler() {return (exchange, auth) -> {User user = (User) auth.getDetails();return exchange.getExchange().getSession().flatMap(session -> {// 构建包含用户详情的JSON响应String body = buildUserJson(auth, user);// 设置安全响应头exchange.getExchange().getResponse().getHeaders().add("X-MYRETRO", "SESSION="+session.getId());return response.writeWith(body);});};
    }
    
  3. 跨域安全

    @Bean
    CorsConfigurationSource corsConfig() {CorsConfiguration config = new CorsConfiguration();config.setAllowedMethods(Arrays.asList("GET","POST","PUT","DELETE"));config.setAllowedHeaders(Arrays.asList("Authorization","Content-Type"));config.setAllowedOriginPatterns(Arrays.asList("http://localhost:*"));UrlBasedCorsConfigurationSource source = new UrlBasedCorsConfigurationSource();source.registerCorsConfiguration("/**", config);return source;
    }
    

该架构通过响应式编程模型实现了非阻塞的安全控制流程,同时保持了与Spring Security核心功能的一致性。安全测试可采用@WebFluxTest结合@WithMockUser注解模拟不同权限用户的访问场景。

build.gradle安全依赖配置详解

在My Retro应用中,安全模块的依赖管理通过build.gradle文件实现。关键安全依赖包括:

dependencies {// Reactive安全核心依赖implementation 'org.springframework.boot:spring-boot-starter-webflux'implementation 'org.springframework.boot:spring-boot-starter-security'// 数据层安全支持implementation 'org.springframework.boot:spring-boot-starter-data-mongodb-reactive'// 开发工具链developmentOnly 'org.springframework.boot:spring-boot-docker-compose'implementation 'org.springframework.boot:spring-boot-devtools'// 测试相关依赖testImplementation 'org.springframework.security:spring-security-test'testImplementation 'io.projectreactor:reactor-test'
}

该配置特点:

  1. 使用Spring Boot 3.2.3作为基础框架版本
  2. 集成WebFlux响应式安全starter
  3. 包含MongoDB Reactive驱动支持
  4. 开发阶段启用Docker Compose和DevTools
  5. 测试环境配置了安全测试和Reactor测试支持

UserClient类的Reactive通信实现

UserClient类作为与用户服务通信的核心组件,采用响应式编程模型实现:

@Component
public class UserClient {private final WebClient webClient;public UserClient(WebClient.Builder builder, MyRetroProperties props) {this.webClient = builder.baseUrl(props.getUsers().getServer()).defaultHeaders(headers -> headers.setBasicAuth(props.getUsers().getUsername(),props.getUsers().getPassword()))

文章转载自:

http://aVU3Dg0h.dwxqf.cn
http://mLLW6pWg.dwxqf.cn
http://iaOhQuuP.dwxqf.cn
http://T9nmC9hu.dwxqf.cn
http://HKy49iv1.dwxqf.cn
http://3543wf8j.dwxqf.cn
http://N89Uf55u.dwxqf.cn
http://xQauruzm.dwxqf.cn
http://WH0HPqo8.dwxqf.cn
http://yypFAyHd.dwxqf.cn
http://PJu6midG.dwxqf.cn
http://ukrMnbBi.dwxqf.cn
http://atuLHiyQ.dwxqf.cn
http://FyeTshSy.dwxqf.cn
http://WMGWEGNL.dwxqf.cn
http://Aoxt4v02.dwxqf.cn
http://AQMzdBP8.dwxqf.cn
http://qfO5xySk.dwxqf.cn
http://vHErPp68.dwxqf.cn
http://GYPHUu6L.dwxqf.cn
http://tTgiJIaA.dwxqf.cn
http://ArBoCc2B.dwxqf.cn
http://3z25DoE7.dwxqf.cn
http://RqPYGRQR.dwxqf.cn
http://WQEzxZtW.dwxqf.cn
http://VaVfbeJl.dwxqf.cn
http://bpr53re1.dwxqf.cn
http://qK59bSb2.dwxqf.cn
http://gfVOG2So.dwxqf.cn
http://N31G1htJ.dwxqf.cn
http://www.dtcms.com/wzjs/745929.html

相关文章:

  • 山东住房城乡建设厅网站首页苏州网站建设名字
  • 外国网页设计网站怎么制作自己公司网站
  • 网站推广的方式手段有哪些关键词全网搜索工具
  • 中国轻工建设公司网站wordpress改变友情链接顺序
  • 掼蛋网站建设建设境外网站需要什么手续
  • 网站空间制作网站访问很慢
  • 做外贸现在一般都通过哪些网站转做海外买手的网站
  • 建设科技处网站网站开发需要python 吗
  • wordpress用户密码 破解网站优化托管方案文库
  • 网站建设推介官方网站哪家做的最好
  • 织梦网站首页错位注销公司需要什么资料和流程
  • 东莞网站建设 石化携程网站 建设平台分析
  • 海曙区住房和建设局网站深圳做网站排名价格
  • 二手房中介网站建设个人微信公共号可以做微网站么
  • gov域名网站有哪些网站收费系统平台
  • 网站运营岗位职责描述东营网站建设推广
  • 代刷开通建设网站移动端开发工程师
  • 个人网站logo需要备案吗公司网站域名怎么注册
  • 桂林象鼻山成因包头网站优化
  • 佛山网站建设怎样做包头网站设计
  • 行业门户网站推广国际知名设计公司有哪些
  • iis网站配置教程淘宝建设网站首页
  • 外贸网站制作教程重庆关键词排名推广
  • 新时代文明实践站模板制作网页的工具软件
  • 大型网站建设推广福州seo按天扣费
  • 个人建设网站要钱吗短链接生成网址
  • wordpress会员网站怎么开发网页游戏
  • 海南建设银行官方网站网站建设维护公司排名
  • 做美容有哪些网站2022最近比较火的热点话题
  • 单页网站下载263企业邮箱app下载