Merged
Conversation
- Require 'Authorization: Bearer <token>' header or '?token=<token>' query param - Validate against configured token using constant-time comparison - Reject unauthorized connections in onOpen - Updated GatewayE2ETest to send auth headers
Co-authored-by: devin-ai-integration[bot] <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Co-authored-by: devin-ai-integration[bot] <158243242+devin-ai-integration[bot]@users.noreply.github.com>
- Add GATEWAY_AUTH_TOKEN and GATEWAY_PORT environment variable support. - Bind GatewayServer to 0.0.0.0 for container compatibility. - Optimize authenticated client lookups using a Set. - Improve query parameter token extraction robustness. - Add null safety for gateway configuration.
Comment on lines
+44
to
+45
| } catch (NumberFormatException ignored) { | ||
| } |
Contributor
There was a problem hiding this comment.
🟡 Silent failure on invalid GATEWAY_PORT environment variable
When GATEWAY_PORT is set to a non-numeric value (e.g., GATEWAY_PORT=abc), the NumberFormatException is silently caught and ignored, leaving the port at its default value without any indication to the user.
Impact and Details
At ConfigLoader.java:44, the catch block is empty:
} catch (NumberFormatException ignored) {
}This means if a user sets GATEWAY_PORT=abc or GATEWAY_PORT=99999, the application will silently use the default port (18789) instead. The user would have no way to know their configuration was ignored, potentially leading to port conflicts or the application listening on an unexpected port. At minimum, this should log a warning.
Suggested change
| } catch (NumberFormatException ignored) { | |
| } | |
| } catch (NumberFormatException e) { | |
| System.err.println("WARNING: Invalid GATEWAY_PORT value '" + envPort + "', using default port"); | |
| } |
Was this helpful? React with 👍 or 👎 to provide feedback.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.