Instantly share code, notes, and snippets.
I make the ones and zeros dance. Staff Security Engineer working mostly with Python and AWS.
- Bay Area
- https://0xda.de
- @0xdade
0xdade
/ secure_file_submit_share.txt
Last active
April 30, 2021 07:07
Some design thoughts on building an open source solution for solving the "simple secure file submission" and "simple secure file share" problems
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
User Experience: | |
Workflow: | |
(Optional) Click pre-authenticated upload url, if provided | |
(Optional) Sign in, if required | |
Drag and drop a file | |
interface shows the file name (and maybe some additional metadata, not sure if we get any metadata at this point though) | |
Set of checkboxes for the following (if they are not enforced to a specific value by the server operator): | |
Save Encryption Key | |
Burn After Reading | |
Expiration Duration |
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
# First approach, just make a function manually for every tag | |
# Then feed them all back to the same core html_element function for rendering | |
import inspect | |
import sys | |
def html_element(*args, **kwargs): | |
tag = inspect.stack()[1][3] | |
attrs = [f"{kwarg}=\"{kwargs.get(kwarg)}\"" for kwarg in kwargs] | |
children = "\n".join([f"{child}" for child in args]) | |
return f'<{tag}{" " if attrs else ""}{" ".join(attrs)}>{children}</{tag}>' |
OlderNewer