Repository navigation
fix(contributions): downloadUrl reaches a member only through the grant (#908) - #926
Merged
Merged
Conversation
…nt (#908) The release contributions list sent every reader each contribution's URL, so a direct API caller could skip POST /contributions/:id/access and its debit. The list drops the field for every reader, and #905's report-scoped blank goes with it. The contract stops declaring downloadUrl on ReleaseContributionDetail, ReleaseContribution and Contribution; the last two never sent it. The uploader's own GET /contributions keeps it, as the new OwnContribution. contributionDownloadUrl.spec.ts counts, per file, every query that comes back holding the URL against a reasoned allowlist. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Up to standards ✅🟢 Issues
|
| Metric | Results |
|---|---|
| Complexity | 47 |
NEW Get contextual insights on your PRs based on Codacy's metrics, along with PR and Jira context, without leaving GitHub. Enable AI reviewer
TIP This summary will be updated as you push new changes.
…mplexity limit (#908) Co-Authored-By: Claude Opus 5.5 <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.
Closes #908. The grill outcome is on the issue.
The leak
GET /communities/{id}/releases/{releaseId}/contributionssent every release reader each contribution'sdownloadUrl. A direct API caller could skipPOST /contributions/{id}/access, and with it thecanDownloadcheck and the debit. The ui never read the field there.The change
downloadUrlfrom its select, for every reader. feat(reports): a report opens the release it concerns, for reports_manage (ADR-0055) #905'sreportScoped ? '' : …blank goes too: there's nothing left to blank.ReleaseContributionDetaildrops the field.ReleaseContribution(the release detail'scontributions[]) andContributiondrop it too. Both declared it as required, but their reads never sent it.GET /contributions, the uploader's own uploads and the only list that sends the field, now declares the newOwnContribution(=Contribution+downloadUrl).contributionDownloadUrl.spec.ts: a source scan that counts, per file, the three ways a query comes back holding the URL: adownloadUrl: trueselect, acontributioncall with noselect, and a whole-rowinclude. The counts are checked against an allowlist where each entry has its reason.### Changed. feat(reports): a report opens the release it concerns, for reports_manage (ADR-0055) #905's unreleased entry is corrected in place.A fact that came up while building. The grill assumed
POST /contributionsreturned the URL to the uploader. It doesn't:contributionSelectnever selects it. So the split is the inverse of the one described:Contributionloses the field, andOwnContributionadds it for the one read that sends it. The agreed principle, that a schema declares only what its read sends, is unchanged.Verification
downloadUrlkey. It fails on main, where it receivedhttps://example.com/kob.torrent.downloadUrl: trueback in the list's select) is caught by the scan spec.releaseWorkbench,reportScopedReleaseandratioExemptReadspass (18 tests).tsc,typecheck:test,openapi:completeness,openapi:failure-coverageandchangelog:checkare clean.openapi.jsonbefore merging:OwnContributioncomes out asContribution & { downloadUrl: string }, and uitscreports exactly two errors. Both are listed on stellar-ui#478, the follow-up.Filed from the grill
🤖 Generated with Claude Code