Skip to content

Instantly share code, notes, and snippets.

@sociometry
Created September 12, 2022 11:37
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sociometry/5b0d86d68585c12b42b7b5ad42736064 to your computer and use it in GitHub Desktop.
Save sociometry/5b0d86d68585c12b42b7b5ad42736064 to your computer and use it in GitHub Desktop.
GSOC 2022 Final Report

GSoC 2022 Final Report (Casbin for .NET & Casdoor .NET SDK)

Project Details

Overview

Casbin is an authorization library that supports access control models like ACL, RBAC, ABAC. Originally written in Golang, and Casbin.NET is the Dotnet implementation. Casbin.NET v2 is going to release, and it will provide excellent performance, flexible scalability and more imaginative and exciting features. In addition, the ecosystem of it could be enhanced.

Casdoor is an Identity Access Management and Single-Sign-On platform based on Casbin, and Casdoor .NET SDK is also a part of Casbin.NET ecosystem.

Project Ideas are as follows:

  • Improve the unit tests and benchmarks.
  • Add more features.
  • Enhance the ecosystem of Casbin.NET.

Work Done during GSoC

Casbin.NET

Getting started with the project began with getting familiar with unit tests and benchmarks. After reading some codes, I found that the unit test coverage is not that high, so I added some unit tests and benchmarks, especially tested some exception cases. After that, a series of functions and unit tests related to the missing Update APIs were added. In order to cooperate with Redis Watcher, WatcherMessage was also added to deliver messages.

Redis Adapter, Redis Watcher and EFCore Adapter

They are part of the ecosystem to be enhanced, and Redis Adapter and Redis Watcher were developed during this period. The Redis Adapter allows Casbin.NET to store policies into and read from Redis. The Redis Watcher supports distributed message watching using Redis. Now that Casbin.NET has changed a lot (a lot of features have been added), the existing EFCore Adapter has been modified.

Casdoor .NET SDK

Getting started with Casdoor .NET SDK began with getting familiar with some of the SDK's interfaces, and later I added some interfaces to it. During this period, I also developed some examples. These examples show the basic functions of Casdoor, which is helpful for users to get started quickly.

Other

During the development process, I also read some codes of other repositories in the Casbin community. I found a error-prone bug and submitted an issue. It has now been resolved.

Contributions

Casbin.NET

# Title Status
#253 chore: Use semantic pull request in GitHub Action badge
#265 test: Add new unit tests for management APIs badge
#266 test: Add new benchmarks for management APIs badge
#267 feat: Add UpdatePolicy and UpdatePolicies APIs badge
#271 test: Add 5 multi-threading test cases for ReadWritePolicyManager badge
#275 feat: Add WatcherMessage for watchers badge

EFCore Adapter for Casbin.NET

# Title Status
#60 fix: Upgrade to net6 and 7 badge
#61 feat: Migrate to Casbin.NET 2.0.0-preview badge

Redis Adapter for Casbin.NET

# Title Status
#1 feat: Redis adapter using list badge
#2 chore: Add workflows for CI badge
#7 chore: Fix CI failure when packing packages badge
#8 feat: Add UpdatePolicy(ies) Functions badge

Redis Watcher for Casbin.NET

# Title Status
#1 feat: Add WatcherEx Apis and Unittests badge

Casdoor .NET SDK

# Title Status
#29 feat: Add apis for User and Model badge
#30 feat: Add apis for Application and Organization badge

Casdoor Dotnet Winform Example

# Title Status
#2 feat: Add a Winform example badge
#5 fix: Support net5-windows badge
#6 docs: Add README-zh-cn badge

Casdoor Dotnet SDK Example

# Title Status
#2 feat: Add ConsoleApp and MvcApp samples badge
#4 fix: Update options and README.md badge

Casbin

# Title Status
#1039 [Bug] Using less newPolicies to update oldPolices will cause a panic badge

What's next?

Here are a few things which can be done in the future:

  • Improve the docs for Casbin.NET v2 as it has changed a lot compared to v1

  • Improve the docs for Redis Adapter and Redis Watcher, especially the usage of WaterEx interfaces in detail

  • Enhance the ecology of Casbin.NET further.

I have planned to work on these issues after the final evaluations are completed successfully and keep contributing to the project and the community.

Ackowledgement

I would like to thank my mentors sagilio and hsluoyz who have been guiding, helping and encouraging me since I started the project. I would also like to thank the Casbin community where I have learned a lot over the past few months.

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