pysaml2 icon indicating copy to clipboard operation
pysaml2 copied to clipboard

Refeds entity category handling improvements

Open fredrikt opened this issue 2 years ago • 0 comments

Description

The feature or problem addressed by this PR

Complete the changes needed to entity category handling in order to support refeds personalized, pseudononymous and anonymous.

What your changes do and why you chose this solution

A new format for entity category restrictions was needed to support being able to express that certain categories should not be "mixed" (refeds personalized, pseudonymous, anonymous).

In discussions, it was determined that Pydantic was a suitable tool to load such configuration in a way that made it convenient, and safe, to work with.

This code is backwards compatible with the old entity categories module data format (RELEASE and ONLY_REQUIRED, two dictionaries) but also adds support for a new format, RESTRICTIONS which is a list of dicts that Pydantic will marshal into EntityCategoryRule objects when loaded.

As often is the case when typing, the scope of the change spread a little to related functions and classes.

Checklist

  • [ ] Checked that no other issues or pull requests exist for the same issue/change
  • [ ] Added tests covering the new functionality
  • [ ] Updated documentation OR the change is too minor to be documented
  • [ ] Updated CHANGELOG.md OR changes are insignificant

fredrikt avatar Mar 03 '23 12:03 fredrikt