Ejemplo n.º 1
0
    def __init__(self, jwks_file=None, httpcli=None, iss='', keyjar=None,
                 signed_metadata_statements_dir='.', fo_jwks_dir=None,
                 fo_priority_order=None, ms_cls=ClientMetadataStatement,
                 fo_bundle_uri=None, fo_bundle_sign_key=None,
                 verify_ssl=True, ca_certs=None, client_cert=None):

        if jwks_file:
            keyjar = self.read_jwks_file(jwks_file)

        if httpcli is None:
            httpcli = PBase(verify_ssl=verify_ssl, ca_certs=ca_certs,
                            keyjar=keyjar, client_cert=client_cert)

        Operator.__init__(self, iss=iss, keyjar=keyjar, httpcli=httpcli)

        # FO keys
        self.fo_keyjar = None
        self.fo_jwks_dir = fo_jwks_dir
        self.jwks_mtime = {}
        if fo_jwks_dir:
            self.get_fo_keyjar_from_dir()

        if fo_bundle_uri:
            self.fo_bundle_uri = fo_bundle_uri
            self.fo_bundle_sign_key = fo_bundle_sign_key
            self.import_from_bundle(fo_bundle_uri, fo_bundle_sign_key)

        # Signed metadata statements
        self.signed_metadata_statements_dir = signed_metadata_statements_dir
        self.sms_mtime = {}
        self.signed_metadata_statements = {}
        self.get_sms_from_dir()

        self.fo_priority_order = {} or fo_priority_order
        self.ms_cls = ms_cls
Ejemplo n.º 2
0
 def discover(self, *arg, **kwargs):
     wf = WebFinger(OIC_ISSUER)
     wf.httpd = PBase()
     _url = wf.query(kwargs["principal"])
     self.trace.request("Request URL: %s" % _url)
     url = wf.discovery_query(kwargs["principal"])
     self.trace.request("Discovery URL: %s" % url)
     return url