| | |
| | | app: |
| | | cors: |
| | | # HBuilderX Web development origins; override with exact deployed frontend origins. |
| | | allowed-origins: ${CORS_ALLOWED_ORIGINS:http://localhost:7893,http://localhost:7894,http://127.0.0.1:7893,http://127.0.0.1:7894} |
| | | allowed-origins: ${CORS_ALLOWED_ORIGINS:http://localhost:7893,http://localhost:7894,http://127.0.0.1:7893,http://127.0.0.1:7894,http://192.168.110.26:5173} |
| | | privacy: |
| | | # Production must provide APP_PRIVACY_ENCRYPTION_KEY through the deployment secret store. |
| | | encryption-key: ${APP_PRIVACY_ENCRYPTION_KEY:talent-card-local-development-key} |
| | |
| | | |
| | | @SpringJUnitConfig({ApiCorsConfig.class, ApiCorsConfigTests.TestMvcConfig.class}) |
| | | @WebAppConfiguration |
| | | @TestPropertySource(properties = "app.cors.allowed-origins=http://localhost:7894,http://127.0.0.1:7893") |
| | | @TestPropertySource(properties = "app.cors.allowed-origins=http://localhost:7894,http://127.0.0.1:7893,http://192.168.110.26:5173") |
| | | class ApiCorsConfigTests { |
| | | @Autowired |
| | | private WebApplicationContext context; |
| | |
| | | .andExpect(status().isUnauthorized()); |
| | | } |
| | | |
| | | @Test |
| | | void lanAdminFrontendCanPreflightLogin() throws Exception { |
| | | mvc.perform(options("/api/admin/auth/login") |
| | | .header("Origin", "http://192.168.110.26:5173") |
| | | .header("Access-Control-Request-Method", "POST") |
| | | .header("Access-Control-Request-Headers", "content-type,x-request-id")) |
| | | .andExpect(status().isOk()) |
| | | .andExpect(header().string("Access-Control-Allow-Origin", "http://192.168.110.26:5173")); |
| | | } |
| | | |
| | | @Configuration |
| | | @EnableWebMvc |
| | | static class TestMvcConfig { |