cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From r...@apache.org
Subject [09/30] cxf git commit: [CXF-7137] Adding a Map of SecuritySchemeDefinitions property
Date Sun, 04 Dec 2016 01:11:51 GMT
[CXF-7137] Adding a Map of SecuritySchemeDefinitions property


Project: http://git-wip-us.apache.org/repos/asf/cxf/repo
Commit: http://git-wip-us.apache.org/repos/asf/cxf/commit/f4252d0f
Tree: http://git-wip-us.apache.org/repos/asf/cxf/tree/f4252d0f
Diff: http://git-wip-us.apache.org/repos/asf/cxf/diff/f4252d0f

Branch: refs/heads/CXF-6882.nio
Commit: f4252d0f7e66ec30bd3543edcd356697622b07e5
Parents: 2ac4094
Author: Sergey Beryozkin <sberyozkin@gmail.com>
Authored: Mon Nov 28 11:08:53 2016 +0000
Committer: Sergey Beryozkin <sberyozkin@gmail.com>
Committed: Mon Nov 28 11:08:53 2016 +0000

----------------------------------------------------------------------
 .../org/apache/cxf/jaxrs/swagger/Swagger2Feature.java  | 13 +++++++++++++
 1 file changed, 13 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cxf/blob/f4252d0f/rt/rs/description-swagger/src/main/java/org/apache/cxf/jaxrs/swagger/Swagger2Feature.java
----------------------------------------------------------------------
diff --git a/rt/rs/description-swagger/src/main/java/org/apache/cxf/jaxrs/swagger/Swagger2Feature.java
b/rt/rs/description-swagger/src/main/java/org/apache/cxf/jaxrs/swagger/Swagger2Feature.java
index b417927..7dbda71 100644
--- a/rt/rs/description-swagger/src/main/java/org/apache/cxf/jaxrs/swagger/Swagger2Feature.java
+++ b/rt/rs/description-swagger/src/main/java/org/apache/cxf/jaxrs/swagger/Swagger2Feature.java
@@ -69,6 +69,8 @@ import io.swagger.jaxrs.config.DefaultReaderConfig;
 import io.swagger.jaxrs.config.ReaderConfig;
 import io.swagger.jaxrs.config.SwaggerContextService;
 import io.swagger.jaxrs.listing.ApiListingResource;
+import io.swagger.models.Swagger;
+import io.swagger.models.auth.SecuritySchemeDefinition;
 
 @Provider(value = Type.Feature, scope = Scope.Server)
 public class Swagger2Feature extends AbstractSwaggerFeature {
@@ -94,6 +96,8 @@ public class Swagger2Feature extends AbstractSwaggerFeature {
     
     private boolean dynamicBasePath;
     
+    private Map<String, SecuritySchemeDefinition> securityDefinitions;
+    
     @Override
     protected void calculateDefaultBasePath(Server server) {
         dynamicBasePath = true;
@@ -191,6 +195,11 @@ public class Swagger2Feature extends AbstractSwaggerFeature {
         beanConfig.setPrettyPrint(isPrettyPrint());
         beanConfig.setFilterClass(getFilterClass());
         
+        Swagger swagger = beanConfig.getSwagger();
+        if (swagger != null && securityDefinitions != null) {
+            swagger.setSecurityDefinitions(securityDefinitions);
+        }
+        
         swagger2Serializers.setBeanConfig(beanConfig);
     }
 
@@ -270,6 +279,10 @@ public class Swagger2Feature extends AbstractSwaggerFeature {
         this.swaggerUiMediaTypes = swaggerUiMediaTypes;
     }
 
+    public void setSecurityDefinitions(Map<String, SecuritySchemeDefinition> securityDefinitions)
{
+        this.securityDefinitions = securityDefinitions;
+    }
+
     private class ServletConfigProvider implements ContextProvider<ServletConfig> {
 
         @Override


Mime
View raw message