• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Python metadata.create_metadata_string函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Python中saml2.metadata.create_metadata_string函数的典型用法代码示例。如果您正苦于以下问题:Python create_metadata_string函数的具体用法?Python create_metadata_string怎么用?Python create_metadata_string使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了create_metadata_string函数的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Python代码示例。

示例1: __init__

 def __init__(self, config):
     """
     Creates a response containing the metadata generated from the SP config.
     :type config: dict[str, Any]
     :param config: The SP config
     """
     metadata_string = create_metadata_string(None, config, 4, None, None, None, None,
                                              None).decode("utf-8")
     resp = {"content": "text/xml"}
     super(MetadataResponse, self).__init__(message=metadata_string, **resp)
开发者ID:borgand,项目名称:SATOSA,代码行数:10,代码来源:saml2.py


示例2: metadata

def metadata(environ, start_response, _args):
    path = _args.path
    if path is None or len(path) == 0:
        path = os.path.dirname(os.path.abspath(__file__))
    if path[-1] != "/":
        path += "/"
    metadata = create_metadata_string(path + "sp_conf.py", None,
                                      _args.valid, _args.cert,
                                      _args.keyfile,
                                      _args.id, _args.name, _args.sign)
    start_response('200 OK', [('Content-Type', "text/xml")])
    return metadata
开发者ID:dstanek,项目名称:keystone-saml2-experiment,代码行数:12,代码来源:sp.py


示例3: _metadata_endpoint

    def _metadata_endpoint(self, context):
        """
        Endpoint for retrieving the backend metadata
        :type context: satosa.context.Context
        :rtype: satosa.response.Response

        :param context: The current context
        :return: response with metadata
        """
        satosa_logging(logger, logging.DEBUG, "Sending metadata response", context.state)
        metadata_string = create_metadata_string(None, self.idp.config, 4, None, None, None, None,
                                                 None).decode("utf-8")
        return Response(metadata_string, content="text/xml")
开发者ID:its-dirg,项目名称:SATOSA,代码行数:13,代码来源:saml2.py


示例4: metadata

def metadata(environ, start_response):
    try:
        path = args.path
        if path is None or len(path) == 0:
            path = os.path.dirname(os.path.abspath( __file__ ))
        if path[-1] != "/":
            path += "/"
        metadata = create_metadata_string(path+args.config, IDP.config,
                                          args.valid, args.cert, args.keyfile,
                                          args.id, args.name, args.sign)
        start_response('200 OK', [('Content-Type', "text/xml")])
        return metadata
    except Exception as ex:
        logger.error("An error occured while creating metadata:" + ex.message)
        return not_found(environ, start_response)
开发者ID:lvanderree,项目名称:pysaml2-3,代码行数:15,代码来源:idp.py


示例5: __init__

 def __init__(self, sp_logger, args):
     """
     Constructor for the SpHandler.
     :param sp_logger: A logger.
     """
     #Metadata for the SP
     self.sp_metadata = create_metadata_string(args.spconf + ".py", None, args.valid, args.cert, args.keyfile,
                                               args.id_sp, args.name_sp, args.sign)
     #Log class. (see import logging)
     self.logger = sp_logger
     #Configurations for the SP handler. (pyOpSamlProxy.client.sp.conf)
     self.sp_conf = importlib.import_module(args.spconf)  #pyOpSamlProxy.client.sp.conf
     #Name of the configuration file. See above.
     self.sp_conf_name = self.sp_conf.WORKING_DIR + args.spconf
     #SP configuration object. (See project pysaml2; saml2.client.Saml2Client)
     self.sp = Saml2Client(config_file="%s" % self.sp_conf_name)
     #Extra arguments for the pyOpSamlProxy.client.sp.util.SSO object.
     self.args = {}
     #URL to SAML discovery server.
     self.args["discosrv"] = self.sp_conf.DISCOSRV
     #URL to SAML WAYF server.
     self.args["wayf"] = self.sp_conf.WAYF
     #URL to op server authorization when the SP have been authenticated.
     #TODO have to be changed when Saml to Saml is implemented.
     self.authorization_url = "%s/authorization" % self.sp_conf.ISSUER
     #Handles the SAML authentication for an op server.
     self.authnmethod = SPAuthnMethodHandler(None, self.sp_conf.SPVERIFYBASE, self.authorization_url)
     #Handles SAML authentication for an IdP server.
     # Setup performed by pyOpSamlProxy.provider.idp.handler.handler.
     self.sp_authentication = None
     #Handles the user info response with Saml attributes.
     self.userinfo = UserInfoSpHandler(self.sp_conf.OPENID2SAMLMAP, self)
     #The handler for the op server. Must be set after creation
     #This must be the instance of the class pyOpSamlProxy.provider.op.handler.OpHandler.
     self.ophandler = None
     #Contains the user cache for the SpHandler, like collected IdP attributes.
     #Dictionary where userid is key and value is an instance of the class
     #pyOpSamlProxy.client.sp.handler.SpHandlerCache
     self.sphandlercache = self.sp_conf.CACHE
     self.certificate_cache_name = "CERTIFICATE_CACHE"
     self.certificate_cookie_name = sid()
     self.certificate_cookie_seed = sid()
