Skip to content

Instantly share code, notes, and snippets.

@MrUnfunny
Created August 30, 2021 17:09
Show Gist options
  • Select an option

  • Save MrUnfunny/386b2f5d1cac666f7e47b46db98c3dc6 to your computer and use it in GitHub Desktop.

Select an option

Save MrUnfunny/386b2f5d1cac666f7e47b46db98c3dc6 to your computer and use it in GitHub Desktop.
Google Summer of Code 2021 final report

Google Summer of Code 2021 Final Work Product


Group 15


Introduction



Overview

Casbin is an authorization library that supports access control models like ACL, RBAC, ABAC. Originally written in Golang, it has been implemented in various languages and Dart-Casbin is the Dart implementation of Casbin. The current progress is:

  • Now, Dart-Casbin supports almost all functionality of Casbin as of its other implementations and can be used as a module in Dart applications.
  • Dart-Casbin supports ACL, RBAC and ABAC as supported by other casbin implementations.
  • It has test coverage for all major access models and their edge cases.
  • Dart-Casbin is integrated with semantic-release to semantically release newer versions with every patch release through Github Actions.

Work Done during GSoC

For the list of all contributions, please scroll to this section.

I started by implementing Config module to load Config from file and text. Next I implemented File Adapter to load policies from file. Then ACL and RBAC were implemented. In the meantime, I wrote tests to cover all possible cases for ACL, RBAC and loading of Config files from both files and text. Next, ABAC was implemented and tests were added for it too. Then, we wrapped up by integrating semantic release with GitHub Actions to release on both GitHub and pub.dev.

Contributions

Migrated to Null Safety

Updated readme and added logo

feat: added config file, testdata and test for it

feat: added classes and methods to load model from CONF file

Update Linting rules and added license text in each dart file

Implemented basic working Enforce method

feat: added examples of models and policies and added test for basic enforce function.

feat: implemented rbac module and added tests for roles

feat: added github actions for analysing code and running test on PR

feat: implemented proper functioning enforce method and added tests for rbac

feat: added missing methods to model module

feat: added methods to coreEnforcer and Enforcer

feat: implement initial parts of internal and core apis

feat: added methods and tests to enforcer apis

feat: implemented full persist module and enforcer apis

feat: implemented matcher functions and added tests

feat: implemented logger and added tests for it

feat: added more enforce methods and added tests

feat: exported required files

feat: added support for abac and added tests

refactor: refactored code and exported AbacClass

doc: updated readme

docs: added link to example app

feat: updated workflow to automate github and pub.dev release

feat: updated files to prepare for new release

After GSoC

Dart-Casbin has almost all functionality as that of other Casbin implementations. However, some more work can be done in following areas:

  • some matcher Functions can be added to improve functionality of matchers.
  • I'll be looking to implement a front-end module focused on flutter, similar to casbin.js.
  • A Middleware for shelf to improve dart-casbin's compatibility with dart-backend shelf.

Final Thoughts

I would like to thank my mentors hsluoyz, Tomas Arias, and Santhoshivan Amudhan for their continuous support and guidance without which I wouldn't have been able to finish this project on time. I would also thank Google Summer of Code to provide such an excellent opportunity to be able to get started with open source.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment