fix(security): Set tool-server-api-key property and revert header name
All checks were successful
Deploy to OCIWP / deploy (push) Successful in 3m10s
All checks were successful
Deploy to OCIWP / deploy (push) Successful in 3m10s
This commit is contained in:
@@ -263,7 +263,7 @@ public class ExecuteService {
|
||||
headers.put("request-id", java.util.UUID.randomUUID().toString());
|
||||
String apiKey = properties.toolServerApiKey();
|
||||
if (apiKey != null && !apiKey.isEmpty()) {
|
||||
headers.put("apiKey", apiKey);
|
||||
headers.put("X-Tool-Server-API-Key", apiKey);
|
||||
}
|
||||
|
||||
ObjectNode pageArguments = paginationValidator.normalize(metadata, arguments);
|
||||
|
||||
@@ -29,6 +29,7 @@ eims:
|
||||
url: http://localhost:${server.port}/api/mock/esb/string
|
||||
|
||||
mcp:
|
||||
tool-server-api-key: tool-server-key
|
||||
adapter:
|
||||
url: http://localhost:${server.port}/rpc/v1/execute
|
||||
gateway:
|
||||
|
||||
@@ -28,6 +28,7 @@ report:
|
||||
service-url: ${REPORT_SERVICE_URL:http://tool-report:8092}
|
||||
|
||||
mcp:
|
||||
tool-server-api-key: tool-server-key
|
||||
gateway:
|
||||
fallback:
|
||||
default-url: http://was-cus:8084
|
||||
|
||||
@@ -39,7 +39,7 @@ public class ApiKeyInterceptor implements HandlerInterceptor {
|
||||
return true;
|
||||
}
|
||||
|
||||
String apiKey = request.getHeader("apiKey");
|
||||
String apiKey = request.getHeader("X-Tool-Server-API-Key");
|
||||
Map<String, String> validApiKeys = securityProperties.getApiKeys();
|
||||
|
||||
// 2. 만약 프로퍼티에 API Key가 하나도 설정되어 있지 않다면 (개발/로컬 환경 등) 인증 없이 통과시킵니다.
|
||||
|
||||
Reference in New Issue
Block a user