routes: User route mod exposes routes() now Other routes already did this to keep the routes clean when mounting. Now the user routes do too.
Dependencies
- [2]
FS2NWBVNpijul: Start of push/pull work This change includes one API endpoint, .pijul. It allows for getting a channels remote ID. A lot of plumbing around repositories is added too, from init to opening pristine and actions like it. - [3]
5UNA2DEAroutes: Register and authenticate users Allow users to sign up, and sign in/sign out. The routes are added, though the design of the pages is very bare bones still, it's hard to go through the full flow to demo. On the server side: Passwords are stored encrypted in the database with salts. This uses the PG encrypt tooling to prevent against bugs and maintainance costs on this project. When a user is signed in, the user ID is set in a private cookie. Rocket has Guards for routes, which has not been implemented yet for this project. - [4]
T7TT5B4Gmodels: Put User model in their own file Before adding a next model, let's start organizing the code a little, to make extending easier. - [5]
K4JNAJOFdatabase: Connect to postgres on Rocket boot As database I've chosen PostgreSQL, as my personal experience has been good with it. This change allows Rocket to connect to the database on booting the server. It depends on the DATABASE_URL being set, and for now circumvents the Rocket config helpers as it seemed faster to be up and running this way. - [6]
TWIZ7QV4db: Add interface to add a project Right now a project has a name, and an owner which is hardcoded to 1. This is because basically I'm speedrunning to implement push/pull of Pijul and then revisit to add depth to features and tests. Model code is now split into files properly too. - [7]
KFVJ3KMWfrontend: Introduce navigation bar Minor changes to the front-end mostly, to allow users to register, sign in, and sign out. The sign out route is changed to a GET endpoint, as links in HTML cannot DELETE. - [*]
W3M3C7CCInitial commit This change includes a very small hello world application server written in Rust using Rocket.rs. Managing dependencies is done with Nix as that works well between Linux and Mac for me.
Change contents
- replacement in src/users.rs at line 5
State,Route, State, - replacement in src/users.rs at line 13
pub fn new_user() -> Template {fn new() -> Template { - replacement in src/users.rs at line 18
pub struct NewUser {struct NewUser { - replacement in src/users.rs at line 29
pub async fn create(async fn create( - replacement in src/users.rs at line 56
pub struct SignIn {struct SignIn { - replacement in src/users.rs at line 64
pub async fn get_sign_in() -> Template {async fn get_sign_in() -> Template { - replacement in src/users.rs at line 69
pub async fn sign_in(async fn sign_in( - replacement in src/users.rs at line 95
pub fn sign_out(jar: &CookieJar<'_>) -> Flash<Redirect> {fn sign_out(jar: &CookieJar<'_>) -> Flash<Redirect> { - edit in src/users.rs at line 104[3.5290]
pub fn routes() -> Vec<Route> {routes![new, create, get_sign_in, sign_in, sign_out]} - replacement in src/main.rs at line 27
.mount("/users",routes![users::new_user,users::create,users::get_sign_in,users::sign_in,users::sign_out],).mount("/users", users::routes())