Commit Graph

7 Commits

Author SHA1 Message Date
d57cc27e19 feat(server): add graceful shutdown handling
Some checks failed
Auto Changelog & Release / detect-version-change (push) Successful in 4s
Auto Changelog & Release / changelog-only (push) Successful in 8s
Auto Changelog & Release / release (push) Has been skipped
Build and upload Docker nightly image / build-and-push (push) Has been cancelled
- Introduce signal listeners for SIGINT and SIGTERM to handle shutdown
- Use AbortController to terminate the server gracefully
- Improve server reliability and resource cleanup during termination
2025-05-11 12:23:38 +02:00
3299419726 feat(logging): add debug logs for key validation and request handling
Some checks failed
Auto Changelog & Release / detect-version-change (push) Successful in 5s
Auto Changelog & Release / release (push) Has been skipped
Auto Changelog & Release / changelog-only (push) Successful in 8s
Build and upload Docker nightly image / build-and-push (push) Has been cancelled
- Add debug logs for invalid and valid API key masking
- Log unsupported content types in middleware
- Log forwarded request URLs and response statuses from LT server
2025-05-11 11:16:22 +02:00
79dfbcf053 feat(utils): add utility to mask API keys
- Introduces a function to mask API keys for improved security
- Masks null or short keys entirely with asterisks
- Partially masks longer keys, retaining the first five characters
2025-05-11 11:16:11 +02:00
b6763f7483 feat(handler): sanitize sensitive fields in form data
- Removes `username` and `apiKey` from form data to prevent errors
  from the LanguageTool server when these fields are present
- Updates test cases to reflect the new handling of form data bodies
2025-05-11 10:59:49 +02:00
4326a2d92c fix(auth): validate API key from POST body and handle content type
- Switch API key validation to use POST body parameters
- Add support for `application/x-www-form-urlencoded` content type
- Store parsed body in context state for further use
- Reject unsupported content types with 415 status
2025-05-11 10:59:39 +02:00
f9714cbb53 feat(proxy): add environment config and request handling
- Introduce environment-based configuration for proxy settings
- Add middleware for API key authentication
- Implement request forwarding to LanguageTool backend
- Set up server startup and routing logic
2025-05-11 01:10:54 +02:00
52ce172ef5 test(auth): add unit tests for ltProxyAuth and ltProxyHandler
- Add tests to validate ltProxyAuth behavior for valid, invalid, and missing API keys
- Add tests to verify ltProxyHandler correctly proxies requests and returns responses
2025-05-11 01:10:39 +02:00