The certificate of completion of Google Summer of Code 22 at Casbin organisation can be found here
- First/Last Name: Siddhesh Kanawade
- Email: siddhesh.kanawade@iitgn.ac.in
- School/University: Indian Institute of Technology Gandhinagar
- Location: Nashik, Maharashtra, India
- Timezone: Indian standard time (IST), GMT +5:30
- Github Profile: https://github.com/SiddheshKanawade
-
Student: Siddhesh Kanawade
-
Mentors: Yang Luo, Yi sheng Chai
-
Organization: Casbin
-
Project Name: Casbin for Rust
With the efforts of Casbin Community, the Rust version of the Casbin is now ready for production. Casbin-RS can provide access control with blazing fast speed. In the past months, I have developed axum-casbin-auth which is a Casbin access control middleware for axum framework. To understand the implementation of axum-casbin-auth, I have also added a axum-middleware-example, which is a real world based example demonstrating usage of axum-casbin-auth with real applications. All the applications which I worked on now have Github Action CI setup which ensure proper PR checks.
Axum is a web application framework that focuses on ergonomics and modularity. Axum doesn't have its own middleware system, but instead it uses tower::Service
. This means axum gets timeouts, tracing, compression, authorization and other compatible tower functionalities for free. It also enables you to share middleware with applications written using hyper or tonic. In the past months, I had been working on integrating Casbin with Axum-web framework.
With axum-casbin-auth, we can now have a basic middleware to handle requests with authorization control. It can basically read username, request path, request method from an user request and send enforce request (sub, domain, obj, act) to casbin enforcer for authorization.
Casbin Axum-web Real World App is a fully functional demo which intergrated with Axum-web, Casbin Axum-web Middleware , Diesel, Casbin Diesel Adaper. The example demonstrates the authorization at some hospital where doctor has write access to report of patient where as patient has read access only. With the intergration of casbin, it can authorize the requests and add policies when new user registered. The application can act as an example for developers to use casbin with axum-web.
Weekly statistics: Weekly Commits and PRs, Weekly Blogs
Repository: https://github.com/casbin-rs/axum-casbin-auth
Tasks:
- CI/CD Intergrations: Github Actions
- Basic Funtion Implementation and axum-middleware template
- Add support for AuthN middleware with casbin and axum
- Support Get/Set enforcer for Flexible demand
- Test module for middleware
- Add readme file
Contributions:
- Long PR: feat: Axum Middleware Integration
Is repository ready for public use? Yes
Repository: https://github.com/casbin-rs/axum-middleware-example
Tasks:
- CI/CD Intergrations: Github Actions
- Database Design and Migration Implement
- Implement various utils for password hashing and token validation
- Intergration with Casbin Axum-web Middleware
- User JWT Authentication Middleware Implementation
- Casbin Configuration and Structure Design
- Preset Policy Databse Initial Implementation
- Restful API Implementation using Axum-web
- Blog writing
- Refactoring the module into separate repository
Contributions:
- PR: feat: Add main,rs, apis, services, enable clippy check
- PR: feat: add middleware, define model definitions, and add utils
- PR: feat: setup model, constants, error definition
- PR: feat: added ci, filestructure
NOTE
: The original repository, casbin-rs/examples became too big and for ease in maintainance it was decided to break this repository into smaller repositories and casbin-rs/axum-middleware-example is one of them. Following is the old PR: \
Is repository ready for public use? Yes
Repository: https://github.com/casbin-rs/casbin-grpc
Tasks:
- CI/CD Intergrations: Github Actions
- Update prost, tonic.
- Migrate repository to Rust 2021 from Rust 2018
- Dereference the CachedEnforcer so as to call standard enforce functions.
- Ensure thread safety of CachedEnforcer
- Add the management APIs with reference to proto.rs
- Resolve enforcer(m, a) error
- Resolve errors in various parts of code due to deprecated code, improper reference to variables or borrow.
- Implement datastructure similar to HashMaps.
- Ensure thread safety of Box
- Dereference Box
Contributions:
- PR: feat: Implement custom hashtable datastructure and resolve adapter error in new_enforcer funtion
- PR: feat: Add management apis
- PR: feat: update dependencies, rust version, remove deprecated code, add rpccall function templates
- PR: Added github workflow for CI
NOTE
: The original PR became too long and hence I had to break down the PR into small PRs according to tasks. The original PR is now closed.
Long PR: fix: Make casbin-grpc run
Is repository ready for public use? No, but there has been lot of improvements in the application and now fewer tasks are to be accomplished before we can host casbin-grpc server.
The casbin-rs/examples
repository had become pretty large and it was causing pain in maintaining such a large repository due to different examples which were causing version conflicts. The following PR is closed now, its main objective was to make casbin-rs/examples compile and add axum-middleware-example to the repsository.
The older PR can be found at: fix: Update dependencies, ensure build success and add axum-middleware-example
Repository: https://github.com/casbin-rs/actix-middleware-example
Tasks:
- CI/CD Intergrations: Github Actions
- Update the dependencies to latest version
- Migrate repository to Rust 2021 from Rust 2018
- Resolve version conflict between async-std and tokio
- Make build success and remove deprecated code
- Refactor the module into repository and contribute in small PRs to ensure ease in maintaining repository
Contributions:
- PR: feat: Add main.rs, routes, apis and enable clippy check
- PR: feat: add services and middleware
- PR: feat: Add utils and models
- PR: feat: Add diesel migration files, setup Database, add authn middleware template
- PR: feat: github actions, filestructure
Is repository ready for public use? Yes
Repository: https://github.com/casbin-rs/actix-file-adapter-rbac
Tasks:
- CI/CD Intergrations: Github Actions
- Update the dependencies to latest version
- Migrate repository to Rust 2021 from Rust 2018
- Make build success and remove deprecated code
- Refactor the module into repository and contribute in small PRs to ensure ease in maintaining repository
Contributions:
- PR: feat: implement logic, add readme, formatting and clippy happy
- PR: feat: Added github CI, and filestructure
Is repository ready for public use? Yes
Repository: https://github.com/casbin-rs/actix-postgresql-simple
Tasks:
- CI/CD Intergrations: Github Actions
- Update the dependencies to latest version
- Migrate repository to Rust 2021 from Rust 2018
- Refactor the module into repository and contribute in small PRs to ensure ease in maintaining repository
Contributions:
Is repository ready for public use? Yes
Repository: https://github.com/casbin-rs/ntex-file-adapter-acl
Tasks:
- CI/CD Intergrations: Github Actions
- Update the dependencies to latest version
- Migrate repository to Rust 2021 from Rust 2018
- Added tokio feature in ntex which was required for present version of ntex
- Refactor the module into repository and contribute in small PRs to ensure ease in maintaining repository
Contributions:
- PR: feat: Added main logic, readme, formatting and clippy happy
- PR: feat: github CI, basic filestructure
Is repository ready for public use? Yes
Repository: https://github.com/casbin-rs/poem-todo
Tasks:
- CI/CD Intergrations: Github Actions
- Refactor the module into repository and contribute in small PRs to ensure ease in maintaining repository
Contributions:
- PR: feat: Add apis, main.rs and enable clippy check
- PR: feat: middleware, model
- PR: feat: add CI and filestructure
Is repository ready for public use? Yes
-
Update the sqlx version and resolve the postgres issue on windows and macOS platforms PR: feat: update sqlx version to 0.6
-
Fix the Auto Coverage error PR: fix: Auto Coverage Error
- Update the Readme PR: fix: corrected the readme file
- Update the tokio version, since it was causing tokio version conflict in casbin-rs/actix-middleware-example(then: casbin-rs/examples) PR: fix: Update tokio
-
Axum PR: feat: Add axum-casbin-auth and axum-middleware-example
-
Poem PR: feat: Request to add poem-casbin in examples of community use
It was a great experience while contributing to Casbin. The learning curve was great and I wish to contibue contributions to the community. Following are the temporary post GSoC plans
- Work on casbin-openraft
- Continue maintaining the existing repositories
- Write documentaions and develop tutorials for casbin ecosystem.
Entire GSoC journey was full of ups and downs. There were days when I got stuck on some stuff for days and suddenly out of nowhere something strikes and I make progress, it taught me to hold patience and importance of open source community. Mentors and OrgAdmin were supportive and available whenever I needed them. I thank my mentors for making the entire journey beautiful.