You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+15Lines changed: 15 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -37,6 +37,8 @@ One exciting feature is the `?verify=<email>` parameter when requesting the path
37
37
38
38
There is more. One can POST his cryptographic public key at his private_path for his users to consume at the corresponding public_path. His users then POST to the public_path as application/base64 their data encrypted with that public key for him to decrypt upon a subsequent GET at the private_path. This ensures the relay is end-to-end encrypted, not even the Securelay server can read user data.
39
39
40
+
Note that in all the above securelay doesn't require an any API key for protecting data. The private path itself serves as one. Data can be overwritten only by the owner of the private path.
41
+
40
42
# Limits
41
43
To mitigate abuse, the API accepts only two enctype modes. Securelay validates the data to see it is only of these two types.
42
44
1. application/x-www-form-urlencoded. Securelay parses data into JSON to validate and returns as application/json on GET.
@@ -48,6 +50,15 @@ Another limit is imposed on how long POSTed data persists.
48
50
49
51
Requests to all private paths are heavily rate-limited, say, at max 1 request per minute.
50
52
53
+
# Use cases
54
+
- Forms
55
+
- Comments
56
+
- Chats
57
+
- PubSub
58
+
- Dynamic Key Value Store
59
+
- Single click URL shortener
60
+
- Configuration sharing between microservices
61
+
51
62
# Possible Implementation
52
63
53
64
Python using flask /fastapi. Or NodeJS using fastify.
@@ -61,3 +72,7 @@ Set expiry by using `const uid = settimeout(delete(filepath), timeWindow)`. If f
61
72
Perhaps a good way to use lock in npm:fs is using callback function with async [fs.mkdir](https://nodejs.org/api/fs.html#fsmkdirpath-options-callback). The callback simply is a closure containing the data to append to the path. Callback also deletes the dir upon completion, thus releasing the lock.
62
73
63
74
Use fs.watch with callback for executing the callback whenever a file changes. [Here](https://thisdavej.com/how-to-watch-for-file-changes-in-node-js/) is the way. Use md5 hash or debounce (timeout delays) if need be as mentioned in the article.
75
+
76
+
If using [fastify](https://fastify.dev/docs/latest/Guides/Getting-Started/), also use these plugins: [@fastify/cors](https://github.com/fastify/fastify-cors) and [@fastify/form-body](https://github.com/fastify/fastify-formbody).
77
+
78
+
If an in memory scheduler is required, use [toad-scheduler](https://github.com/kibertoad/toad-scheduler) and [@fastify/schedule](https://github.com/fastify/fastify-schedule).
0 commit comments