##### Coverage Report - com.ctrip.apollo.common.controller.WebSecurityConfig

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

1 |  |
     package com.ctrip.apollo.common.controller;
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.web.builders.HttpSecurity;
7 |  |
     import org.springframework.security.config.annotation.web.configuration.EnableWebSecurity;
8 |  |
     import org.springframework.security.config.annotation.web.configuration.WebSecurityConfigurerAdapter;
9 |  |
10 |  |
     @Configuration
11 |  |
     @EnableWebSecurity
12 | 0 |
     public class WebSecurityConfig extends WebSecurityConfigurerAdapter {
13 |  |
14 |  |
       @Override
15 |  |
       protected void configure(HttpSecurity http) throws Exception {
16 | 0 |
         http.httpBasic();
17 | 0 |
         http.csrf().disable();
18 | 0 |
       }
19 |  |
20 |  |
       @Autowired
21 |  |
       public void configureGlobal(AuthenticationManagerBuilder auth) throws Exception {
22 | 0 |
         auth.inMemoryAuthentication().withUser("user").password("").roles("USER").and()
23 | 0 |
             .withUser("apollo").password("").roles("USER", "ADMIN");
24 | 0 |
       }
25 |  |
     }