add a fetch token for blob urls

This commit is contained in:
Gregory Terzian 2020-02-13 00:18:14 +08:00
parent 4c5ec9da27
commit 895500e68c
10 changed files with 167 additions and 45 deletions

View file

@ -16,6 +16,20 @@ use uuid::Uuid;
/// File manager store entry's origin
pub type FileOrigin = String;
/// A token modulating access to a file for a blob URL.
pub enum FileTokenCheck {
/// Checking against a token not required,
/// used for accessing a file
/// that isn't linked to from a blob URL.
NotRequired,
/// Checking against token required.
Required(Uuid),
/// Request should always fail,
/// used for cases when a check is required,
/// but no token could be acquired.
ShouldFail,
}
/// Relative slice positions of a sequence,
/// whose semantic should be consistent with (start, end) parameters in
/// <https://w3c.github.io/FileAPI/#dfn-slice>
@ -125,7 +139,6 @@ pub enum FileManagerThreadMsg {
ReadFile(
IpcSender<FileManagerResult<ReadFileProgress>>,
Uuid,
bool,
FileOrigin,
),