add internal feign key
This commit is contained in:
@@ -0,0 +1,20 @@
|
||||
package ru.soune.nocopy.adminpanel.config;
|
||||
|
||||
import feign.RequestInterceptor;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
|
||||
@Configuration
|
||||
public class FeignConfig {
|
||||
|
||||
@Value("${app.internal-api-key}")
|
||||
private String internalApiKey;
|
||||
|
||||
@Bean
|
||||
public RequestInterceptor internalKeyInterceptor() {
|
||||
return requestTemplate -> {
|
||||
requestTemplate.header("X-Internal-Key", internalApiKey);
|
||||
};
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user