Repository navigation
Conversation
This was referenced Nov 5, 2026
- The API diagram workflow rendered any famid/samid/funid it was given, so any visitor could add one PNG per id to the unbounded diagram cache (the 1.7.0 fix from #145, reopened). The report-membership check is now data.diagram_filter_in_report, shared by data.diagram_file and the API; an id the report did not match gets 404 and writes no file. - /api is exempt from CSRF because a cross-site request cannot carry an apitoken, but auth/token and auth/register take none. A plain HTML form could post to them, and on a fresh instance create the admin and set the backend URL. Both now accept only application/json and answer anything else with 415. No other /api route works without a token. - samples/<id>/smda and samples/<id>/binary need a contributor. Below that, the UI has no way to download what a sample was submitted as; only the contributor-level corpus export does. - A role with a query upload cap may no longer rerun query jobs at all. The ownership test compared job.username with the caller's name, and usernames are renamed and reused (ADR-0007), so whoever took a freed or renamed name passed it. With no stable owner there is no safe test. - testApiSurfaceCoverage now checks that every API operation a UI route maps to needs at least that route's role in routePolicy.py. The one exception, data.submit_or_query mapping to the visitor-level POST query, is listed with its reason (analyze.query is visitor-level). - GET matches/function/<id> forwards to getMatchFunctionVs(id, None) again, as on master, instead of queueing a whole-sample match job. - The browser's promote_query error redirect uses the backend's job id again, not the id as typed. - Malformed integers in query_options (start/limit on jobs) get 400 instead of silently becoming the default. band_df_cutoff_coverage checks its band_df_cutoff the same way the matching options do, instead of forwarding it as typed. - Remove the unused CONTRIBUTOR_ONLY and requires_contributor, and the job-export branch of specific_export that its route can never reach. Correct AGENTS.md, which still pointed at CONTRIBUTOR_ONLY, and the comments saying pending tokens get nothing: they reach their own account and capabilities. docs/api.md describes all of the above.
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 #345.
The token API could perform only part of the workflows available in the browser. This adds 103 operations covering the 70 current UI routes: account setup and preferences, corpus browsing and edits, analysis submission and results, LinkHunt, YARA, diagrams and function graphs/diffs, query promotion, import/export, and user/server administration.
data.submit_or_querymapping to the visitor-levelPOST query, asanalyze.queryis visitor-level.samples/<id>/smdaandsamples/<id>/binaryneed a contributor, as the corpus export does; no lower UI role can download what a sample was submitted as./apiis exempt from CSRF because a cross-site request cannot send an apitoken. The two routes that take none,auth/tokenandauth/register, accept onlyapplication/jsonand answer anything else with 415, so a form on another site cannot configure a fresh instance.band_df_cutoffget 400 rather than a default or a value forwarded as typed.GET matches/function/<id>forwards togetMatchFunctionVs(id, None)as on master. Maintenance uses POST on this API. Version-dependent tags, reruns and extended backend options return 501 when unsupported; GET /api/capabilities describes available operations.Measured validation:
ruff check .andgit diff --checkpassed.Based on current master, 8fd5a8c, and validated with current MCRIT main, 37d69c42fb94b508f54d4f2db022942a0f46a2e5. The companion LocalQueue statistics fix discovered during live validation is familiary/mcrit#317.