Hello Kristof,
You need a micro-service to do this and then you can make it as complex as you need. On the init phase of the micro_service you register the configuration and on the process phase you would get the mapped attributes, the mapped NameID value and format and the context of the request. You can then create, update or delete attributes or the NameID based on any checks you need.
You may want to have a look at:
In pseudocode you would do:
if data.subject_type == NAMEID_FORMAT_PERSISTENT:
data.attributes[eppn] = [data.subject_id]
Assuming eppn is the internal name of the attribute that should get the value of the Subject/NameID element. Note that the value of the data.attributes elements is a list.
You could easily convert the above to a configurable list of interval attribute names that would get the NameID value, and extend it as needed.
Let us know if this helps.
Kind regards,