springfox.documentation.service.ApiKey Java Examples

The following examples show how to use springfox.documentation.service.ApiKey. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: SwaggerConfiguration.java    From api-layer with Eclipse Public License 2.0 7 votes vote down vote up
@Bean
public Docket api() {
    return new Docket(DocumentationType.SWAGGER_2)
        .select()
        .apis(RequestHandlerSelectors.basePackage("org.zowe.apiml.apicatalog.controllers.api"))
        .paths(
            PathSelectors.any()
        )
        .build()
        .securitySchemes(
            Arrays.asList(
                new BasicAuth("LoginBasicAuth"),
                new ApiKey("CookieAuth", "apimlAuthenticationToken", "header")
            )
        )
        .apiInfo(
            new ApiInfo(
                apiTitle,
                apiDescription,
                apiVersion,
                null,
                null,
                null,
                null,
                Collections.emptyList()
            )
        );
}
 
Example #2
Source File: Swagger2Config.java    From HIS with Apache License 2.0 5 votes vote down vote up
private List<ApiKey> securitySchemes() {
    //设置请求头信息
    List<ApiKey> result = new ArrayList<>();
    ApiKey apiKey = new ApiKey("Authorization", "Authorization", "header");
    result.add(apiKey);
    return result;
}
 
Example #3
Source File: SwaggerConfig.java    From spring-boot-jwt with MIT License 5 votes vote down vote up
@Bean
public Docket api() {
  return new Docket(DocumentationType.SWAGGER_2)//
      .select()//
      .apis(RequestHandlerSelectors.any())//
      .paths(Predicates.not(PathSelectors.regex("/error")))//
      .build()//
      .apiInfo(metadata())//
      .useDefaultResponseMessages(false)//
      .securitySchemes(new ArrayList<>(Arrays.asList(new ApiKey("Bearer %token", "Authorization", "Header"))))//
      .tags(new Tag("users", "Operations about users"))//
      .tags(new Tag("ping", "Just a ping"))//
      .genericModelSubstitutes(Optional.class);

}
 
Example #4
Source File: Swagger2Config.java    From HIS with Apache License 2.0 5 votes vote down vote up
private List<ApiKey> securitySchemes() {
    //设置请求头信息
    List<ApiKey> result = new ArrayList<>();
    ApiKey apiKey = new ApiKey("Authorization", "Authorization", "header");
    result.add(apiKey);
    return result;
}
 
Example #5
Source File: Swagger2Config.java    From HIS with Apache License 2.0 5 votes vote down vote up
private List<ApiKey> securitySchemes() {
    //设置请求头信息
    List<ApiKey> result = new ArrayList<>();
    ApiKey apiKey = new ApiKey("Authorization", "Authorization", "header");
    result.add(apiKey);
    return result;
}
 
Example #6
Source File: Swagger2Config.java    From HIS with Apache License 2.0 5 votes vote down vote up
private List<ApiKey> securitySchemes() {
    //设置请求头信息
    List<ApiKey> result = new ArrayList<>();
    ApiKey apiKey = new ApiKey("Authorization", "Authorization", "header");
    result.add(apiKey);
    return result;
}
 
Example #7
Source File: Swagger2Config.java    From HIS with Apache License 2.0 5 votes vote down vote up
private List<ApiKey> securitySchemes() {
    //设置请求头信息
    List<ApiKey> result = new ArrayList<>();
    ApiKey apiKey = new ApiKey("Authorization", "Authorization", "header");
    result.add(apiKey);
    return result;
}
 
Example #8
Source File: Swagger2Config.java    From HIS with Apache License 2.0 5 votes vote down vote up
private List<ApiKey> securitySchemes() {
    //设置请求头信息
    List<ApiKey> result = new ArrayList<>();
    ApiKey apiKey = new ApiKey("Authorization", "Authorization", "header");
    result.add(apiKey);
    return result;
}
 
Example #9
Source File: SwaggerConfig.java    From RuoYi-Vue with MIT License 5 votes vote down vote up
/**
 * 安全模式,这里指定token通过Authorization头请求头传递
 */
