Disallow sources to access or delete their own submissions #13
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.
Basic testing done, working as expected. Fixes #10.
It turns out the codebase already distinguished between
file_id
andfile_name
, both of which are randomly generatedsecrets.token_hex(32)
values. This adapts the use of these variables, makingfile_id
knowable by the source, and changesfile_name
to be used to access/delete a particular file.Journalists create a signed map of
file_id
andfile_name
key/values, which they share. Any long-term journalist signature is verified by the server, adding the respective mappings as members to thefile_token
redis set. This then allows the server to tell sources what they're allowed to learn (file_id
) when submitting anything, while journalists can infer what they need to learn (file_name
) when they receive messages or want to reply to a source. In the case of the latter, sources have to be told what they needs to know (file_name
) by journalists without supplying other details of the public/privatefile_id
/file_name
map.Notes
file_name
for file-system names andfile_id
for database/remote access names, but as far as I can tell there is no need to hide on-disk file names from recipients. Happy to adapt if this is still something we want to continue to do.messages-as-attachments
(i.e. Treat messages and metadata as attachments #8), as protocol symmetry is a key point of this change (even though it could be adapted to just not send replies as file uploads, i.e. the source would not need to learnfile_name
)