fix(security): Set tool-server-api-key property and revert header name
All checks were successful
Deploy to OCIWP / deploy (push) Successful in 3m10s

This commit is contained in:
jade
2026-08-18 14:46:39 +09:00
parent 91b2b67d85
commit 9f347ef9de
4 changed files with 4 additions and 2 deletions

View File

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

View File

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

View File

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

View File

@@ -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가 하나도 설정되어 있지 않다면 (개발/로컬 환경 등) 인증 없이 통과시킵니다.