private List<ApiKey> securitySchemes()
{
    List<ApiKey> apiKeyList = new ArrayList<ApiKey>();
    apiKeyList.add(new ApiKey("Authorization", "Authorization", "header"));
    return apiKeyList;
}
 
Example #10
Source File: Swagger2Config.java    From mall-tiny with Apache License 2.0 5 votes vote down vote up
private List<ApiKey> securitySchemes() {
    //设置请求头信息
    List<ApiKey> result = new ArrayList<>();
    ApiKey apiKey = new ApiKey("Authorization", "Authorization", "header");
    result.add(apiKey);
    return result;
}
 
Example #11
Source File: Swagger2Config.java    From BigDataPlatform with GNU General Public License v3.0 5 votes vote down vote up
private List<ApiKey> securitySchemes() {
    //设置请求头信息
    List<ApiKey> result = new ArrayList<>();
    ApiKey apiKey = new ApiKey("Authorization", "Authorization", "header");
    result.add(apiKey);
    return result;
}
 
Example #12
Source File: Swagger2Config.java    From HIS with Apache License 2.0 5 votes vote down vote up
private List<ApiKey> securitySchemes() {
    //设置请求头信息
    List<ApiKey> result = new ArrayList<>();
    ApiKey apiKey = new ApiKey("Authorization", "Authorization", "header");
    result.add(apiKey);
    return result;
}
 
Example #13
Source File: Swagger2Config.java    From HIS with Apache License 2.0 5 votes vote down vote up
private List<ApiKey> securitySchemes() {
    //设置请求头信息
    List<ApiKey> result = new ArrayList<>();
    ApiKey apiKey = new ApiKey("Authorization", "Authorization", "header");
    result.add(apiKey);
    return result;
}
 
Example #14
Source File: Swagger2Config.java    From HIS with Apache License 2.0 5 votes vote down vote up
private List<ApiKey> securitySchemes() {
    //设置请求头信息
    List<ApiKey> result = new ArrayList<>();
    ApiKey apiKey = new ApiKey("Authorization", "Authorization", "header");
    result.add(apiKey);
    return result;
}
 
Example #15
Source File: Swagger2Config.java    From HIS with Apache License 2.0 5 votes vote down vote up
private List<ApiKey> securitySchemes() {
    //设置请求头信息
    List<ApiKey> result = new ArrayList<>();
    ApiKey apiKey = new ApiKey("Authorization", "Authorization", "header");
    result.add(apiKey);
    return result;
}
 
Example #16
Source File: Swagger2Config.java    From mall-learning with Apache License 2.0 5 votes vote down vote up
private List<ApiKey> securitySchemes() {
    //设置请求头信息
    List<ApiKey> result = new ArrayList<>();
    ApiKey apiKey = new ApiKey("Authorization", "Authorization", "header");
    result.add(apiKey);
    return result;
}
 
Example #17
Source File: Swagger2Config.java    From mall-learning with Apache License 2.0 5 votes vote down vote up
private List<ApiKey> securitySchemes() {
    //设置请求头信息
    List<ApiKey> result = new ArrayList<>();
    ApiKey apiKey = new ApiKey("Authorization", "Authorization", "header");
    result.add(apiKey);
    return result;
}
 
Example #18
Source File: Swagger2Config.java    From mall-learning with Apache License 2.0 5 votes vote down vote up
private List<ApiKey> securitySchemes() {
    //设置请求头信息
    List<ApiKey> result = new ArrayList<>();
    ApiKey apiKey = new ApiKey("Authorization", "Authorization", "header");
    result.add(apiKey);
    return result;
}
 
Example #19
Source File: Swagger2Config.java    From mall-learning with Apache License 2.0 5 votes vote down vote up
private List<ApiKey> securitySchemes() {
    //设置请求头信息
    List<ApiKey> result = new ArrayList<>();
    ApiKey apiKey = new ApiKey("Authorization", "Authorization", "header");
    result.add(apiKey);
    return result;
}
 
Example #20
Source File: Swagger2Config.java    From mall-learning with Apache License 2.0 5 votes vote down vote up
private List<ApiKey> securitySchemes() {
    //设置请求头信息
    List<ApiKey> result = new ArrayList<>();
    ApiKey apiKey = new ApiKey("Authorization", "Authorization", "header");
    result.add(apiKey);
    return result;
}
 
