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

高端网站建设费用预算苏州关键词优化软件

高端网站建设费用预算,苏州关键词优化软件,品牌网站建设公司哪家好,孟村县网站建设总的流程分为两部分&#xff0c;一是先用Map把configurer收集起来&#xff0c;然后再把maper中所有的configurer应用到HttpSecurity对象。 其中的map位于AbstractConfiguredSecurityBuilder这个类。 private final LinkedHashMap<Class<? extends SecurityConfigurer&l…

总的流程分为两部分,一是先用Map把configurer收集起来,然后再把maper中所有的configurer应用到HttpSecurity对象。

其中的map位于AbstractConfiguredSecurityBuilder这个类。

    private final LinkedHashMap<Class<? extends SecurityConfigurer<O, B>>, List<SecurityConfigurer<O, B>>> configurers;

configurer添加分为两部分,都通过WebSecurityConfigurerAdapter的init方法来实现,

    public void init(WebSecurity web) throws Exception {HttpSecurity http = this.getHttp();web.addSecurityFilterChainBuilder(http).postBuildAction(() -> {FilterSecurityInterceptor securityInterceptor = (FilterSecurityInterceptor)http.getSharedObject(FilterSecurityInterceptor.class);web.securityInterceptor(securityInterceptor);});}

其中init方法会调用的 protected final HttpSecurity getHttp() throws Exception方法:

    protected final HttpSecurity getHttp() throws Exception {if (this.http != null) {return this.http;} else {AuthenticationEventPublisher eventPublisher = this.getAuthenticationEventPublisher();this.localConfigureAuthenticationBldr.authenticationEventPublisher(eventPublisher);AuthenticationManager authenticationManager = this.authenticationManager();this.authenticationBuilder.parentAuthenticationManager(authenticationManager);Map<Class<?>, Object> sharedObjects = this.createSharedObjects();this.http = new HttpSecurity(this.objectPostProcessor, this.authenticationBuilder, sharedObjects);if (!this.disableDefaults) {//添加第一部分configurerthis.applyDefaultConfiguration(this.http);ClassLoader classLoader = this.context.getClassLoader();List<AbstractHttpConfigurer> defaultHttpConfigurers = SpringFactoriesLoader.loadFactories(AbstractHttpConfigurer.class, classLoader);Iterator var6 = defaultHttpConfigurers.iterator();while(var6.hasNext()) {AbstractHttpConfigurer configurer = (AbstractHttpConfigurer)var6.next();this.http.apply(configurer);}}//这句代码调用本类中的configure方法继续添加configurerthis.configure(this.http);return this.http;}}

该方法中执行了this.applyDefaultConfiguration(this.http),其代码为:

   private void applyDefaultConfiguration(HttpSecurity http) throws Exception {http.csrf();http.addFilter(new WebAsyncManagerIntegrationFilter());http.exceptionHandling();http.headers();http.sessionManagement();http.securityContext();http.requestCache();http.anonymous();http.servletApi();http.apply(new DefaultLoginPageConfigurer());http.logout();}

另一部分是通过WebSecurityConfigurerAdapter的config方法添加的configurer

    protected void configure(HttpSecurity http) throws Exception {this.logger.debug("Using default configure(HttpSecurity). If subclassed this will potentially override subclass configure(HttpSecurity).");http.authorizeRequests((requests) -> {((AuthorizedUrl)requests.anyRequest()).authenticated();});http.formLogin();http.httpBasic();}

至此,configurers填充完毕。
在这里插入图片描述

AbstractConfigedSecurityBuilder的private void configure() throws Exception
这个方法会遍历之前填充好的configurer,将其应用到HttpSecurity对象,也就是添加了Fliter

   private void configure() throws Exception {Collection<SecurityConfigurer<O, B>> configurers = this.getConfigurers();Iterator var2 = configurers.iterator();while(var2.hasNext()) {SecurityConfigurer<O, B> configurer = (SecurityConfigurer)var2.next();configurer.configure(this);}}

该方法的循环体执行完成后HttpSecurity对象就包含了15个过滤器。
在这里插入图片描述
以上是使用Spring Security5进行的分析。
Spring Security 6使用AuthorizationFilter取代了FilterSecurityInterceptor

http://www.ds6.com.cn/news/76955.html

相关文章:

  • flask api式网站开发快优吧seo优化
  • 做视频网站公司要怎么做网络营销服务平台
  • 正规的网站制作电话多少百度网站排名优化
  • 现在哪些做进口商品的电商网站关键词首页排名优化
  • 网站修改报价线上推广方式
  • 顶级复刻手表网站最新app推广
  • 阿里云服务器wordpress建站教程百度一下百度下载
  • 重庆人才招聘网官网廊坊首页霸屏优化
  • icp备案查询网站完整的社群营销方案
  • 交友最好的网站建设长沙seo报价
  • 安全联盟网站认证宁波seo外包推广平台
  • 广州网站优化平台南京今日新闻头条
  • 移动端web网站企业网搭建
  • 哈尔滨城乡建设厅网站官方网站怎么查询
  • 广州建设公司平台seo百度网站排名软件
  • 做购物网站哪家公司好中国搜索引擎排行榜
  • 宜昌企业网站建设学大教育培训机构电话
  • 房产门户网站建设黑科技引流工具
  • wordpress.enseo和sem的区别是什么?
  • 网站图片规格web网页模板
  • 做景观设施的网站怎么建一个自己的网站
  • 城乡建设厅官方网站办事大厅手机百度如何发布广告
  • 网站设计电商首页百度的网址
  • 安阳市网络公司济南seo公司
  • 苹果网站上物体阴影怎么做的网络优化器下载
  • 网站宣传海报图片最近新闻摘抄50字
  • 天津网站建设推广网推放单平台
  • 工程公司税率是多少落实20条优化措施
  • 故宫上海网络营销公司深圳网站营销seo电话
  • 淮安网站建设哪家好免费b站推广网站