-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
storagefiles: add a storagefile support in the db (#13)
* storagefiles: add a storagefile support in the db * storagefile: remove the need for extra base64str validation, move the ReturnType def to otypes * Fix variable error in queries * New document creation check should be case insensitive * Fix create and edit function object creation error. Removed extra class for inputs of storage, and remove extra check for base64 string * Chnage from Base64Str to Base64Bytes * storagefile: otypes: using underscore for consistency * storagefiles: query: add optional argument filetype * storagefiles: switch back from base64 to using str * Minor fix * Pass inter communication secret to signed-url API * Remove unwanted query and fix the storageFiles query * re-add single storagefile API * storagefiles: fix conflicts when rebasing master * storagefiles: fix conflicts when rebasing master * Static file delete, change variable names --------- Co-authored-by: notpua <[email protected]> Co-authored-by: Bhav Beri <[email protected]> Co-authored-by: Bhav Beri <[email protected]>
- Loading branch information
1 parent
28dd13a
commit 3d311e0
Showing
6 changed files
with
229 additions
and
9 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -16,3 +16,4 @@ | |
# get database | ||
db = client[MONGO_DATABASE] | ||
ccdb = db.cc | ||
docsstoragedb = db.docsstorage |
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
import os | ||
|
||
import requests | ||
|
||
inter_communication_secret = os.getenv("INTER_COMMUNICATION_SECRET") | ||
|
||
def delete_file(filename): | ||
response = requests.post( | ||
"http://files/delete-file", | ||
params={ | ||
"filename": filename, | ||
"inter_communication_secret": inter_communication_secret, | ||
"static_file": "true", | ||
}, | ||
) | ||
|
||
if response.status_code != 200: | ||
raise Exception(response.text) | ||
|
||
return response.text |