##### Coverage Report - com.ctrip.framework.apollo.common.auth.WebSecurityConfig

Classes in this File | Line Coverage | Branch Coverage | Complexity
WebSecurityConfig |
0% | 0/8
N/A | N/A
| 1.0;1

1 |  |
     package com.ctrip.framework.apollo.common.auth;
2 |  |
3 |  |
     import org.springframework.beans.factory.annotation.Autowired;
4 |  |
     import org.springframework.context.annotation.Configuration;
5 |  |
     import org.springframework.security.config.annotation.authentication.builders.AuthenticationManagerBuilder;
6 |  |
     import org.springframework.security.config.annotation.method.configuration.EnableGlobalMethodSecurity;
7 |  |
     import org.springframework.security.config.annotation.web.builders.HttpSecurity;
8 |  |
     import org.springframework.security.config.annotation.web.configuration.EnableWebSecurity;
9 |  |
     import org.springframework.security.config.annotation.web.configuration.WebSecurityConfigurerAdapter;
10 |  |
11 |  |
     @Configuration
12 |  |
     @EnableWebSecurity
13 |  |
     @EnableGlobalMethodSecurity(prePostEnabled = true)
14 | 0 |
     public class WebSecurityConfig extends WebSecurityConfigurerAdapter {
15 |  |
16 |  |
       @Override
17 |  |
       protected void configure(HttpSecurity http) throws Exception {
18 | 0 |
         http.httpBasic();
19 | 0 |
         http.csrf().disable();
20 | 0 |
         http.headers().frameOptions().sameOrigin();
21 | 0 |
       }
22 |  |
23 |  |
       @Autowired
24 |  |
       public void configureGlobal(AuthenticationManagerBuilder auth) throws Exception {
25 | 0 |
         auth.inMemoryAuthentication().withUser("user").password("").roles("USER").and()
26 | 0 |
             .withUser("apollo").password("").roles("USER", "ADMIN");
27 | 0 |
       }
28 |  |
     }