Skip to content

Commit dcf2ebd

Browse files
authored
Update README.md
1 parent a26974e commit dcf2ebd

1 file changed

Lines changed: 15 additions & 0 deletions

File tree

README.md

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,8 @@ One exciting feature is the `?verify=<email>` parameter when requesting the path
3737

3838
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.
3939

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+
4042
# Limits
4143
To mitigate abuse, the API accepts only two enctype modes. Securelay validates the data to see it is only of these two types.
4244
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.
4850

4951
Requests to all private paths are heavily rate-limited, say, at max 1 request per minute.
5052

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+
5162
# Possible Implementation
5263

5364
Python using flask /fastapi. Or NodeJS using fastify.
@@ -61,3 +72,7 @@ Set expiry by using `const uid = settimeout(delete(filepath), timeWindow)`. If f
6172
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.
6273

6374
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

Comments
 (0)