3
私はSpring Boot(1.4.2v)でswagger-uiでspringfox(2.6.1v)を使用します。spring-securityの背後にあるspringfox swagger-uiにアクセスする
はそのための構成が見えます:
@Configuration
@EnableSwagger2
public class SwaggerConfig {
@Bean
public Docket api() {
return new Docket(DocumentationType.SWAGGER_2)
.select()
.apis(RequestHandlerSelectors.any())
.paths(PathSelectors.any())
.build()
.genericModelSubstitutes(ResponseEntity.class);
}
}
問題は、私の闊歩は春のセキュリティの背後にあるということであると私は管理者によってそこにアクセスを許可する必要があります。
質問アプリケーション内でswagger-uiを動作させるには、どのようなマッチャーが必要ですか?
public class SecurityConfig extends WebSecurityConfigurerAdapter {
@Override
protected void configure(HttpSecurity http) throws Exception {
http.authorizeRequests()
.antMatchers("??? <<<what_should_be_here>>> ???") // what should be here?
.hasRole("TENANT_ADMIN");
}
}