Repository navigation
validate kv keys and handle request bodies after authentication - #329
Closed
LienThuan04 wants to merge 3 commits into
Closed
LienThuan04 wants to merge 3 commits into
LienThuan04 wants to merge 3 commits into
Conversation
Collaborator
|
Hi, Lanyard is designed to run behind a reverse proxy, so H2 will get terminated at the edge and Lanyard itself only does HTTP/1.1 that being said, we also do not support at this time any certs to be used by Lanyard so this would not work in the real word anyway. |
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.
Summary
Reject empty KV keys and authenticate PATCH/PUT KV writes before reading their bodies. Handle partial body reads without crashing, using an explicit 8,000,000-byte limit:
Bandit's native transport exceptions keep their existing handling. Reading one byte beyond the limit distinguishes an oversized body from an incomplete read below the limit; Bandit can return
:morefor an HTTP/2 timeout as well as for size limits.Evidence
mix test --no-start --warnings-as-errors— 29 tests pass. Before the final body-reader change, 8 cases failed, including small partial reads returning 413 instead of 408 and oversized complete reads reaching KV validation.mix compile --warnings-as-errorspasses in test and production environments with Elixir 1.19.MIX_ENV=prod mix releasepasses inelixir:1.19-alpine.mix format --check-formattedpasses for the complete tree in a temporary LF-normalized copy, and directly for every changed Elixir file.408 request_timeout.Tests use production routing, KV validation and presence updates, with a test Redis process and controlled Plug body-read results.
--no-startavoids starting the Discord bot or requiring external Redis credentials.Merge Danger
Door: two-way
Blast Radius: KV
Previously accepted empty keys are rejected on writes. Existing stored data is preserved, and the existing KV validation response codes are retained.