test(integration): cover content authorization end to end on the devnet - #574
Open
rickyrombo wants to merge 1 commit into
Open
test(integration): cover content authorization end to end on the devnet#574rickyrombo wants to merge 1 commit into
rickyrombo wants to merge 1 commit into
Conversation
Unit tests pin each piece of content auth; nothing ran the whole chain. This uploads audio over tus with an asserted user to one node, waits for the attestation to commit before the upload reads done, and validates track writes at a different node's mempool: the owner's create passes, another user naming the same cid is rejected, an unattested cid is rejected, and edits that resend the cids (as the web client does) keep passing. Also pins that an audio upload naming no user is refused at tus create, and it caught the pre-#570 done-without-cid race on a stale devnet image. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
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.
Why
Content authorization (#477, #476) had thorough unit coverage and no end-to-end coverage: nothing uploaded audio with an asserted user, waited for the validator's attestation, and then tried the track writes that enforcement exists for. The devnet activates both
AuthEnforcementHeightandContentAuthEnforcementHeightat height 1, and CI runsmake test-integrationagainst it, so this now runs on every PR.What it checks
Uploads go to node 2, writes go to node 1. Claims are consensus state, so a node that never saw the bytes must still enforce them.
userIdis refused with 400 — it could never be attested, so fail before the bytes are sent.done, the owner's track create namingtrack_cidandorig_file_cidis accepted.doneis only written after the attestation commits, so this is the ordering guarantee under test.was not uploaded for user.is not attested to any uploader.Track updates are not projected at consensus (ownership on update is the ETL's rule), so 5 and 6 exercise the content-auth check alone.
Verified
Green against a devnet built from current
main(88de83c9), 12.7s. On a devnet whose nodes 2–4 ran the image from before #570, case 2 failed withdoneand no320result — the exact race #570 fixed — so the test discriminates.Along the way: the multipart
/uploadspath and the Go SDK'sUploadFilesTuscarry nouserId, so neither can produce a claimable audio upload on a gated network. The JS SDK does. Worth a follow-up if the Go SDK is meant to upload audio.🤖 Generated with Claude Code