当前位置: 首页>>代码示例>>Python>>正文


Python cors.CORS_OPTS属性代码示例

本文整理汇总了Python中oslo_middleware.cors.CORS_OPTS属性的典型用法代码示例。如果您正苦于以下问题:Python cors.CORS_OPTS属性的具体用法?Python cors.CORS_OPTS怎么用?Python cors.CORS_OPTS使用的例子?那么恭喜您, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在oslo_middleware.cors的用法示例。


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

示例1: set_middleware_defaults

# 需要导入模块: from oslo_middleware import cors [as 别名]
# 或者: from oslo_middleware.cors import CORS_OPTS [as 别名]
def set_middleware_defaults():
    """Update default configuration options for oslo.middleware."""
    # CORS Defaults
    cfg.set_defaults(cors.CORS_OPTS,
                     allow_headers=['X-Auth-Token',
                                    'X-Openstack-Request-Id',
                                    'X-Identity-Status',
                                    'X-Roles',
                                    'X-Service-Catalog',
                                    'X-User-Id',
                                    'X-Tenant-Id'],
                     expose_headers=['X-Auth-Token',
                                     'X-Openstack-Request-Id',
                                     'X-Subject-Token',
                                     'X-Service-Token'],
                     allow_methods=['GET',
                                    'PUT',
                                    'POST',
                                    'DELETE',
                                    'PATCH']
                     ) 
开发者ID:openstack,项目名称:masakari,代码行数:23,代码来源:config.py

示例2: list_opts_cors

# 需要导入模块: from oslo_middleware import cors [as 别名]
# 或者: from oslo_middleware.cors import CORS_OPTS [as 别名]
def list_opts_cors():
    """Return a list of oslo.config options for the cors middleware.

    The returned list includes all oslo.config options which may be registered
    at runtime by the library.

    Each element of the list is a tuple. The first element is the name of the
    group under which the list of elements in the second element will be
    registered. A group name of None corresponds to the [DEFAULT] group in
    config files.

    This function is also discoverable via the 'oslo.middleware' entry point
    under the 'oslo.config.opts' namespace.

    The purpose of this is to allow tools like the Oslo sample config file
    generator to discover the options exposed to users by this library.

    :returns: a list of (group_name, opts) tuples
    """
    return [
        ('cors', copy.deepcopy(cors.CORS_OPTS)),
    ] 
开发者ID:openstack,项目名称:oslo.middleware,代码行数:24,代码来源:opts.py

示例3: set_defaults

# 需要导入模块: from oslo_middleware import cors [as 别名]
# 或者: from oslo_middleware.cors import CORS_OPTS [as 别名]
def set_defaults():
    from oslo_middleware import cors
    cfg.set_defaults(cors.CORS_OPTS,
                     allow_headers=[
                         'Authorization',
                         'X-Auth-Token',
                         'X-Subject-Token',
                         'X-User-Id',
                         'X-Domain-Id',
                         'X-Project-Id',
                         'X-Roles']) 
开发者ID:gnocchixyz,项目名称:gnocchi,代码行数:13,代码来源:opts.py

示例4: set_cors_middleware_defaults

# 需要导入模块: from oslo_middleware import cors [as 别名]
# 或者: from oslo_middleware.cors import CORS_OPTS [as 别名]
def set_cors_middleware_defaults():
    """Update default configuration options for oslo.middleware."""
    # CORS Defaults
    # TODO(krotscheck): Update with https://review.opendev.org/#/c/285368/
    cfg.set_defaults(cors.CORS_OPTS,
                     allow_headers=['X-Auth-Token',
                                    'X-OpenStack-Request-ID'],
                     expose_headers=['X-OpenStack-Request-ID'],
                     allow_methods=['GET',
                                    'POST']
                     ) 
开发者ID:openstack,项目名称:searchlight,代码行数:13,代码来源:config.py

示例5: set_middleware_defaults

# 需要导入模块: from oslo_middleware import cors [as 别名]
# 或者: from oslo_middleware.cors import CORS_OPTS [as 别名]
def set_middleware_defaults():
    """Update default configuration options for oslo.middleware."""
    # CORS Defaults
    # TODO(krotscheck): Update with https://review.openstack.org/#/c/285368/
    cfg.set_defaults(cors.CORS_OPTS,
                     allow_headers=['X-Auth-Token',
                                    'X-Openstack-Request-Id',
                                    'X-Project-Id',
                                    'X-Identity-Status',
                                    'X-User-Id',
                                    'X-Storage-Token',
                                    'X-Domain-Id',
                                    'X-User-Domain-Id',
                                    'X-Project-Domain-Id',
                                    'X-Roles'],
                     expose_headers=['X-Auth-Token',
                                     'X-Openstack-Request-Id',
                                     'X-Project-Id',
                                     'X-Identity-Status',
                                     'X-User-Id',
                                     'X-Storage-Token',
                                     'X-Domain-Id',
                                     'X-User-Domain-Id',
                                     'X-Project-Domain-Id',
                                     'X-Roles'],
                     allow_methods=['GET',
                                    'PUT',
                                    'POST',
                                    'DELETE',
                                    'PATCH']
                     ) 
开发者ID:cloud-security-research,项目名称:sgx-kms,代码行数:33,代码来源:config.py

示例6: test_config_defaults

# 需要导入模块: from oslo_middleware import cors [as 别名]
# 或者: from oslo_middleware.cors import CORS_OPTS [as 别名]
def test_config_defaults(self):
        """Assert that using set_defaults overrides the appropriate values."""

        cors.set_defaults(**self.override_opts)

        for opt in cors.CORS_OPTS:
            if opt.dest in self.override_opts:
                self.assertEqual(self.override_opts[opt.dest], opt.default) 
开发者ID:openstack,项目名称:oslo.middleware,代码行数:10,代码来源:test_cors.py

示例7: setUp

# 需要导入模块: from oslo_middleware import cors [as 别名]
# 或者: from oslo_middleware.cors import CORS_OPTS [as 别名]
def setUp(self):
        # Make sure the CORS options are registered
        cfg.CONF.register_opts(cors_middleware.CORS_OPTS, 'cors')

        # Load up our valid domain values before the application is created.
        self.override_config(
            "allowed_origin",
            "http://valid.example.com",
            group='cors'
        )

        # Create the application.
        super(TestCORSMiddleware, self).setUp() 
开发者ID:openstack,项目名称:qinling,代码行数:15,代码来源:test_cors_middleware.py


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