Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refeds entity category handling improvements #897

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

fredrikt
Copy link
Contributor

@fredrikt fredrikt commented Mar 3, 2023

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

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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant