IdentityPython / pysaml2

Python implementation of SAML2
Apache License 2.0
555 stars 421 forks source link

loading additional xsd files #869

Open grindhold opened 2 years ago

grindhold commented 2 years ago

I monkeypatched xml/schema/__init__.py as suggested in #833 to achieve loading a user-provided xsd. And it worked until, recently, the file has been altered.

I urgently need this feature.

a) If I was to implement it, how should the API look like? Could you outline an architectural approach that would match what you as maintainers strive to get for pysaml2? What non-obvious problems should one consider before implementing?

b) Who could I throw money at to implement this for me?

c00kiemon5ter commented 1 year ago

This is what I have a in mind:

The validator needs to be built before it can be used. It needs to be provided with the namespaces and schemas that it will load and parse. This is state that needs to be held somewhere (1), along with new configurations (2) to set that state.

  1. The validator will probably become part of the SecurityContext.
  2. A new configuration option will be introduced to set extra locations (mapping between namespace and file).
  3. During the initialization of the SecurityContext, the validator will also be loaded, given the right configuration. The configuration will set additional locations (mapping between namespace and local file) which will be merged with the builtin locations.
  4. The validate function will be integrated into the SecurityContext API and files will be validated through that API.