forked from loafle/openapi-generator-original
[Spring] fix use of isBasic condition (#15530)
This commit is contained in:
parent
87ea870f03
commit
63ac3e1039
@ -1,9 +1,9 @@
|
|||||||
package {{configPackage}};
|
package {{configPackage}};
|
||||||
|
|
||||||
{{#authMethods}}
|
{{#authMethods}}
|
||||||
{{#isBasic}}
|
{{#isBasicBasic}}
|
||||||
import feign.auth.BasicAuthRequestInterceptor;
|
import feign.auth.BasicAuthRequestInterceptor;
|
||||||
{{/isBasic}}
|
{{/isBasicBasic}}
|
||||||
{{#-first}}
|
{{#-first}}
|
||||||
import org.springframework.beans.factory.annotation.Value;
|
import org.springframework.beans.factory.annotation.Value;
|
||||||
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
|
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
|
||||||
@ -44,7 +44,7 @@ import org.springframework.security.oauth2.client.token.grant.password.ResourceO
|
|||||||
public class ClientConfiguration {
|
public class ClientConfiguration {
|
||||||
|
|
||||||
{{#authMethods}}
|
{{#authMethods}}
|
||||||
{{#isBasic}}
|
{{#isBasicBasic}}
|
||||||
@Value("${{openbrace}}{{#lambda.lowercase}}{{{title}}}{{/lambda.lowercase}}.security.{{{name}}}.username:{{closebrace}}")
|
@Value("${{openbrace}}{{#lambda.lowercase}}{{{title}}}{{/lambda.lowercase}}.security.{{{name}}}.username:{{closebrace}}")
|
||||||
private String {{{name}}}Username;
|
private String {{{name}}}Username;
|
||||||
|
|
||||||
@ -57,7 +57,7 @@ public class ClientConfiguration {
|
|||||||
return new BasicAuthRequestInterceptor(this.{{{name}}}Username, this.{{{name}}}Password);
|
return new BasicAuthRequestInterceptor(this.{{{name}}}Username, this.{{{name}}}Password);
|
||||||
}
|
}
|
||||||
|
|
||||||
{{/isBasic}}
|
{{/isBasicBasic}}
|
||||||
{{#isApiKey}}
|
{{#isApiKey}}
|
||||||
@Value("${{openbrace}}{{#lambda.lowercase}}{{{title}}}{{/lambda.lowercase}}.security.{{{name}}}.key:{{closebrace}}")
|
@Value("${{openbrace}}{{#lambda.lowercase}}{{{title}}}{{/lambda.lowercase}}.security.{{{name}}}.key:{{closebrace}}")
|
||||||
private String {{{name}}}Key;
|
private String {{{name}}}Key;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user