Code Monkey home page Code Monkey logo

Comments (8)

bajnokk avatar bajnokk commented on May 20, 2024 1

IMHO a good MDQ client could take advantage of cacheDuration and validUntil, but right, a local MDX server is also sufficient.

Anyway, reloading metadata on every request seems to be a conceptual weakness to me.

I've managed to make SaToSa perform the MDQ, but I could not get it to verify the signature. I'd wait for the answer from PySAML devs until I share it, I might do it wrong.

from satosa.

leifj avatar leifj commented on May 20, 2024

For inacademia we use mdq support in pysaml2 instead of locally cached metadata for this reason. This seems to work very well.

from satosa.

bajnokk avatar bajnokk commented on May 20, 2024

Even using mdq for every request is silly, IMHO for a production service some caching is probably necessary.
Anyway I could continue if I could figure out how to make pysaml to use mdq, but I haven't found any docs/examples on the internet.

from satosa.

leifj avatar leifj commented on May 20, 2024

Its certainly not "silly". A good MDQ setup includes a cache layer so its just a network roundtrip away. In the InAcademia case it is likely that you'd get very little effect from moving the cache into the SATOSA process as opposed to having it in the MDQ server but if you really want a cache "close" to SATOSA you can run an MDQ instance on the loopback interface.

from satosa.

leifj avatar leifj commented on May 20, 2024

you may want to log an issue with pysaml2 - I don't think @rohe watches this project

from satosa.

jkakavas avatar jkakavas commented on May 20, 2024

This only happens when SAMLMirrorFrontend is used. What actually happens is that metadata are read again because the configuration is reloaded every time the SAMLMirrorFrontend has to handle an Authentication Request.

The reason is that the aptly named

def handle_authn_request

https://github.com/SUNET/SATOSA/blob/master/src/satosa/frontends/saml2.py#L453

calls _load_idp_dynamic_endpoints

def handle_authn_request(self, context, binding_in):
        """
        Loads approved endpoints dynamically
        See super class satosa.frontends.saml2.SAMLFrontend#handle_authn_request
        :type context: satosa.context.Context
        :type binding_in: str
        :rtype: satosa.response.Response
        """
        idp = self._load_idp_dynamic_endpoints(context)
        return self._handle_authn_request(context, binding_in, idp)

which contains a call of load() of the config object ( https://github.com/rohe/pysaml2/blob/master/src/saml2/config.py ) that will cause it to reload the config and parse the metadata into an internal structure on which to operate.

From a functionality perspective, the process of building a new Server object makes sense but the subsequent reload of the metadata is unnecessary.
The existing self.idp Server object can be used and extended by _load_idp_dynamic_endpoints or the existing self.idp.metadata can be passed as a parameter to load() (which will require a pull request to be accepted in pysaml2 ) so that it won't need to load the metadata from the sources defined at the frontend configuration file.

from satosa.

leifj avatar leifj commented on May 20, 2024

also related to #90 which makes this issue even more silly and urgent

from satosa.

peppelinux avatar peppelinux commented on May 20, 2024

@bajnokk the answer is use MDQ for huge metadata stores.
Please let us know for additional stuffs otherwise this Issue will be closed in weeks
thank you

from satosa.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.