Repository navigation
[#31] Limit anonymous log reads and rate limit public endpoints - #52
Conversation
sksingh2005
left a comment
There was a problem hiding this comment.
Please fix the overlapping log loads before merging. A build status change can trigger load() while an earlier request is pending. Both requests can read from the same offset and increment offsetRef.current, while only one response remains displayed.
I reproduced this with two responses containing abc: the view displays abc, but the next refresh requests offset 6 instead of 3, skipping output.
Please cancel or ignore superseded requests, update the offset only for the accepted response, and add a regression test for overlapping loads.
e4a9485 to
d06b322
Compare
|
@Mohamed-Alkafory @sksingh2005 @jesperpedersen i went thru the code and i am bit skeptical about security here, but idk how big of the concern it really is, so i would appreciate ur thoughts on it aswell.
there are some more, but not as imp as these |
d06b322 to
1e75742
Compare
|
Thanks @ecleon26, good catches both were valid. Fixed: the limiter now evicts the oldest window instead of returning 429, so a full client map can’t lock out new visitors. Anonymous downloads now honor Retry-After and continue from the same offset with bounded retries, so large logs complete across windows. |
|
LGTM. |
|
Merged. Thanks for the contribution. |
Closes #31
Anonymous log reads are capped at
PUBLIC_LOG_MAX_BYTES(2 MiB default) perresponse, with
offset/limit/tailandX-Log-*headers for paging.Signed-in callers still get the full log. Anonymous requests to
/api/project-pages/**and/api/stats/publicare rate limited per clientaddress, returning
429withRetry-After. The public page pauses polling whilehidden and backs off when idle, and the log view appends new output, switches to
the tail when the inline view is full, and pages the full download.