This website requires JavaScript.
Explore
Help
Sign In
WebDev
/
webmarker-server
Watch
1
Star
0
Fork
You've already forked webmarker-server
0
Code
Issues
Pull Requests
Releases
Wiki
Activity
07ec036e4f
webmarker-server
/
src
/
main
/
resources
/
config.yml
2 lines
51 B
YAML
Raw
Normal View
History
Unescape
Escape
Implement RESTful API, JWT auth, SQLite storage This update brings a huge change to the whole system's structure. A new RESTful API has been implemented, which allows users to register, login and store data. The API only supports HTTP POST, and can be accessed via /api/v1/. Requests must contain a JSON body with the necessary entries, which are: /api/v1/register AND /api/v1/login: { "username": "username", "password": "password", "encoding": "plaintext/base64" } (Note: passwords can be encoded via "base64" or "plaintext".) /api/v1/store: { "jwt": "encrypted_key_here", "url": "https://google.com/" } The flow is: - register via /api/v1/register; - login via /api/v1/login, listen for JWT token in response; - store via /api/v1/store, by sending JWT and URL to store. The SQLite database now has 2 tables, "users" and "history". The "users" table is used to store user data: - username; - password, secured via bcrypt; - random user UUID. The "history" table is used to store browsing history: - user UUID, to identify the user; - browsed url. The secret used to sign JWTs is stored in the config.yml file. Other new features include SQL-injection protection, multiple validity/security checks on usernames and passwords, etc. Signed-off-by: Lorenzo DellacĂ <lorenzo.dellaca@mind-overflow.net>
2020-08-22 12:51:33 +02:00
port
:
7344
secret
:
'398JC3lDk1Ckaock3dcnc938COAk9d'