GSoC Project: https://summerofcode.withgoogle.com/projects/#5810607317581824

Student: @hackerchai Mentors: @GopherJ @xcaptain @nodece @hsluoyz IM Channel: TBD
Weekly reports will be appended as replies by the student.
Diesel orm library and trying to optimize SQL in sqlx adapterActix and dieselRocket to check how Roccket implements MiddlewareFirst of all, the highest priority job is to implement a real-world-app using actix-casbin-auth, after discussion with my mentor, I decide to write an anonymous shudong to give an example of casbin-rs with RBAC model. I will choose PostgreSQL as database backend and JWT as default authentication method.
As for Rocket, the middleware is called Fairings. So it is available for us to implement a middleware similar to Actix.
For docker environment, I am using https://github.com/hackerchai/docker-rust-web.
Casbin-rs has released the 1.0.0 version. Some functions have been made into sync and some functions have been deprecated. Through the benchmark, casbin-rs has a huge performance improvement.
Besides, the add_matching_fn function has been deprecated. But it is needed in real-world circumstance. So it is of necessity to bring it back in next release and also improve its performance.
add_matching_fn function backSince add_matching_fn function has been deprecated in casbin 1.0.0, I found that without matching_fn function I ccan still implement similiar feature using KeyMatch2 in confifuration file. So we will still use this in the real-world app.
Since pattern is removed from casbin new version, I use KeyMatch function in p policies instead. So I bump a new version of casbin.
User finishDue to the final exam in university, merge two weeks into one report. Mainly working on the User model of real-world-app.
This week, I am working on the service and controller part of user system. I met some Diesel issues and they are tough to solve. With the help of my mentor and blog posts, I finally solved them.
In my coding time this week, I found that in real-world we can not generate two enforcers in the app. Or it will be mistakes with data syncing. So the middleware and actor should share the same enforcer. So I make commits to implement this.
Besides, I am woking on Post model and service. When handling new_post object, there are some fields not providing by the user's request, so I use serde default field feature to implement this finally.
Post controller
JWT middleware
This week, I add JWT middleware to real-world-app. Due to support the casbin middleware I put user's username into Actix Extensions which can be also retieved in the HttpRequest when handling data. To difference user's login state, I add LoginSession into user table, and put it into JWT body to check whether whe user is logout.
This week, I intergrate casbin actor into the project and encountered bugs. Because casbin new version doesn't dupport pattern in g policies (like "g2, /post/:id, post_group"), so I have to use p policies instead.
This week, I successfully intergrated casbin middleware into real-world-app. Althouth the dead lock problem costs me few days to work on it. But thanks to my mentor's help, I finally found the problem.
The real-world-app development is finished.