Xabaril / Esquio

Esquio is a Feature Toggle Library for .NET Developers.
Apache License 2.0
429 stars 49 forks source link

ClaimValueToggle only first claim #111

Closed risogolo closed 4 years ago

risogolo commented 4 years ago

I think ClaimValueToggle only evaluates only first apperance of the claim of the same type. For example I have claims collection on http context containing claim of type Role with value "Role1" an claim of type Role with value "Role2", I guess it searches only for the firstone, but I have an user assigned to multiple roles so I have multiple claims of type Role assigned in http context

unaizorrilla commented 4 years ago

Hi @risogolo

Thanks for fill the issue! After some review, I agree that this is a bug and toggle will check all claim values from some type.

I will try to fix this on Esquio 2 (current version) and also manage on Esquio 3, we are working hard to release the new version on this month!

I try to fix the issue

unaizorrilla commented 4 years ago

Hi @risogolo

A new package with version 2.0.4 will be available on nuget and this will solve the issue. I created a simple test to cover this and all is working

https://github.com/Xabaril/Esquio/blob/37a829b83b56b2c331e544b07986103e4e51e70f/tests/UnitTests/Esquio.AspNetCore/Toggles/ClaimValueToggleTests.cs#L63

Please close the issue if new package solve the issue!

risogolo commented 4 years ago

Thank you very much for your quick reposne and for this nice library , I confirm that works for me