Skip to content

Commit

Permalink
only include imports which are actually required for spring-cloud Cli…
Browse files Browse the repository at this point in the history
…entConfiguration generator (closes swagger-api#6683)
  • Loading branch information
felhag committed Jun 20, 2023
1 parent a620537 commit 037bccc
Show file tree
Hide file tree
Showing 6 changed files with 19 additions and 17 deletions.
Original file line number Diff line number Diff line change
@@ -1,22 +1,32 @@
package {{configPackage}};

import feign.Logger;
import feign.auth.BasicAuthRequestInterceptor;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.boot.context.properties.EnableConfigurationProperties;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
{{#authMethods}}
{{#isBasic}}
import feign.auth.BasicAuthRequestInterceptor;
{{/isBasic}}
{{#isOAuth}}
import org.springframework.cloud.security.oauth2.client.feign.OAuth2FeignRequestInterceptor;
import org.springframework.security.oauth2.client.DefaultOAuth2ClientContext;
import org.springframework.security.oauth2.client.resource.BaseOAuth2ProtectedResourceDetails;
{{#isApplication}}
import org.springframework.security.oauth2.client.token.grant.client.ClientCredentialsResourceDetails;
{{/isApplication}}
{{#isCode}}
import org.springframework.security.oauth2.client.token.grant.code.AuthorizationCodeResourceDetails;
{{/isCode}}
{{#isImplicit}}
import org.springframework.security.oauth2.client.token.grant.implicit.ImplicitResourceDetails;
{{/isImplicit}}
{{#isPassword}}
import org.springframework.security.oauth2.client.token.grant.password.ResourceOwnerPasswordResourceDetails;
import org.springframework.security.oauth2.common.exceptions.InvalidGrantException;
import org.springframework.security.oauth2.common.exceptions.OAuth2Exception;
{{/isPassword}}
{{/isOAuth}}
{{/authMethods}}

@Configuration
@EnableConfigurationProperties
Expand Down
Original file line number Diff line number Diff line change
@@ -1 +1 @@
2.4.22-SNAPSHOT
2.4.33-SNAPSHOT
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* NOTE: This class is auto generated by the swagger code generator program (2.4.22-SNAPSHOT).
* NOTE: This class is auto generated by the swagger code generator program (2.4.33-SNAPSHOT).
* https://github.com/swagger-api/swagger-codegen
* Do not edit the class manually.
*/
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* NOTE: This class is auto generated by the swagger code generator program (2.4.22-SNAPSHOT).
* NOTE: This class is auto generated by the swagger code generator program (2.4.33-SNAPSHOT).
* https://github.com/swagger-api/swagger-codegen
* Do not edit the class manually.
*/
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* NOTE: This class is auto generated by the swagger code generator program (2.4.22-SNAPSHOT).
* NOTE: This class is auto generated by the swagger code generator program (2.4.33-SNAPSHOT).
* https://github.com/swagger-api/swagger-codegen
* Do not edit the class manually.
*/
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
package io.swagger.configuration;

import feign.Logger;
import feign.auth.BasicAuthRequestInterceptor;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
import org.springframework.boot.context.properties.ConfigurationProperties;
Expand All @@ -10,13 +8,7 @@
import org.springframework.context.annotation.Configuration;
import org.springframework.cloud.security.oauth2.client.feign.OAuth2FeignRequestInterceptor;
import org.springframework.security.oauth2.client.DefaultOAuth2ClientContext;
import org.springframework.security.oauth2.client.resource.BaseOAuth2ProtectedResourceDetails;
import org.springframework.security.oauth2.client.token.grant.client.ClientCredentialsResourceDetails;
import org.springframework.security.oauth2.client.token.grant.code.AuthorizationCodeResourceDetails;
import org.springframework.security.oauth2.client.token.grant.implicit.ImplicitResourceDetails;
import org.springframework.security.oauth2.client.token.grant.password.ResourceOwnerPasswordResourceDetails;
import org.springframework.security.oauth2.common.exceptions.InvalidGrantException;
import org.springframework.security.oauth2.common.exceptions.OAuth2Exception;

@Configuration
@EnableConfigurationProperties
Expand Down

0 comments on commit 037bccc

Please sign in to comment.