[Spring] fix use of isBasic condition (#15530)

This commit is contained in:
Tiffany Marrel 2023-05-16 15:37:20 +02:00 committed by GitHub
parent 87ea870f03
commit 63ac3e1039
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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;