Repository navigation
A write token creates an api source as well as a statements source - #1274
Merged
Merged
Conversation
…ince both are push-only and a backend mirrors code and docs into a base as plain documents Signed-off-by: Bogdan Szabo <[email protected]>
WaylandYang
approved these changes
Oct 18, 2026
WaylandYang
left a comment
Contributor
There was a problem hiding this comment.
Thank you. On #1244 I said a token could create api sources if you needed them, and mirroring code and docs as plain documents is a good reason. api really is push-only: sync_source treats it as a passive container and fetches nothing even if an interval is set, and the push carries its content inline, so there is no address for the server to call and no stored credential. The coded 403 still refuses every other kind, sessions are unchanged, and is_push_kind keeps the guard and the three push-key routes on one list. One small thing for a later touch: the reflowed line in decision 6 runs past 100 columns. Merging.
This was referenced Oct 18, 2026
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.
Related: #1243 (a write token sets up a base and a
statementssource), #1271 (searching those documents one source at a time), #1268 (anapipush keeps itsexternal_id).What happened
A write token can set up a base and a
statementssource (0014 decision 6), but a backend that also mirrors code and docs pushes those as plain documents through anapisource, and creating one took a session.What changed
sources_routes::createlets a token create both push-only kinds,statementsandapi: the server fetches nothing for either, and the client pushes with the source key fromingest_token.url,rssandcustom, which the server polls (andcustomwith a stored credential), still need a session; the refusal message names both allowed kinds.has_push_token(&Source)becomesis_push_kind(&str)so the guard and the three existing callers share one list of push-only kinds.0014 decision 6 and
access-and-audit.mdsay "astatementsorapisource", with one dated revision.Tests
a_write_token_creates_an_api_source_and_reads_its_push_key(api::token_setup_tests): a write token creates anapisource and reads its push key. It fails without the change with 403token_source_kind; the existing refusal forurlstays.Run in
rust:1-slim-bookwormagainst Postgres withUTOPIA_TEST_REQUIRE_DB=1:cargo fmt --all --checkandcargo clippy --workspace --all-targets -- -D warningsclean;cargo test -p utopia-server token_setup5 passed.