Example #21
Source File: Swagger2Config.java    From mall-learning with Apache License 2.0 5 votes vote down vote up
private List<ApiKey> securitySchemes() {
    //设置请求头信息
    List<ApiKey> result = new ArrayList<>();
    ApiKey apiKey = new ApiKey("Authorization", "Authorization", "header");
    result.add(apiKey);
    return result;
}
 
Example #22
Source File: Swagger2Config.java    From mall-learning with Apache License 2.0 5 votes vote down vote up
private List<ApiKey> securitySchemes() {
    //设置请求头信息
    List<ApiKey> result = new ArrayList<>();
    ApiKey apiKey = new ApiKey("Authorization", "Authorization", "header");
    result.add(apiKey);
    return result;
}
 
Example #23
Source File: Swagger2Config.java    From mall-learning with Apache License 2.0 5 votes vote down vote up
private List<ApiKey> securitySchemes() {
    //设置请求头信息
    List<ApiKey> result = new ArrayList<>();
    ApiKey apiKey = new ApiKey("Authorization", "Authorization", "header");
    result.add(apiKey);
    return result;
}
 
Example #24
Source File: Swagger2Config.java    From mall-swarm with Apache License 2.0 5 votes vote down vote up
private List<ApiKey> securitySchemes() {
    //设置请求头信息
    List<ApiKey> result = new ArrayList<>();
    ApiKey apiKey = new ApiKey("Authorization", "Authorization", "header");
    result.add(apiKey);
    return result;
}
 
Example #25
Source File: Swagger2Config.java    From mall-swarm with Apache License 2.0 5 votes vote down vote up
private List<ApiKey> securitySchemes() {
    //设置请求头信息
    List<ApiKey> result = new ArrayList<>();
    ApiKey apiKey = new ApiKey("Authorization", "Authorization", "header");
    result.add(apiKey);
    return result;
}
 
Example #26
Source File: Swagger2Config.java    From mall-swarm with Apache License 2.0 5 votes vote down vote up
private List<ApiKey> securitySchemes() {
    //设置请求头信息
    List<ApiKey> result = new ArrayList<>();
    ApiKey apiKey = new ApiKey("Authorization", "Authorization", "header");
    result.add(apiKey);
    return result;
}
 
Example #27
Source File: Swagger2Config.java    From macrozheng with Apache License 2.0 5 votes vote down vote up
private List<ApiKey> securitySchemes() {
    //设置请求头信息
    List<ApiKey> result = new ArrayList<>();
    ApiKey apiKey = new ApiKey("Authorization", "Authorization", "header");
    result.add(apiKey);
    return result;
}
 
Example #28
Source File: SwaggerConfiguration.java    From heimdall with Apache License 2.0 5 votes vote down vote up
/**
* Returns a {@link Docket} with the Heimdall information.
*
* @return {@link Docket}
*/
   @Bean
   public Docket swaggerSpringFoxDocket() {

        Docket docket = new Docket(DocumentationType.SWAGGER_2)
                  .select()
                  .apis(RequestHandlerSelectors.basePackage("br.com.conductor.heimdall.api.resource"))
                  .paths(PathSelectors.any())
                  .build()
                  .apiInfo(apiInfo())
                  .securitySchemes(Collections.singletonList(new ApiKey("authorization", "authorization", "header")))
                  .securityContexts(Collections.singletonList(securityContext()));

        return docket;
   }
 
Example #29
Source File: Swagger2Config.java    From mall with Apache License 2.0 5 votes vote down vote up
private List<ApiKey> securitySchemes() {
    //设置请求头信息
    List<ApiKey> result = new ArrayList<>();
    ApiKey apiKey = new ApiKey("Authorization", "Authorization", "header");
    result.add(apiKey);
    return result;
}
 
Example #30
Source File: Swagger2Config.java    From mall with Apache License 2.0 5 votes vote down vote up
private List<ApiKey> securitySchemes() {
    //设置请求头信息
    List<ApiKey> result = new ArrayList<>();
    ApiKey apiKey = new ApiKey("Authorization", "Authorization", "header");
    result.add(apiKey);
    return result;
}