开发者ID:its-dirg,项目名称:IdProxy,代码行数:42,代码来源:handler.py


示例6: __init__

 def __init__(self, args, template_lookup, sphandler, ISSUER):
     idpconfig = importlib.import_module(args.idpconfig)
     self.copy_sp_cert = idpconfig.COPYSPCERT
     self.copy_sp_key = idpconfig.COPYSPKEY
     self.passwd = idpconfig.PASSWD
     self.cas_server = idpconfig.CAS_SERVER
     self.yubikey_db = idpconfig.YUBIKEY_DB
     self.yubikey_server = idpconfig.YUBIKEY_SERVER
     self.service_url = ISSUER + "/" + self.IDP_VERIFY_URL
     self.template_lookup = template_lookup
     self.idp_server = self.setup_saml2_server(args.idpconfig, idpconfig, idpconfig.SYM_KEY)
     self.authn_broker = self.setup_authn_broker(ISSUER, sphandler, idpconfig.AUTHORIZATION)
     self.auth_cookie = None
     self.non_authn_urls = [
         (r'%s?(.*)$' % self.IDP_VERIFY_URL, self.do_verify),
         (r'sso/ecp$', (SSO, "ecp")),
     ]
     self.sphandler = sphandler
     self.idp_metadata = create_metadata_string(args.idpconfig + ".py", self.idp_server.config, args.valid,
                                                args.cert,
                                                args.keyfile, args.id_idp, args.name_idp, args.sign)
开发者ID:rhoerbe,项目名称:IdProxy,代码行数:21,代码来源:handler.py


示例7: metadata

def metadata(environ, start_response):
    try:
        path = _args.path
        if path is None or len(path) == 0:
            path = os.path.dirname(os.path.abspath(__file__))
        if path[-1] != "/":
            path += "/"
        metadata = create_metadata_string(
            path + "sp_conf.py",
            None,
            _args.valid,
            _args.cert,
            _args.keyfile,
            _args.id,
            _args.name,
            _args.sign,
        )
        start_response("200 OK", [("Content-Type", "text/xml")])
        return [metadata]
    except Exception as ex:
        logger.error("An error occured while creating metadata: %s", ex.message)
        return not_found(environ, start_response)
开发者ID:SUNET,项目名称:pysaml2,代码行数:22,代码来源:sp.py


示例8: create_logger

                        help="A file with a key to sign the metadata with")
    parser.add_argument('-n', dest='name')
    parser.add_argument('-s', dest='sign', action='store_true',
                        help="sign the metadata")
    parser.add_argument('-sp', dest='sp_conf', default='sp_conf',
                        help="sp configuration file")
    parser.add_argument(dest="config")
    args = parser.parse_args()
    global config
    config = importlib.import_module(args.config)
    sp_config = importlib.import_module(args.sp_conf)

    global logger
    logger = create_logger(config.LOG_FILE)

    metadata = create_metadata_string("sp_conf.py", None, args.valid, args.cert, args.keyfile, args.id, args.name,
                                      args.sign)

    global sphandler
    sphandler = SpHandler(logger, metadata, os.path.dirname(os.path.abspath( __file__ )), args.sp_conf+".py", sp_config)

    global srv
    srv = wsgiserver.CherryPyWSGIServer(('0.0.0.0', config.PORT), SessionMiddleware(application, config.SESSION_OPTS))
    srv.stats['Enabled'] = True

    if config.HTTPS:
        srv.ssl_adapter = ssl_pyopenssl.pyOpenSSLAdapter(config.SERVER_CERT, config.SERVER_KEY, config.CERT_CHAIN)
        srv.ssl_adapter.context = srv.ssl_adapter.get_context()
        srv.ssl_adapter.context.set_options(SSL.OP_NO_SSLv3)
        srv.ssl_adapter.context.set_cipher_list('EDH+CAMELLIA:EDH+aRSA:EECDH+aRSA+AESGCM:EECDH+aRSA+SHA256:EECDH:+CAMELLIA128:+AES128:+SSLv3:!aNULL:!eNULL:!LOW:!3DES:!MD5:!EXP:!PSK:!DSS:!RC4:!SEED:!IDEA:!ECDSA:kEDH:CAMELLIA128-SHA:AES128-SHA')

    logger.info("Server starting")
开发者ID:its-dirg,项目名称:dirg-web,代码行数:32,代码来源:dirg_web_server.py



注:本文中的saml2.metadata.create_metadata_string函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Python metadata.entity_descriptor函数代码示例发布时间:2022-05-27
下一篇:
Python mdstore.MetadataStore类代码示例发布时间:2022-05-27
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap