casbin-net / casbin-aspnetcore

Casbin.NET integration middleware and sample code for ASP.NET Core
https://github.com/casbin/Casbin.NET
Apache License 2.0
69 stars 21 forks source link

feat: Sync authorization data with Casbin2.x generics. #44

Closed AsakusaRinne closed 2 years ago

AsakusaRinne commented 2 years ago
  1. Limit the output of Transformer to string[].
  2. Add adapter for customized authorization data to process customized data type.
  3. Use generics API of enforcer of Casbin 2.x when no customized data is applied.
hsluoyz commented 2 years ago

@sagilio

hsluoyz commented 2 years ago

@AsakusaRinne fix:

image

AsakusaRinne commented 2 years ago

@AsakusaRinne fix:

image

The preview version still uses the "msater" version dependency of Casbin.NET, which made the CI fail. I have updated the PR just now for a major revision. However, the CI will still fail due to the same reason. Please just ignore it and I'll keep sync with Sagilio about this PR.

AsakusaRinne commented 2 years ago

@sagilio Please help to have a review when you're free. I have made the major revision mentioned in the meeting last night. Thank you.

sagilio commented 2 years ago

@AsakusaRinne fix: image

The preview version still uses the "msater" version dependency of Casbin.NET, which made the CI fail. I have updated the PR just now for a major revision. However, the CI will still fail due to the same reason. Please just ignore it and I'll keep sync with Sagilio about this PR.

We update the build version of Casbin here: https://www.myget.org/feed/casbin-net/package/nuget/Casbin.NET

sagilio commented 2 years ago

This implementation is still quite different from what we discussed, here are several important points:

  1. At least the path to pass TRequest not be packed to IRequestValues.
  2. Can not reduce the information of ICasbinAuthorizationData

As a result, this may make the most APIs cover generics. To descript my thoughts more clear, I will provide a baseline implementation later.

@AsakusaRinne Here is the another implementation: https://github.com/casbin-net/casbin-aspnetcore/pull/46