Skip to content

Commit

Permalink
Update swagger-ui
Browse files Browse the repository at this point in the history
fixes #2012
  • Loading branch information
dilipkrish committed Aug 4, 2019
1 parent e4378b8 commit ff44cd3
Show file tree
Hide file tree
Showing 3 changed files with 52 additions and 28 deletions.
Expand Up @@ -68,21 +68,27 @@ public class SecurityConfiguration {
* @deprecated @since 2.8.0. Use the {@link SecurityConfigurationBuilder} instead
*/
private SecurityConfiguration() {
this(null, null, null, null, null, ApiKeyVehicle.HEADER, "api_key", ",");
this(
null,
null,
null,
null,
null,
ApiKeyVehicle.HEADER,
"api_key",
",");
}

/**
*
* @deprecated @since 2.8.0. Use the {@link SecurityConfigurationBuilder} instead
*
* @param clientId - client id
* @param clientSecret - client secret
* @param realm - realm
* @param appName - application name
* @param apiKey - api key
* @param apiKeyVehicle - how the api key is transmitted
* @param apiKeyName - name of the api key
* @param clientId - client id
* @param clientSecret - client secret
* @param realm - realm
* @param appName - application name
* @param apiKey - api key
* @param apiKeyVehicle - how the api key is transmitted
* @param apiKeyName - name of the api key
* @param scopeSeparator - scope separator
* @deprecated @since 2.8.0. Use the {@link SecurityConfigurationBuilder} instead
*/
@Deprecated
@SuppressWarnings("ParameterNumber")
Expand Down Expand Up @@ -123,11 +129,12 @@ public SecurityConfiguration(
* tokenUrl.
* @param useBasicAuthenticationWithAccessCodeGrant Only activated for the accessCode flow. During the
* authorization_code request to the tokenUrl, pass the Client
* Password using the HTTP Basic Authentication scheme (Authorization
* header with Basic base64encoded[client_id:client_secret]). The
* default is false.
* Password using the HTTP Basic Authentication scheme
* (Authorization header with Basic
* base64encoded[client_id:client_secret]). The default is false.
* @param enableCsrfSupport Enable csrf support, default is false.
*/
@SuppressWarnings("ParameterNumber")
public SecurityConfiguration(
String clientId,
String clientSecret,
Expand All @@ -148,8 +155,8 @@ public SecurityConfiguration(
}

/**
* @deprecated @since 2.8.0
* @return apiKey
* @deprecated @since 2.8.0
*/
@Deprecated
@JsonProperty("apiKey")
Expand All @@ -158,8 +165,8 @@ public String getApiKey() {
}

/**
* @deprecated @since 2.8.0
* @return apiKeyName
* @deprecated @since 2.8.0
*/
@Deprecated
@JsonProperty("apiKeyName")
Expand All @@ -168,8 +175,8 @@ public String getApiKeyName() {
}

/**
* @deprecated @since 2.8.0
* @return apiKeyVehicle - header, cookie etc.
* @deprecated @since 2.8.0
*/
@Deprecated
@JsonProperty("apiKeyVehicle")
Expand Down
Expand Up @@ -20,7 +20,7 @@

import java.util.Map;

import static springfox.documentation.builders.BuilderDefaults.defaultIfAbsent;
import static springfox.documentation.builders.BuilderDefaults.*;

public class SecurityConfigurationBuilder {

Expand All @@ -45,14 +45,30 @@ public static SecurityConfigurationBuilder builder() {

public SecurityConfiguration build() {
return new SecurityConfiguration(
defaultIfAbsent(clientId, null),
defaultIfAbsent(clientSecret, null),
defaultIfAbsent(realm, null),
defaultIfAbsent(appName, null),
defaultIfAbsent(scopeSeparator, null),
defaultIfAbsent(additionalQueryStringParams, null),
defaultIfAbsent(useBasicAuthenticationWithAccessCodeGrant, null),
defaultIfAbsent(enableCsrfSupport, null)
defaultIfAbsent(
clientId,
null),
defaultIfAbsent(
clientSecret,
null),
defaultIfAbsent(
realm,
null),
defaultIfAbsent(
appName,
null),
defaultIfAbsent(
scopeSeparator,
null),
defaultIfAbsent(
additionalQueryStringParams,
null),
defaultIfAbsent(
useBasicAuthenticationWithAccessCodeGrant,
null),
defaultIfAbsent(
enableCsrfSupport,
null)
);
}

Expand Down Expand Up @@ -126,7 +142,8 @@ public SecurityConfigurationBuilder useBasicAuthenticationWithAccessCodeGrant(
}

/**
* @param enableCsrfSupport Try to find csrf token and add it to the header of all requests by patching the requestInterceptor.
* @param enableCsrfSupport Try to find csrf token and add it to the header of all requests
* by patching the requestInterceptor.
* @return this
*/
public SecurityConfigurationBuilder enableCsrfSupport(Boolean enableCsrfSupport) {
Expand Down
2 changes: 1 addition & 1 deletion springfox-swagger-ui/build.gradle
Expand Up @@ -29,7 +29,7 @@ plugins {
}

ext {
swaggerUiVersion = '3.20.9'
swaggerUiVersion = '3.23.4'
swaggerUiDist = "build/libs/swagger-ui-dist.zip"
swaggerUiExplodedDir = "swagger-ui-${swaggerUiVersion}/dist/"
downloadUrl = "https://github.com/swagger-api/swagger-ui/archive/v${swaggerUiVersion}.zip"
Expand Down

0 comments on commit ff44cd3

Please sign in to comment.