metron-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From justinleet <...@git.apache.org>
Subject [GitHub] metron pull request #1281: METRON-1895: Add Knox SSO as an option in Metron
Date Mon, 03 Dec 2018 13:50:34 GMT
Github user justinleet commented on a diff in the pull request:

    https://github.com/apache/metron/pull/1281#discussion_r237926005
  
    --- Diff: metron-interface/metron-rest/src/main/java/org/apache/metron/rest/config/SwaggerConfig.java
---
    @@ -17,22 +17,66 @@
      */
     package org.apache.metron.rest.config;
     
    +import org.springframework.beans.factory.annotation.Autowired;
    +import org.springframework.beans.factory.annotation.Value;
     import org.springframework.context.annotation.Bean;
     import org.springframework.context.annotation.Configuration;
    +import org.springframework.core.env.Environment;
     import org.springframework.web.bind.annotation.RestController;
     import springfox.documentation.builders.PathSelectors;
     import springfox.documentation.builders.RequestHandlerSelectors;
     import springfox.documentation.spi.DocumentationType;
    +import springfox.documentation.spring.web.paths.RelativePathProvider;
     import springfox.documentation.spring.web.plugins.Docket;
     import springfox.documentation.swagger2.annotations.EnableSwagger2;
     
    +import javax.servlet.ServletContext;
    +import java.util.Arrays;
    +import java.util.List;
    +
    +import static org.apache.metron.rest.MetronRestConstants.KNOX_PROFILE;
    +
     @Configuration
     @EnableSwagger2
     public class SwaggerConfig {
    +
    +  @Value("${knox.root}")
    --- End diff --
    
    In the interest of sparking a software religious war, apparently Spring recommends not
using field injection for Beans.
    
    I know we do it in multiple places, so I'm not necessarily concerned about fixing it here,
but I am interested in your thoughts on that since you're way more familiar with Spring than
I am.


---

Mime
View raw message