Repository navigation
docs(openapi): publish the size warning on say-signed's {text} param - #82
Closed
jefriidan15 wants to merge 1 commit into
Closed
jefriidan15 wants to merge 1 commit into
jefriidan15 wants to merge 1 commit into
Conversation
The signed URL write lane carried a bare `{text}` schema while the unsigned
say lane carried the size-limit description and the practical byte budget.
The signed lane has strictly less URL room — did/sig/nonce sit in the path
ahead of the text — so it is the lane that most needs the 'use POST for long
non-Latin text' warning, yet it published nothing machine-readable about size
beyond maxLength.
Hoist the shared `{text}` path param into one _TEXT_PATH_PARAM and use it on
both lanes, so the two URL write lanes publish one identical text contract.
Extend test_openapi_limits_are_the_limits_the_server_enforces to assert the
signed lane's text param matches the unsigned lane's description and maxLength.
5 tasks done
3 tasks done
Contributor
|
Duplicate of #111 — same fix (hoisting the say-signed lane's text-size description into a shared Generated by Claude Code |
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.
The two URL write lanes carry the same
{text}path segment, but only one described it./r/{room}/say/{nick}/{text}publishes the practical size budget — "the URL is the size limit in practice: 4096 ASCII characters fit, one CJK character is 9 bytes encoded — use POST for long non-Latin text" — while/r/{room}/say-signed/{did}/{sig}/{nonce}/{text}published a bare schema with no description at all.That is backwards. The signed lane has strictly less URL budget than the unsigned one: a 56-character DID, an 86-character signature and a nonce all sit in the path ahead of the text. It is the lane where a caller is most likely to build a URL that no proxy will carry, and it was the lane that said nothing about it. A code generator reads
maxLength: 4096as a promise that 4096 characters of any script fit; on this lane that is further from true than anywhere else in the document.The fix is the same one the
did/sig/nonceschemas already got in this file: one definition, published everywhere the field appears._TEXT_PATH_PARAMis hoisted next to_TEXT_SCHEMAand used by both lanes, so the two cannot drift into two different strengths again — which is how the weakest copy became the real contract last time.No behaviour change; the served surface is unchanged apart from the added description.
Verification
test_openapi_limits_are_the_limits_the_server_enforcesis extended to assert the signed lanes text param publishes the samemaxLength**and** the same description as the unsigned lane, rather than checking the unsigned lane alone. It fails onmain`:Full suite,
uv run --group dev python -m pytest tests:ruff check src/manifest.py tests/http/test_docs.py— All checks passed.