forked from loafle/openapi-generator-original
Fix compile error in client properties configuration (#18232)
* Fix config * Add tests * Remove unused import * Sort imports * Add new workflow
This commit is contained in:
parent
6690b9f87d
commit
309918d03e
1
.github/workflows/samples-spring.yaml
vendored
1
.github/workflows/samples-spring.yaml
vendored
@ -34,6 +34,7 @@ jobs:
|
||||
- samples/openapi3/client/petstore/spring-cloud-async
|
||||
- samples/openapi3/client/petstore/spring-cloud-spring-pageable
|
||||
- samples/client/petstore/spring-cloud-tags
|
||||
- samples/client/petstore/spring-cloud-auth
|
||||
- samples/client/petstore/spring-cloud-deprecated
|
||||
# servers
|
||||
- samples/server/petstore/springboot
|
||||
|
9
bin/configs/spring-cloud-auth.yaml
Normal file
9
bin/configs/spring-cloud-auth.yaml
Normal file
@ -0,0 +1,9 @@
|
||||
generatorName: spring
|
||||
outputDir: samples/client/petstore/spring-cloud-auth
|
||||
library: spring-cloud
|
||||
inputSpec: modules/openapi-generator/src/test/resources/3_0/spring/petstore-auth.yaml
|
||||
templateDir: modules/openapi-generator/src/main/resources/JavaSpring
|
||||
additionalProperties:
|
||||
documentationProvider: none
|
||||
artifactId: petstore-spring-cloud-auth
|
||||
hideGenerationTimestamp: "true"
|
@ -43,6 +43,8 @@ public class CodegenSecurity {
|
||||
// Oauth specific
|
||||
public String flow, authorizationUrl, tokenUrl, refreshUrl;
|
||||
public List<Map<String, Object>> scopes;
|
||||
public Boolean hasScopes;
|
||||
|
||||
public Boolean isCode, isPassword, isApplication, isImplicit;
|
||||
// OpenId specific
|
||||
public String openIdConnectUrl;
|
||||
|
@ -6940,6 +6940,7 @@ public class DefaultCodegen implements CodegenConfig {
|
||||
scopes.add(scope);
|
||||
}
|
||||
codegenSecurity.scopes = scopes;
|
||||
codegenSecurity.hasScopes = true;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1,7 +1,6 @@
|
||||
package {{configPackage}};
|
||||
|
||||
{{#authMethods}}
|
||||
{{#isOAuth}}
|
||||
|
||||
import java.util.Properties;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
import org.springframework.core.env.ConfigurableEnvironment;
|
||||
@ -11,31 +10,34 @@ import org.springframework.core.env.PropertiesPropertySource;
|
||||
public class ClientPropertiesConfiguration {
|
||||
|
||||
public ClientPropertiesConfiguration( final ConfigurableEnvironment configurableEnvironment ) {
|
||||
final Properties properties = new Properties();
|
||||
properties.put("spring.security.oauth2.client.registration.{{{name}}}{{#lambda.pascalcase}}{{{flow}}}{{/lambda.pascalcase}}.client-id", "set-{{{name}}}{{#lambda.pascalcase}}{{{flow}}}{{/lambda.pascalcase}}-client-id" );
|
||||
properties.put("{{#scopes}}{{#-first}}spring.security.oauth2.client.registration.{{{name}}}{{#lambda.pascalcase}}{{{flow}}}{{/lambda.pascalcase}}.scope", "{{/-first}}{{scope}}{{^-last}},{{/-last}}{{/scopes}}" );
|
||||
{{#authMethods}}
|
||||
{{#isOAuth}}
|
||||
final Properties {{{name}}}{{#lambda.pascalcase}}{{{flow}}}{{/lambda.pascalcase}} = new Properties();
|
||||
{{{name}}}{{#lambda.pascalcase}}{{{flow}}}{{/lambda.pascalcase}}.put("spring.security.oauth2.client.registration.{{{name}}}{{#lambda.pascalcase}}{{{flow}}}{{/lambda.pascalcase}}.client-id", "set-{{{name}}}{{#lambda.pascalcase}}{{{flow}}}{{/lambda.pascalcase}}-client-id" );
|
||||
{{#hasScopes}}
|
||||
{{{name}}}{{#lambda.pascalcase}}{{{flow}}}{{/lambda.pascalcase}}.put("{{#scopes}}{{#-first}}spring.security.oauth2.client.registration.{{{name}}}{{#lambda.pascalcase}}{{{flow}}}{{/lambda.pascalcase}}.scope", "{{/-first}}{{scope}}{{^-last}},{{/-last}}{{/scopes}}" );
|
||||
{{/hasScopes}}
|
||||
{{#isCode}}
|
||||
properties.put("spring.security.oauth2.client.registration.{{{name}}}{{#lambda.pascalcase}}{{{flow}}}{{/lambda.pascalcase}}.authorization-grant-type", "authorization_code" );
|
||||
properties.put("spring.security.oauth2.client.registration.{{{name}}}{{#lambda.pascalcase}}{{{flow}}}{{/lambda.pascalcase}}.redirect-uri", "set-{{{name}}}{{#lambda.pascalcase}}{{{flow}}}{{/lambda.pascalcase}}-redirect-uri" );
|
||||
properties.put("spring.security.oauth2.client.provider.{{{name}}}{{#lambda.pascalcase}}{{{flow}}}{{/lambda.pascalcase}}.token-uri", "{{{tokenUrl}}}" );
|
||||
properties.put("spring.security.oauth2.client.provider.{{{name}}}{{#lambda.pascalcase}}{{{flow}}}{{/lambda.pascalcase}}.authorization-uri", "{{{authorizationUrl}}}" );
|
||||
{{{name}}}{{#lambda.pascalcase}}{{{flow}}}{{/lambda.pascalcase}}.put("spring.security.oauth2.client.registration.{{{name}}}{{#lambda.pascalcase}}{{{flow}}}{{/lambda.pascalcase}}.authorization-grant-type", "authorization_code" );
|
||||
{{{name}}}{{#lambda.pascalcase}}{{{flow}}}{{/lambda.pascalcase}}.put("spring.security.oauth2.client.registration.{{{name}}}{{#lambda.pascalcase}}{{{flow}}}{{/lambda.pascalcase}}.redirect-uri", "set-{{{name}}}{{#lambda.pascalcase}}{{{flow}}}{{/lambda.pascalcase}}-redirect-uri" );
|
||||
{{{name}}}{{#lambda.pascalcase}}{{{flow}}}{{/lambda.pascalcase}}.put("spring.security.oauth2.client.provider.{{{name}}}{{#lambda.pascalcase}}{{{flow}}}{{/lambda.pascalcase}}.token-uri", "{{{tokenUrl}}}" );
|
||||
{{{name}}}{{#lambda.pascalcase}}{{{flow}}}{{/lambda.pascalcase}}.put("spring.security.oauth2.client.provider.{{{name}}}{{#lambda.pascalcase}}{{{flow}}}{{/lambda.pascalcase}}.authorization-uri", "{{{authorizationUrl}}}" );
|
||||
{{/isCode}}
|
||||
{{#isPassword}}
|
||||
properties.put("spring.security.oauth2.client.registration.{{{name}}}{{#lambda.pascalcase}}{{{flow}}}{{/lambda.pascalcase}}.authorization-grant-type", "password" );
|
||||
properties.put("spring.security.oauth2.client.provider.{{{name}}}{{#lambda.pascalcase}}{{{flow}}}{{/lambda.pascalcase}}.token-uri", "{{{tokenUrl}}}" );
|
||||
{{{name}}}{{#lambda.pascalcase}}{{{flow}}}{{/lambda.pascalcase}}.put("spring.security.oauth2.client.registration.{{{name}}}{{#lambda.pascalcase}}{{{flow}}}{{/lambda.pascalcase}}.authorization-grant-type", "password" );
|
||||
{{{name}}}{{#lambda.pascalcase}}{{{flow}}}{{/lambda.pascalcase}}.put("spring.security.oauth2.client.provider.{{{name}}}{{#lambda.pascalcase}}{{{flow}}}{{/lambda.pascalcase}}.token-uri", "{{{tokenUrl}}}" );
|
||||
{{/isPassword}}
|
||||
{{#isApplication}}
|
||||
properties.put("spring.security.oauth2.client.registration.{{{name}}}{{#lambda.pascalcase}}{{{flow}}}{{/lambda.pascalcase}}.authorization-grant-type", "client_credentials" );
|
||||
properties.put("spring.security.oauth2.client.provider.{{{name}}}{{#lambda.pascalcase}}{{{flow}}}{{/lambda.pascalcase}}.token-uri", "{{{tokenUrl}}}" );
|
||||
{{{name}}}{{#lambda.pascalcase}}{{{flow}}}{{/lambda.pascalcase}}.put("spring.security.oauth2.client.registration.{{{name}}}{{#lambda.pascalcase}}{{{flow}}}{{/lambda.pascalcase}}.authorization-grant-type", "client_credentials" );
|
||||
{{{name}}}{{#lambda.pascalcase}}{{{flow}}}{{/lambda.pascalcase}}.put("spring.security.oauth2.client.provider.{{{name}}}{{#lambda.pascalcase}}{{{flow}}}{{/lambda.pascalcase}}.token-uri", "{{{tokenUrl}}}" );
|
||||
{{/isApplication}}
|
||||
{{#isImplicit}}
|
||||
properties.put("spring.security.oauth2.client.registration.{{{name}}}{{#lambda.pascalcase}}{{{flow}}}{{/lambda.pascalcase}}.authorization-grant-type", "implicit" );
|
||||
properties.put("spring.security.oauth2.client.provider.{{{name}}}{{#lambda.pascalcase}}{{{flow}}}{{/lambda.pascalcase}}.authorization-uri", "{{{authorizationUrl}}}" );
|
||||
{{{name}}}{{#lambda.pascalcase}}{{{flow}}}{{/lambda.pascalcase}}.put("spring.security.oauth2.client.registration.{{{name}}}{{#lambda.pascalcase}}{{{flow}}}{{/lambda.pascalcase}}.authorization-grant-type", "implicit" );
|
||||
{{{name}}}{{#lambda.pascalcase}}{{{flow}}}{{/lambda.pascalcase}}.put("spring.security.oauth2.client.provider.{{{name}}}{{#lambda.pascalcase}}{{{flow}}}{{/lambda.pascalcase}}.authorization-uri", "{{{authorizationUrl}}}" );
|
||||
{{/isImplicit}}
|
||||
final PropertiesPropertySource propertiesPropertySource = new PropertiesPropertySource("{{{name}}}{{#lambda.pascalcase}}{{{flow}}}{{/lambda.pascalcase}}", properties );
|
||||
configurableEnvironment.getPropertySources().addLast( propertiesPropertySource );
|
||||
configurableEnvironment.getPropertySources().addLast( new PropertiesPropertySource("{{{name}}}{{#lambda.pascalcase}}{{{flow}}}{{/lambda.pascalcase}}", {{{name}}}{{#lambda.pascalcase}}{{{flow}}}{{/lambda.pascalcase}} ) );
|
||||
{{/isOAuth}}
|
||||
{{/authMethods}}
|
||||
}
|
||||
|
||||
}
|
||||
{{/isOAuth}}
|
||||
{{/authMethods}}
|
||||
|
@ -57,7 +57,6 @@ import java.util.Map;
|
||||
import java.util.function.Consumer;
|
||||
import java.util.function.Function;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.assertj.core.api.MapAssert;
|
||||
import org.openapitools.codegen.CliOption;
|
||||
@ -1198,7 +1197,7 @@ public class SpringCodegenTest {
|
||||
output.deleteOnExit();
|
||||
|
||||
OpenAPI openAPI = new OpenAPIParser()
|
||||
.readLocation("src/test/resources/3_0/issue_18090.yaml", null, new ParseOptions()).getOpenAPI();
|
||||
.readLocation("src/test/resources/3_0/spring/petstore-auth.yaml", null, new ParseOptions()).getOpenAPI();
|
||||
|
||||
final SpringCodegen codegen = new SpringCodegen();
|
||||
codegen.setOpenAPI(openAPI);
|
||||
@ -1226,9 +1225,23 @@ public class SpringCodegenTest {
|
||||
|
||||
Path filePath = Paths.get(output.getAbsolutePath(), "src/main/java/org/openapitools/configuration/ClientPropertiesConfiguration.java");
|
||||
|
||||
String content = new String(Files.readAllBytes(filePath), "UTF-8");
|
||||
Assert.assertTrue(content.contains("properties.put(\"spring.security.oauth2.client.provider.oAuth2AccessCode.token-uri\", \"${tokenUrl}\" );"));
|
||||
Assert.assertTrue(content.contains("properties.put(\"spring.security.oauth2.client.provider.oAuth2AccessCode.authorization-uri\", \"${authorizationUrl}\" );"));
|
||||
|
||||
assertFileContains(filePath,
|
||||
"oAuth2AccessCode.put(\"spring.security.oauth2.client.registration.oAuth2AccessCode.redirect-uri\", \"set-oAuth2AccessCode-redirect-uri\" );",
|
||||
"oAuth2AccessCode.put(\"spring.security.oauth2.client.registration.oAuth2AccessCode.authorization-grant-type\", \"authorization_code\" );",
|
||||
"oAuth2AccessCode.put(\"spring.security.oauth2.client.registration.oAuth2AccessCode.client-id\", \"set-oAuth2AccessCode-client-id\" );",
|
||||
"oAuth2AccessCode.put(\"spring.security.oauth2.client.registration.oAuth2AccessCode.scope\", \"openid,profile,aud\" );",
|
||||
"oAuth2AccessCode.put(\"spring.security.oauth2.client.provider.oAuth2AccessCode.token-uri\", \"${tokenUrl}\" );",
|
||||
"oAuth2AccessCode.put(\"spring.security.oauth2.client.provider.oAuth2AccessCode.authorization-uri\", \"${authorizationUrl}\" );",
|
||||
|
||||
|
||||
"oAuth2Application.put(\"spring.security.oauth2.client.registration.oAuth2Application.client-id\", \"set-oAuth2Application-client-id\" );",
|
||||
"oAuth2Application.put(\"spring.security.oauth2.client.registration.oAuth2Application.authorization-grant-type\", \"client_credentials\" );",
|
||||
"oAuth2Application.put(\"spring.security.oauth2.client.provider.oAuth2Application.token-uri\", \"/openid-connect/token\" );"
|
||||
|
||||
);
|
||||
|
||||
assertFileNotContains(filePath,"spring.security.oauth2.client.registration.oAuth2Application.scope");
|
||||
}
|
||||
|
||||
@Test
|
||||
|
@ -1,29 +0,0 @@
|
||||
openapi: "3.0.3"
|
||||
info:
|
||||
title: Test for OAuth2 provider
|
||||
version: 1.0.0
|
||||
|
||||
security:
|
||||
- OAuth2:
|
||||
- openid
|
||||
- profile
|
||||
|
||||
paths:
|
||||
/some/endpoint:
|
||||
get:
|
||||
responses:
|
||||
"200":
|
||||
description: OK
|
||||
|
||||
components:
|
||||
securitySchemes:
|
||||
OAuth2:
|
||||
type: oauth2
|
||||
x-tokenName: id_token
|
||||
flows:
|
||||
authorizationCode:
|
||||
authorizationUrl: "${authorizationUrl}"
|
||||
tokenUrl: "${tokenUrl}"
|
||||
scopes:
|
||||
openid: Access OpenId Connect info
|
||||
profile: Profile info
|
@ -0,0 +1,37 @@
|
||||
openapi: "3.0.3"
|
||||
info:
|
||||
description: 'This spec is mainly for testing Petstore server and contains fake
|
||||
endpoints, models. Please do not use this for any other purpose. Special
|
||||
characters: " \'
|
||||
version: 1.0.0
|
||||
title: OpenAPI Petstore Auth
|
||||
license:
|
||||
name: Apache-2.0
|
||||
url: https://www.apache.org/licenses/LICENSE-2.0.html
|
||||
|
||||
security:
|
||||
- OAuth2: [openid, profile, aud]
|
||||
|
||||
paths:
|
||||
/some/endpoint:
|
||||
get:
|
||||
responses:
|
||||
"200":
|
||||
description: OK
|
||||
|
||||
components:
|
||||
securitySchemes:
|
||||
OAuth2:
|
||||
type: oauth2
|
||||
x-tokenName: id_token
|
||||
flows:
|
||||
authorizationCode:
|
||||
authorizationUrl: "${authorizationUrl}"
|
||||
tokenUrl: "${tokenUrl}"
|
||||
scopes:
|
||||
openid: Access OpenId Connect info
|
||||
profile: Profile info
|
||||
aud: Audience info
|
||||
clientCredentials:
|
||||
tokenUrl: '/openid-connect/token'
|
||||
scopes: { }
|
@ -0,0 +1,23 @@
|
||||
# OpenAPI Generator Ignore
|
||||
# Generated by openapi-generator https://github.com/openapitools/openapi-generator
|
||||
|
||||
# Use this file to prevent files from being overwritten by the generator.
|
||||
# The patterns follow closely to .gitignore or .dockerignore.
|
||||
|
||||
# As an example, the C# client generator defines ApiClient.cs.
|
||||
# You can make changes and tell OpenAPI Generator to ignore just this file by uncommenting the following line:
|
||||
#ApiClient.cs
|
||||
|
||||
# You can match any string of characters against a directory, file or extension with a single asterisk (*):
|
||||
#foo/*/qux
|
||||
# The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux
|
||||
|
||||
# You can recursively match patterns against a directory, file or extension with a double asterisk (**):
|
||||
#foo/**/qux
|
||||
# This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux
|
||||
|
||||
# You can also negate patterns with an exclamation (!).
|
||||
# For example, you can ignore all files in a docs folder with the file extension .md:
|
||||
#docs/*.md
|
||||
# Then explicitly reverse the ignore rule for a single file:
|
||||
#!docs/README.md
|
@ -0,0 +1,7 @@
|
||||
README.md
|
||||
pom.xml
|
||||
src/main/java/org/openapitools/api/SomeApi.java
|
||||
src/main/java/org/openapitools/api/SomeApiClient.java
|
||||
src/main/java/org/openapitools/configuration/ApiKeyRequestInterceptor.java
|
||||
src/main/java/org/openapitools/configuration/ClientConfiguration.java
|
||||
src/main/java/org/openapitools/configuration/ClientPropertiesConfiguration.java
|
@ -0,0 +1 @@
|
||||
7.5.0-SNAPSHOT
|
53
samples/client/petstore/spring-cloud-auth/README.md
Normal file
53
samples/client/petstore/spring-cloud-auth/README.md
Normal file
@ -0,0 +1,53 @@
|
||||
# petstore-spring-cloud-auth
|
||||
|
||||
## Requirements
|
||||
|
||||
Building the API client library requires [Maven](https://maven.apache.org/) to be installed.
|
||||
|
||||
## Installation
|
||||
|
||||
To install the API client library to your local Maven repository, simply execute:
|
||||
|
||||
```shell
|
||||
mvn install
|
||||
```
|
||||
|
||||
To deploy it to a remote Maven repository instead, configure the settings of the repository and execute:
|
||||
|
||||
```shell
|
||||
mvn deploy
|
||||
```
|
||||
|
||||
Refer to the [official documentation](https://maven.apache.org/plugins/maven-deploy-plugin/usage.html) for more information.
|
||||
|
||||
### Maven users
|
||||
|
||||
Add this dependency to your project's POM:
|
||||
|
||||
```xml
|
||||
<dependency>
|
||||
<groupId>org.openapitools</groupId>
|
||||
<artifactId>petstore-spring-cloud-auth</artifactId>
|
||||
<version>1.0.0</version>
|
||||
<scope>compile</scope>
|
||||
</dependency>
|
||||
```
|
||||
|
||||
### Gradle users
|
||||
|
||||
Add this dependency to your project's build file:
|
||||
|
||||
```groovy
|
||||
compile "org.openapitools:petstore-spring-cloud-auth:1.0.0"
|
||||
```
|
||||
|
||||
### Others
|
||||
|
||||
At first generate the JAR by executing:
|
||||
|
||||
mvn package
|
||||
|
||||
Then manually install the following JARs:
|
||||
|
||||
* target/petstore-spring-cloud-auth-1.0.0.jar
|
||||
* target/lib/*.jar
|
75
samples/client/petstore/spring-cloud-auth/pom.xml
Normal file
75
samples/client/petstore/spring-cloud-auth/pom.xml
Normal file
@ -0,0 +1,75 @@
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<groupId>org.openapitools</groupId>
|
||||
<artifactId>petstore-spring-cloud-auth</artifactId>
|
||||
<packaging>jar</packaging>
|
||||
<name>petstore-spring-cloud-auth</name>
|
||||
<version>1.0.0</version>
|
||||
<properties>
|
||||
<java.version>1.8</java.version>
|
||||
<maven.compiler.source>${java.version}</maven.compiler.source>
|
||||
<maven.compiler.target>${java.version}</maven.compiler.target>
|
||||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||
</properties>
|
||||
<parent>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-parent</artifactId>
|
||||
<version>2.7.15</version>
|
||||
<relativePath/> <!-- lookup parent from repository -->
|
||||
</parent>
|
||||
<build>
|
||||
<sourceDirectory>src/main/java</sourceDirectory>
|
||||
</build>
|
||||
|
||||
<dependencyManagement>
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>org.springframework.cloud</groupId>
|
||||
<artifactId>spring-cloud-starter-parent</artifactId>
|
||||
<version>2021.0.5</version>
|
||||
<type>pom</type>
|
||||
<scope>import</scope>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
</dependencyManagement>
|
||||
|
||||
<dependencies>
|
||||
<!-- @Nullable annotation -->
|
||||
<dependency>
|
||||
<groupId>com.google.code.findbugs</groupId>
|
||||
<artifactId>jsr305</artifactId>
|
||||
<version>3.0.2</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.springframework.cloud</groupId>
|
||||
<artifactId>spring-cloud-starter-openfeign</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.springframework.security</groupId>
|
||||
<artifactId>spring-security-oauth2-client</artifactId>
|
||||
<version>5.7.8</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.fasterxml.jackson.datatype</groupId>
|
||||
<artifactId>jackson-datatype-jsr310</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.openapitools</groupId>
|
||||
<artifactId>jackson-databind-nullable</artifactId>
|
||||
<version>0.2.6</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-validation</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.springframework.data</groupId>
|
||||
<artifactId>spring-data-commons</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-test</artifactId>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
</project>
|
@ -0,0 +1,41 @@
|
||||
/**
|
||||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (7.5.0-SNAPSHOT).
|
||||
* https://openapi-generator.tech
|
||||
* Do not edit the class manually.
|
||||
*/
|
||||
package org.openapitools.api;
|
||||
|
||||
import org.springframework.http.HttpStatus;
|
||||
import org.springframework.http.MediaType;
|
||||
import org.springframework.http.ResponseEntity;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import org.springframework.web.context.request.NativeWebRequest;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
import javax.validation.Valid;
|
||||
import javax.validation.constraints.*;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Optional;
|
||||
import javax.annotation.Generated;
|
||||
|
||||
@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.5.0-SNAPSHOT")
|
||||
@Validated
|
||||
public interface SomeApi {
|
||||
|
||||
/**
|
||||
* GET /some/endpoint
|
||||
*
|
||||
* @return OK (status code 200)
|
||||
*/
|
||||
@RequestMapping(
|
||||
method = RequestMethod.GET,
|
||||
value = "/some/endpoint"
|
||||
)
|
||||
|
||||
ResponseEntity<Void> someEndpointGet(
|
||||
|
||||
);
|
||||
|
||||
}
|
@ -0,0 +1,8 @@
|
||||
package org.openapitools.api;
|
||||
|
||||
import org.springframework.cloud.openfeign.FeignClient;
|
||||
import org.openapitools.configuration.ClientConfiguration;
|
||||
|
||||
@FeignClient(name="${some.name:some}", url="${some.url:http://localhost}", configuration = ClientConfiguration.class)
|
||||
public interface SomeApiClient extends SomeApi {
|
||||
}
|
@ -0,0 +1,31 @@
|
||||
package org.openapitools.configuration;
|
||||
|
||||
import feign.RequestInterceptor;
|
||||
import feign.RequestTemplate;
|
||||
import feign.Util;
|
||||
|
||||
|
||||
public class ApiKeyRequestInterceptor implements RequestInterceptor {
|
||||
private final String location;
|
||||
private final String name;
|
||||
private String value;
|
||||
|
||||
public ApiKeyRequestInterceptor(String location, String name, String value) {
|
||||
Util.checkNotNull(location, "location", new Object[0]);
|
||||
Util.checkNotNull(name, "name", new Object[0]);
|
||||
Util.checkNotNull(value, "value", new Object[0]);
|
||||
this.location = location;
|
||||
this.name = name;
|
||||
this.value = value;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void apply(RequestTemplate requestTemplate) {
|
||||
if(location.equals("header")) {
|
||||
requestTemplate.header(name, value);
|
||||
} else if(location.equals("query")) {
|
||||
requestTemplate.query(name, value);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,86 @@
|
||||
package org.openapitools.configuration;
|
||||
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
|
||||
import org.springframework.security.authentication.AnonymousAuthenticationToken;
|
||||
import org.springframework.security.oauth2.client.AuthorizedClientServiceOAuth2AuthorizedClientManager;
|
||||
import org.springframework.security.oauth2.client.OAuth2AuthorizeRequest;
|
||||
import org.springframework.security.oauth2.client.OAuth2AuthorizedClient;
|
||||
import org.springframework.security.oauth2.client.OAuth2AuthorizedClientManager;
|
||||
import org.springframework.security.oauth2.client.OAuth2AuthorizedClientService;
|
||||
import org.springframework.security.oauth2.client.registration.ClientRegistrationRepository;
|
||||
import org.springframework.security.oauth2.core.OAuth2AuthenticationException;
|
||||
import org.springframework.security.oauth2.core.OAuth2AccessToken;
|
||||
import org.springframework.security.core.authority.AuthorityUtils;
|
||||
import org.springframework.http.HttpHeaders;
|
||||
|
||||
import feign.RequestInterceptor;
|
||||
import feign.RequestTemplate;
|
||||
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
|
||||
|
||||
public class ClientConfiguration {
|
||||
|
||||
private static final String CLIENT_PRINCIPAL_APPLICATION = "oauth2FeignClient";
|
||||
|
||||
@Bean
|
||||
@ConditionalOnProperty( prefix = "spring.security.oauth2.client.registration.oAuth2Application", name = "enabled", havingValue = "true" )
|
||||
public OAuth2RequestInterceptor applicationOAuth2RequestInterceptor(final OAuth2AuthorizedClientManager applicationAuthorizedClientManager ) {
|
||||
return new OAuth2RequestInterceptor(OAuth2AuthorizeRequest.withClientRegistrationId("oAuth2Application")
|
||||
.principal( new AnonymousAuthenticationToken( CLIENT_PRINCIPAL_APPLICATION, CLIENT_PRINCIPAL_APPLICATION, AuthorityUtils.createAuthorityList( "ROLE_ANONYMOUS" ) ) )
|
||||
.build(), applicationAuthorizedClientManager );
|
||||
}
|
||||
|
||||
@Bean
|
||||
@ConditionalOnProperty( prefix = "spring.security.oauth2.client.registration.oAuth2Application", name = "enabled", havingValue = "true" )
|
||||
public OAuth2AuthorizedClientManager applicationAuthorizedClientManager(ClientRegistrationRepository clientRegistrationRepository,
|
||||
OAuth2AuthorizedClientService authorizedClientService ) {
|
||||
return new AuthorizedClientServiceOAuth2AuthorizedClientManager( clientRegistrationRepository, authorizedClientService );
|
||||
}
|
||||
private static final String CLIENT_PRINCIPAL_ACCESSCODE = "oauth2FeignClient";
|
||||
|
||||
@Bean
|
||||
@ConditionalOnProperty( prefix = "spring.security.oauth2.client.registration.oAuth2AccessCode", name = "enabled", havingValue = "true" )
|
||||
public OAuth2RequestInterceptor accessCodeOAuth2RequestInterceptor(final OAuth2AuthorizedClientManager accessCodeAuthorizedClientManager ) {
|
||||
return new OAuth2RequestInterceptor(OAuth2AuthorizeRequest.withClientRegistrationId("oAuth2AccessCode")
|
||||
.principal( new AnonymousAuthenticationToken( CLIENT_PRINCIPAL_ACCESSCODE, CLIENT_PRINCIPAL_ACCESSCODE, AuthorityUtils.createAuthorityList( "ROLE_ANONYMOUS" ) ) )
|
||||
.build(), accessCodeAuthorizedClientManager );
|
||||
}
|
||||
|
||||
@Bean
|
||||
@ConditionalOnProperty( prefix = "spring.security.oauth2.client.registration.oAuth2AccessCode", name = "enabled", havingValue = "true" )
|
||||
public OAuth2AuthorizedClientManager accessCodeAuthorizedClientManager(ClientRegistrationRepository clientRegistrationRepository,
|
||||
OAuth2AuthorizedClientService authorizedClientService ) {
|
||||
return new AuthorizedClientServiceOAuth2AuthorizedClientManager( clientRegistrationRepository, authorizedClientService );
|
||||
}
|
||||
public static class OAuth2RequestInterceptor implements RequestInterceptor {
|
||||
|
||||
private final OAuth2AuthorizedClientManager oAuth2AuthorizedClientManager;
|
||||
private final OAuth2AuthorizeRequest oAuth2AuthorizeRequest;
|
||||
|
||||
public OAuth2RequestInterceptor(OAuth2AuthorizeRequest oAuth2AuthorizeRequest,OAuth2AuthorizedClientManager oAuth2AuthorizedClientManager){
|
||||
this.oAuth2AuthorizeRequest = oAuth2AuthorizeRequest;
|
||||
this.oAuth2AuthorizedClientManager = oAuth2AuthorizedClientManager;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void apply( final RequestTemplate template ) {
|
||||
template.header( HttpHeaders.AUTHORIZATION, getBearerToken() );
|
||||
}
|
||||
|
||||
public OAuth2AccessToken getAccessToken() {
|
||||
final OAuth2AuthorizedClient authorizedClient = oAuth2AuthorizedClientManager.authorize(oAuth2AuthorizeRequest);
|
||||
if (authorizedClient == null) {
|
||||
throw new OAuth2AuthenticationException( "Client failed to authenticate");
|
||||
}
|
||||
return authorizedClient.getAccessToken();
|
||||
}
|
||||
|
||||
public String getBearerToken() {
|
||||
final OAuth2AccessToken accessToken = getAccessToken();
|
||||
return String.format( "%s %s", accessToken.getTokenType().getValue(), accessToken.getTokenValue() );
|
||||
}
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,28 @@
|
||||
package org.openapitools.configuration;
|
||||
|
||||
|
||||
import java.util.Properties;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
import org.springframework.core.env.ConfigurableEnvironment;
|
||||
import org.springframework.core.env.PropertiesPropertySource;
|
||||
|
||||
@Configuration(value = "org.openapitools.configuration.clientPropertiesConfiguration")
|
||||
public class ClientPropertiesConfiguration {
|
||||
|
||||
public ClientPropertiesConfiguration( final ConfigurableEnvironment configurableEnvironment ) {
|
||||
final Properties oAuth2Application = new Properties();
|
||||
oAuth2Application.put("spring.security.oauth2.client.registration.oAuth2Application.client-id", "set-oAuth2Application-client-id" );
|
||||
oAuth2Application.put("spring.security.oauth2.client.registration.oAuth2Application.authorization-grant-type", "client_credentials" );
|
||||
oAuth2Application.put("spring.security.oauth2.client.provider.oAuth2Application.token-uri", "/openid-connect/token" );
|
||||
configurableEnvironment.getPropertySources().addLast( new PropertiesPropertySource("oAuth2Application", oAuth2Application ) );
|
||||
final Properties oAuth2AccessCode = new Properties();
|
||||
oAuth2AccessCode.put("spring.security.oauth2.client.registration.oAuth2AccessCode.client-id", "set-oAuth2AccessCode-client-id" );
|
||||
oAuth2AccessCode.put("spring.security.oauth2.client.registration.oAuth2AccessCode.scope", "openid,profile,aud" );
|
||||
oAuth2AccessCode.put("spring.security.oauth2.client.registration.oAuth2AccessCode.authorization-grant-type", "authorization_code" );
|
||||
oAuth2AccessCode.put("spring.security.oauth2.client.registration.oAuth2AccessCode.redirect-uri", "set-oAuth2AccessCode-redirect-uri" );
|
||||
oAuth2AccessCode.put("spring.security.oauth2.client.provider.oAuth2AccessCode.token-uri", "${tokenUrl}" );
|
||||
oAuth2AccessCode.put("spring.security.oauth2.client.provider.oAuth2AccessCode.authorization-uri", "${authorizationUrl}" );
|
||||
configurableEnvironment.getPropertySources().addLast( new PropertiesPropertySource("oAuth2AccessCode", oAuth2AccessCode ) );
|
||||
}
|
||||
|
||||
}
|
@ -1,5 +1,6 @@
|
||||
package org.openapitools.configuration;
|
||||
|
||||
|
||||
import java.util.Properties;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
import org.springframework.core.env.ConfigurableEnvironment;
|
||||
@ -9,13 +10,12 @@ import org.springframework.core.env.PropertiesPropertySource;
|
||||
public class ClientPropertiesConfiguration {
|
||||
|
||||
public ClientPropertiesConfiguration( final ConfigurableEnvironment configurableEnvironment ) {
|
||||
final Properties properties = new Properties();
|
||||
properties.put("spring.security.oauth2.client.registration.petstoreAuthImplicit.client-id", "set-petstoreAuthImplicit-client-id" );
|
||||
properties.put("spring.security.oauth2.client.registration.petstoreAuthImplicit.scope", "write:pets,read:pets" );
|
||||
properties.put("spring.security.oauth2.client.registration.petstoreAuthImplicit.authorization-grant-type", "implicit" );
|
||||
properties.put("spring.security.oauth2.client.provider.petstoreAuthImplicit.authorization-uri", "http://petstore.swagger.io/api/oauth/dialog" );
|
||||
final PropertiesPropertySource propertiesPropertySource = new PropertiesPropertySource("petstoreAuthImplicit", properties );
|
||||
configurableEnvironment.getPropertySources().addLast( propertiesPropertySource );
|
||||
final Properties petstoreAuthImplicit = new Properties();
|
||||
petstoreAuthImplicit.put("spring.security.oauth2.client.registration.petstoreAuthImplicit.client-id", "set-petstoreAuthImplicit-client-id" );
|
||||
petstoreAuthImplicit.put("spring.security.oauth2.client.registration.petstoreAuthImplicit.scope", "write:pets,read:pets" );
|
||||
petstoreAuthImplicit.put("spring.security.oauth2.client.registration.petstoreAuthImplicit.authorization-grant-type", "implicit" );
|
||||
petstoreAuthImplicit.put("spring.security.oauth2.client.provider.petstoreAuthImplicit.authorization-uri", "http://petstore.swagger.io/api/oauth/dialog" );
|
||||
configurableEnvironment.getPropertySources().addLast( new PropertiesPropertySource("petstoreAuthImplicit", petstoreAuthImplicit ) );
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -1,5 +1,6 @@
|
||||
package org.openapitools.configuration;
|
||||
|
||||
|
||||
import java.util.Properties;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
import org.springframework.core.env.ConfigurableEnvironment;
|
||||
@ -9,13 +10,12 @@ import org.springframework.core.env.PropertiesPropertySource;
|
||||
public class ClientPropertiesConfiguration {
|
||||
|
||||
public ClientPropertiesConfiguration( final ConfigurableEnvironment configurableEnvironment ) {
|
||||
final Properties properties = new Properties();
|
||||
properties.put("spring.security.oauth2.client.registration.petstoreAuthImplicit.client-id", "set-petstoreAuthImplicit-client-id" );
|
||||
properties.put("spring.security.oauth2.client.registration.petstoreAuthImplicit.scope", "write:pets,read:pets" );
|
||||
properties.put("spring.security.oauth2.client.registration.petstoreAuthImplicit.authorization-grant-type", "implicit" );
|
||||
properties.put("spring.security.oauth2.client.provider.petstoreAuthImplicit.authorization-uri", "http://petstore.swagger.io/api/oauth/dialog" );
|
||||
final PropertiesPropertySource propertiesPropertySource = new PropertiesPropertySource("petstoreAuthImplicit", properties );
|
||||
configurableEnvironment.getPropertySources().addLast( propertiesPropertySource );
|
||||
final Properties petstoreAuthImplicit = new Properties();
|
||||
petstoreAuthImplicit.put("spring.security.oauth2.client.registration.petstoreAuthImplicit.client-id", "set-petstoreAuthImplicit-client-id" );
|
||||
petstoreAuthImplicit.put("spring.security.oauth2.client.registration.petstoreAuthImplicit.scope", "write:pets,read:pets" );
|
||||
petstoreAuthImplicit.put("spring.security.oauth2.client.registration.petstoreAuthImplicit.authorization-grant-type", "implicit" );
|
||||
petstoreAuthImplicit.put("spring.security.oauth2.client.provider.petstoreAuthImplicit.authorization-uri", "http://petstore.swagger.io/api/oauth/dialog" );
|
||||
configurableEnvironment.getPropertySources().addLast( new PropertiesPropertySource("petstoreAuthImplicit", petstoreAuthImplicit ) );
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -1,5 +1,6 @@
|
||||
package org.openapitools.configuration;
|
||||
|
||||
|
||||
import java.util.Properties;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
import org.springframework.core.env.ConfigurableEnvironment;
|
||||
@ -9,13 +10,12 @@ import org.springframework.core.env.PropertiesPropertySource;
|
||||
public class ClientPropertiesConfiguration {
|
||||
|
||||
public ClientPropertiesConfiguration( final ConfigurableEnvironment configurableEnvironment ) {
|
||||
final Properties properties = new Properties();
|
||||
properties.put("spring.security.oauth2.client.registration.petstoreAuthImplicit.client-id", "set-petstoreAuthImplicit-client-id" );
|
||||
properties.put("spring.security.oauth2.client.registration.petstoreAuthImplicit.scope", "write:pets,read:pets" );
|
||||
properties.put("spring.security.oauth2.client.registration.petstoreAuthImplicit.authorization-grant-type", "implicit" );
|
||||
properties.put("spring.security.oauth2.client.provider.petstoreAuthImplicit.authorization-uri", "http://petstore.swagger.io/api/oauth/dialog" );
|
||||
final PropertiesPropertySource propertiesPropertySource = new PropertiesPropertySource("petstoreAuthImplicit", properties );
|
||||
configurableEnvironment.getPropertySources().addLast( propertiesPropertySource );
|
||||
final Properties petstoreAuthImplicit = new Properties();
|
||||
petstoreAuthImplicit.put("spring.security.oauth2.client.registration.petstoreAuthImplicit.client-id", "set-petstoreAuthImplicit-client-id" );
|
||||
petstoreAuthImplicit.put("spring.security.oauth2.client.registration.petstoreAuthImplicit.scope", "write:pets,read:pets" );
|
||||
petstoreAuthImplicit.put("spring.security.oauth2.client.registration.petstoreAuthImplicit.authorization-grant-type", "implicit" );
|
||||
petstoreAuthImplicit.put("spring.security.oauth2.client.provider.petstoreAuthImplicit.authorization-uri", "http://petstore.swagger.io/api/oauth/dialog" );
|
||||
configurableEnvironment.getPropertySources().addLast( new PropertiesPropertySource("petstoreAuthImplicit", petstoreAuthImplicit ) );
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -1,5 +1,6 @@
|
||||
package org.openapitools.configuration;
|
||||
|
||||
|
||||
import java.util.Properties;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
import org.springframework.core.env.ConfigurableEnvironment;
|
||||
@ -9,13 +10,12 @@ import org.springframework.core.env.PropertiesPropertySource;
|
||||
public class ClientPropertiesConfiguration {
|
||||
|
||||
public ClientPropertiesConfiguration( final ConfigurableEnvironment configurableEnvironment ) {
|
||||
final Properties properties = new Properties();
|
||||
properties.put("spring.security.oauth2.client.registration.petstoreAuthImplicit.client-id", "set-petstoreAuthImplicit-client-id" );
|
||||
properties.put("spring.security.oauth2.client.registration.petstoreAuthImplicit.scope", "write:pets,read:pets" );
|
||||
properties.put("spring.security.oauth2.client.registration.petstoreAuthImplicit.authorization-grant-type", "implicit" );
|
||||
properties.put("spring.security.oauth2.client.provider.petstoreAuthImplicit.authorization-uri", "http://petstore.swagger.io/api/oauth/dialog" );
|
||||
final PropertiesPropertySource propertiesPropertySource = new PropertiesPropertySource("petstoreAuthImplicit", properties );
|
||||
configurableEnvironment.getPropertySources().addLast( propertiesPropertySource );
|
||||
final Properties petstoreAuthImplicit = new Properties();
|
||||
petstoreAuthImplicit.put("spring.security.oauth2.client.registration.petstoreAuthImplicit.client-id", "set-petstoreAuthImplicit-client-id" );
|
||||
petstoreAuthImplicit.put("spring.security.oauth2.client.registration.petstoreAuthImplicit.scope", "write:pets,read:pets" );
|
||||
petstoreAuthImplicit.put("spring.security.oauth2.client.registration.petstoreAuthImplicit.authorization-grant-type", "implicit" );
|
||||
petstoreAuthImplicit.put("spring.security.oauth2.client.provider.petstoreAuthImplicit.authorization-uri", "http://petstore.swagger.io/api/oauth/dialog" );
|
||||
configurableEnvironment.getPropertySources().addLast( new PropertiesPropertySource("petstoreAuthImplicit", petstoreAuthImplicit ) );
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -1,5 +1,6 @@
|
||||
package org.openapitools.configuration;
|
||||
|
||||
|
||||
import java.util.Properties;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
import org.springframework.core.env.ConfigurableEnvironment;
|
||||
@ -9,13 +10,12 @@ import org.springframework.core.env.PropertiesPropertySource;
|
||||
public class ClientPropertiesConfiguration {
|
||||
|
||||
public ClientPropertiesConfiguration( final ConfigurableEnvironment configurableEnvironment ) {
|
||||
final Properties properties = new Properties();
|
||||
properties.put("spring.security.oauth2.client.registration.petstoreAuthImplicit.client-id", "set-petstoreAuthImplicit-client-id" );
|
||||
properties.put("spring.security.oauth2.client.registration.petstoreAuthImplicit.scope", "write:pets,read:pets" );
|
||||
properties.put("spring.security.oauth2.client.registration.petstoreAuthImplicit.authorization-grant-type", "implicit" );
|
||||
properties.put("spring.security.oauth2.client.provider.petstoreAuthImplicit.authorization-uri", "http://petstore.swagger.io/api/oauth/dialog" );
|
||||
final PropertiesPropertySource propertiesPropertySource = new PropertiesPropertySource("petstoreAuthImplicit", properties );
|
||||
configurableEnvironment.getPropertySources().addLast( propertiesPropertySource );
|
||||
final Properties petstoreAuthImplicit = new Properties();
|
||||
petstoreAuthImplicit.put("spring.security.oauth2.client.registration.petstoreAuthImplicit.client-id", "set-petstoreAuthImplicit-client-id" );
|
||||
petstoreAuthImplicit.put("spring.security.oauth2.client.registration.petstoreAuthImplicit.scope", "write:pets,read:pets" );
|
||||
petstoreAuthImplicit.put("spring.security.oauth2.client.registration.petstoreAuthImplicit.authorization-grant-type", "implicit" );
|
||||
petstoreAuthImplicit.put("spring.security.oauth2.client.provider.petstoreAuthImplicit.authorization-uri", "http://petstore.swagger.io/api/oauth/dialog" );
|
||||
configurableEnvironment.getPropertySources().addLast( new PropertiesPropertySource("petstoreAuthImplicit", petstoreAuthImplicit ) );
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -1,5 +1,6 @@
|
||||
package org.openapitools.configuration;
|
||||
|
||||
|
||||
import java.util.Properties;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
import org.springframework.core.env.ConfigurableEnvironment;
|
||||
@ -9,13 +10,12 @@ import org.springframework.core.env.PropertiesPropertySource;
|
||||
public class ClientPropertiesConfiguration {
|
||||
|
||||
public ClientPropertiesConfiguration( final ConfigurableEnvironment configurableEnvironment ) {
|
||||
final Properties properties = new Properties();
|
||||
properties.put("spring.security.oauth2.client.registration.petstoreAuthImplicit.client-id", "set-petstoreAuthImplicit-client-id" );
|
||||
properties.put("spring.security.oauth2.client.registration.petstoreAuthImplicit.scope", "write:pets,read:pets" );
|
||||
properties.put("spring.security.oauth2.client.registration.petstoreAuthImplicit.authorization-grant-type", "implicit" );
|
||||
properties.put("spring.security.oauth2.client.provider.petstoreAuthImplicit.authorization-uri", "http://petstore.swagger.io/api/oauth/dialog" );
|
||||
final PropertiesPropertySource propertiesPropertySource = new PropertiesPropertySource("petstoreAuthImplicit", properties );
|
||||
configurableEnvironment.getPropertySources().addLast( propertiesPropertySource );
|
||||
final Properties petstoreAuthImplicit = new Properties();
|
||||
petstoreAuthImplicit.put("spring.security.oauth2.client.registration.petstoreAuthImplicit.client-id", "set-petstoreAuthImplicit-client-id" );
|
||||
petstoreAuthImplicit.put("spring.security.oauth2.client.registration.petstoreAuthImplicit.scope", "write:pets,read:pets" );
|
||||
petstoreAuthImplicit.put("spring.security.oauth2.client.registration.petstoreAuthImplicit.authorization-grant-type", "implicit" );
|
||||
petstoreAuthImplicit.put("spring.security.oauth2.client.provider.petstoreAuthImplicit.authorization-uri", "http://petstore.swagger.io/api/oauth/dialog" );
|
||||
configurableEnvironment.getPropertySources().addLast( new PropertiesPropertySource("petstoreAuthImplicit", petstoreAuthImplicit ) );
|
||||
}
|
||||
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user