Commit Graph

70 Commits (c3731bf0f31a6f40edb7d9fee4c6b4cde77b26c9)

Author SHA1 Message Date
absc c3731bf0f3 The back-end does not depend from ranch and cowboy. 2024-09-15 12:44:10 +00:00
absc 9fd60a2dfa The main includes are from the back-end. 2024-09-15 12:41:47 +00:00
absc 5f14a4f6cb Start to split the back-end further in more minor processes.
The back-end will expose only the public APIs to be consumed
by the listeners. The new users server takes care of the users
management.

Other subsystems will follow (i.e. GUI, fedi, blog etc..).
2024-09-15 12:14:29 +00:00
absc e5631798ce Corrected compilation problems. 2024-09-10 19:47:53 +00:00
absc b357ae8124 Correct application files. 2024-09-10 19:43:08 +00:00
absc eebf62d527 Split the web front-end and the backend into separate applications.
This design will make things easier to both scale and test.
Having a dedicated back-end application allow us to keep the API
stable, while improving the internals.
2024-09-10 19:40:30 +00:00
absc 31da1067da Add the backend app.
Better to split the main functions in it's separate application.
This will be used by all the other part of the dudeswave
experience.
2024-09-09 20:14:18 +00:00
absc 0e7c173cba Corrected the usage of ERLFLAGS. 2024-08-15 22:48:21 +00:00
absc 45b5bc3d2d Corrected documentation string. 2024-08-15 22:44:45 +00:00
absc 18a430614f Use proplists instead of lists. 2024-08-15 22:39:22 +00:00
absc e95e91b645 The defines file is not needed here. 2024-08-15 22:15:57 +00:00
absc ae07951cd2 Add the authentication handler to the routes. 2024-08-15 22:11:19 +00:00
absc 1ca3e1f4ef No need to mention the cookies. 2024-08-15 22:08:46 +00:00
absc eb58109292 Add the macros file. 2024-08-15 22:03:30 +00:00
absc 861f3e0258 Use macros for the cookie names. 2024-08-15 22:02:57 +00:00
absc 812b182499 Abstract updating user informations. 2024-08-15 21:59:35 +00:00
absc bbb44f9337 Make reading the registration data a more abstract operation. 2024-08-15 21:54:41 +00:00
absc b3cdc8ee45 Abstract reading the login data from the request. 2024-08-15 21:45:36 +00:00
absc f9d3c5fa4b Make indentation consistent. 2024-08-15 21:26:22 +00:00
absc a3f041cff7 Remove not needed newline. 2024-08-15 21:22:54 +00:00
absc 38d8e29734 Abstract setting the cookie for the client request. 2024-08-15 21:20:38 +00:00
absc c9fcd47064 Abstract cookies invalidation. 2024-08-15 21:12:07 +00:00
absc a18fa4989c Use the auth_cookie function to extract cookies. 2024-08-15 21:02:41 +00:00
absc dac21c4537 Abstract cookie handling. 2024-08-15 21:00:06 +00:00
absc a0cbc962d1 Corrected call to authenticate. 2024-08-15 20:41:30 +00:00
absc 29cb046e3d Corrected authenticate function calls. 2024-08-15 20:37:08 +00:00
absc 73d98ed56f Move the defines in their own file.
At the same time, simplify a bunch of APIs.
2024-08-15 20:27:02 +00:00
absc e7e34d78d6 We plan to use this with a reverse proxy. The plan may change in the future. 2024-08-12 21:01:16 +00:00
absc e8ccc3a29f Keep it simple for now. We want to write a proper test suite for this and
letting it crash is more than good enough.

It was a mistake to try to add more complications to the APIs at this point
in time.
2024-08-12 21:00:26 +00:00
absc 2ad3b52c06 Corrected syntax error. 2024-08-12 20:41:24 +00:00
absc f60a8b1725 Import "gun", the HTTP client. We will use it for the tests and the
ActivityPub activities.
2024-08-11 22:08:52 +00:00
absc 640ffe4d75 Corrected stuffs found through the dialyzer. 2024-08-11 20:56:11 +00:00
absc 2b530fbe7e Added some more detailed responses to the JSON API calls. 2024-08-11 20:49:48 +00:00
absc 2d0d384d1e Add the JSON body to the user API responses. 2024-08-09 22:35:53 +00:00
absc dcc7bc3ca3 Introduce the authentication handler.
The user handler will also receive the ability to answer with
JSON bodies soon.
2024-08-09 22:19:17 +00:00
absc 51675065a9 Pass the user for authentication with cookies in a cookie itself. 2024-08-09 20:37:47 +00:00
absc 6acd5e3a5a Move the cookie parameter as value. 2024-08-09 19:50:19 +00:00
absc 318ab0d301 Corrected module documentation. 2024-08-07 22:19:11 +00:00
absc ceea61c1ed Add the username to the JSON response to GET.
In addition to this, version the API with the classic
"api/v1" path.
2024-08-07 22:10:45 +00:00
absc df09a192b0 Updated function documentation specification. 2024-08-07 20:26:38 +00:00
absc 3b9693e276 Properly set the cookie validity, and return it to the
caller along with the cookie itself.
2024-08-07 20:22:45 +00:00
absc 9bf0e3609a Replace hard-coded value with the macro. 2024-08-07 01:23:30 +02:00
absc b06e7d9f50 Complete the registration API.
After some fight to decide on the right design, we finally have
a module to handle users details.

The API is JSON-based and it's documented on the top of the
dudeswave_handler.erl file.

The dudeswave_auth module, implements the functions that handle
things at the storage layer, as we would like to reuse those
capabilties in the future.

To add, the "delete" call doesn't handle removing the cookies for
the moment, It'll come with the next commit.

Additionally, after that, a related test suite will be added, in
order to start to test the whole thing locally.
2024-08-07 01:17:35 +02:00
absc 2b995f67c8 After some internal (with myself) debate, we will go with JSON.
It just makes much more sense, to build a decent and modern
platform.
2024-08-04 13:54:46 +02:00
absc 96781451b0 Improve the registration bit.
Now, we return a proper answer when creating a user through a
POST request.

Maybe in the future we will convert the APIs to use JSON, like
all cool kids do. However, it doesn't look like it makes much
sense in this case.
2024-08-03 01:13:47 +02:00
absc fa66ec399d We only allow POST for the registration form. 2024-08-02 23:46:24 +02:00
absc 2470af1296 Give a better name to the registration handler. 2024-08-02 23:43:03 +02:00
absc 631f729ed9 No, JSON is not needed here.
For this simple blogging platform, let's start simple, basic
HTML forms are enough.
2024-08-02 23:40:55 +02:00
absc 33cc07914d Complete the GET handler. It would return some wrong codes before. 2024-08-02 23:24:54 +02:00
absc f1ad05f789 Make the ip address type configurable.
We want to be able to use both IPv4 and IPv6.
2024-08-02 23:15:28 +02:00