org.springframework.boot.actuate.autoconfigure.security.servlet.EndpointRequest#org.springframework.boot.autoconfigure.security.servlet.PathRequest源码实例Demo

下面列出了org.springframework.boot.actuate.autoconfigure.security.servlet.EndpointRequest#org.springframework.boot.autoconfigure.security.servlet.PathRequest 实例代码,或者点击链接到github查看源代码,也可以在右侧发表评论。

源代码1 项目: influx-proxy   文件: SecurityConfig.java
@Override
public void configure(WebSecurity web) throws Exception {
    List<String> ignore = Arrays.asList("/health", "/actuator/**");
    web.
            ignoring()
            .requestMatchers(PathRequest.toStaticResources().atCommonLocations())
            .antMatchers(ignore.toArray(new String[0]))
            .antMatchers("/api/**");
}
 
源代码2 项目: streaming-file-server   文件: SecurityConfig.java
@Override protected void configure(final HttpSecurity http) throws Exception {
  // @formatter:off
  http
      .authorizeRequests()
        /*
        .requestMatchers()
          .antMatchers("/actuator/health")
            .permitAll()
        */
        .requestMatchers(EndpointRequest.to("status", "info", "health"))
          .permitAll()
        .requestMatchers(PathRequest.toStaticResources().atCommonLocations())
          .permitAll()
        .anyRequest()
          .authenticated()
      .and()
        .formLogin()
          .disable()
      .headers()
        .frameOptions()
          .sameOrigin()
      .and()
        .csrf()
          .disable()
        .httpBasic()
      .and()
        .logout()
          .logoutUrl("/disconnect")
          .clearAuthentication(true)
          .invalidateHttpSession(true)
          .permitAll()
  ;
  // @formatter:on
}
 
源代码3 项目: POC   文件: WebSecurityConfig.java
@Override
protected void configure(HttpSecurity http) throws Exception {
	http.authorizeRequests().antMatchers(HttpMethod.GET, "/").permitAll()
			.requestMatchers(PathRequest.toStaticResources().atCommonLocations()).permitAll().antMatchers("/login")
			.permitAll().antMatchers("/signup").permitAll().antMatchers("/dashboard/**").hasAuthority("ADMIN")
			.anyRequest().authenticated().and().csrf().disable().formLogin()
			.successHandler(this.customizeAuthenticationSuccessHandler).loginPage("/login")
			.failureUrl("/login?error=true").usernameParameter("email").passwordParameter("password").and().logout()
			.logoutRequestMatcher(new AntPathRequestMatcher("/logout")).logoutSuccessUrl("/").and()
			.exceptionHandling();
}
 
源代码4 项目: POC   文件: SecurityConfig.java
@Override
protected void configure(HttpSecurity http) throws Exception {
	http.csrf().disable().authorizeRequests().requestMatchers(EndpointRequest.to("health", "info")).permitAll()
			.requestMatchers(EndpointRequest.toAnyEndpoint().excluding(MappingsEndpoint.class)).hasRole("ACTUATOR")
			.requestMatchers(PathRequest.toStaticResources().atCommonLocations()).permitAll()
			.antMatchers(HttpMethod.OPTIONS, "/**").permitAll().antMatchers(HttpMethod.GET, "/ping").permitAll()
			.antMatchers(HttpMethod.DELETE, "/**").hasRole("ADMIN").antMatchers("/**").hasRole("USER").and()
			.httpBasic();
	// H2 database console runs inside a frame, So we need to disable X-Frame-Options
	// in Spring Security.
	http.headers().frameOptions().disable();
}
 
源代码5 项目: spring-session   文件: WebSecurityConfig.java
@Override
protected void configure(HttpSecurity http) throws Exception {
	http
		.authorizeRequests((authorize) -> authorize
			.requestMatchers(PathRequest.toStaticResources().atCommonLocations()).permitAll()
			.anyRequest().authenticated()
		)
		.formLogin((formLogin) -> formLogin
			.permitAll()
		);
}
 
源代码6 项目: spring-session   文件: SecurityConfig.java
@Override
protected void configure(HttpSecurity http) throws Exception {
	http
		.authorizeRequests((authorize) -> authorize
			.requestMatchers(PathRequest.toStaticResources().atCommonLocations()).permitAll()
			.anyRequest().authenticated()
		)
		.formLogin((formLogin) -> formLogin
			.loginPage("/login")
			.permitAll()
		);
}
 
源代码7 项目: spring-session   文件: SecurityConfig.java
@Override
protected void configure(HttpSecurity http) throws Exception {
	http
		.authorizeRequests((authorize) -> authorize
			.requestMatchers(PathRequest.toStaticResources().atCommonLocations()).permitAll()
			.anyRequest().authenticated()
		)
		.formLogin((formLogin) -> formLogin
			.permitAll()
		);
}
 
源代码8 项目: spring-session   文件: SecurityConfig.java
@Override
protected void configure(HttpSecurity http) throws Exception {
	http
		.authorizeRequests((authorize) -> authorize
			.requestMatchers(PathRequest.toStaticResources().atCommonLocations()).permitAll()
			.anyRequest().authenticated()
		)
		.formLogin((formLogin) -> formLogin
			.loginPage("/login")
			.permitAll()
		);
}
 
源代码9 项目: spring-session   文件: SecurityConfig.java
@Override
protected void configure(HttpSecurity http) throws Exception {
	http
		.authorizeRequests((authorize) -> authorize
			.requestMatchers(PathRequest.toStaticResources().atCommonLocations()).permitAll()
			.anyRequest().authenticated()
		)
		.formLogin((formLogin) -> formLogin
			.permitAll()
		);
}
 
源代码10 项目: spring-session   文件: SecurityConfig.java
@Override
protected void configure(HttpSecurity http) throws Exception {
	http
		.authorizeRequests((authorize) -> authorize
			.requestMatchers(PathRequest.toStaticResources().atCommonLocations()).permitAll()
			.anyRequest().authenticated()
		)
		.formLogin((formLogin) -> formLogin
			.permitAll()
		);
}
 
源代码11 项目: spring-session   文件: WebSecurityConfig.java
@Override
public void configure(WebSecurity web) {
	web
		.ignoring().requestMatchers(PathRequest.toH2Console());
}
 
源代码12 项目: spring-session   文件: SecurityConfig.java
@Override
public void configure(WebSecurity web) {
	web
		.ignoring().requestMatchers(PathRequest.toH2Console());
}