Repository navigation
fix(api): a transaction stages a Turtle upsert as it stages the other operations - #2108
Merged
Merged
Conversation
… operations A `Transaction` stages each operation through the staging lane for its kind. The Turtle upsert lane now receives the transaction's policy context, as the JSON-LD, Turtle insert, SPARQL and graph lanes do. Test: every_kind_of_operation_is_checked_against_the_policy stages each kind of operation under a ledger whose config denies writes by default, and expects each to be refused with the ledger unchanged.
1 of 2 tasks
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.
A
Transactionstages each operation through the staging lane for its kind: JSON-LD, Turtle insert, Turtle upsert or SPARQL UPDATE. The Turtle upsert lane now receives the transaction's policy context, as the other lanes do.Changes
fluree-db-api:stage_plan's Turtle upsert arm passes the policy context it is given tostage_rdf_text_tracked, like its other arms.every_kind_of_operation_is_checked_against_the_policy(it_transaction) stages each kind of operation (JSON-LD insert, upsert and update, Turtle insert and upsert, SPARQL UPDATE) in aTransactionon a ledger whose config denies writes by default, and expects each one to be refused with the ledger unchanged. It fails without the change.The builder path is unchanged: a policy-scoped builder request already stages a Turtle upsert with its policy.
#2009 makes the same change as part of its staging rework, with the same test; this lands it on its own first. When #2009 is rebased onto it, the one conflict is that argument list, and #2009's side is the resolution.
Gates
-D warningsonfluree-db-api, all features and default features;grp_transact(which holdsit_transaction): 298 passed, withshacl,graphqland with default features;fluree-db-transact: 386 passed.The new test fails on
mainwithout the change and passes with it.