Пример #1
0
def setup_app(config=None):

    if not config:
        config = get_pecan_config()

    app_conf = dict(config.app)

    app = pecan.make_app(
        app_conf.pop('root'),
        logging=getattr(config, 'logging', {}),
        **app_conf
    )

    app = auth.install(app, CONF)

    # Create a CORS wrapper, and attach solum-specific defaults that must be
    # supported on all CORS responses.
    app = cors_middleware.CORS(app, CONF)
    app.set_latent(
        allow_headers=['X-Auth-Token', 'X-Openstack-Request-Id',
                       'X-Subject-Token'],
        allow_methods=['GET', 'PUT', 'POST', 'DELETE', 'PATCH'],
        expose_headers=['X-Auth-Token', 'X-Openstack-Request-Id',
                        'X-Subject-Token']
    )

    return app
Пример #2
0
 def test_check_auth_option_disabled(self, mock_auth):
     self.CONF.config(auth_protocol="footp",
                      auth_version="v2.0",
                      auth_uri=None,
                      group=auth.OPT_GROUP_NAME)
     self.CONF.config(enable_authentication='False')
     result = auth.install(self.app, self.CONF.conf)
     self.assertIsInstance(result, fakes.FakeApp)
Пример #3
0
 def test_check_auth_option_disabled(self, mock_auth):
     self.CONF.config(auth_protocol="footp",
                      auth_version="v2.0",
                      auth_uri=None,
                      group=auth.OPT_GROUP_NAME)
     self.CONF.config(enable_authentication=False)
     result = auth.install(self.app, self.CONF.conf)
     self.assertIsInstance(result, fakes.FakeApp)
Пример #4
0
    def test_check_auth_option_enabled(self, mock_auth):

        self.CONF.config(auth_protocol="http",
                         auth_version="v2.0",
                         www_authenticate_uri=None,
                         group=auth.OPT_GROUP_NAME)
        self.CONF.config(enable_authentication=True)
        result = auth.install(self.app, self.CONF.conf)
        self.assertIsInstance(result, fakes.FakeAuthProtocol)
Пример #5
0
def setup_app(config=None):
    if not config:
        config = get_pecan_config()

    app_conf = dict(config.app)

    app = pecan.make_app(app_conf.pop('root'),
                         logging=getattr(config, 'logging', {}),
                         **app_conf)
    return auth.install(app, CONF)
Пример #6
0
Файл: app.py Проект: alex/solum
def setup_app(config=None):
    if not config:
        config = get_pecan_config()

    app_conf = dict(config.app)

    app = pecan.make_app(
        app_conf.pop('root'),
        logging=getattr(config, 'logging', {}),
        **app_conf
    )
    return auth.install(app, CONF)
Пример #7
0
def setup_app(config=None):

    if not config:
        config = get_pecan_config()

    app_conf = dict(config.app)

    app = pecan.make_app(app_conf.pop('root'),
                         logging=getattr(config, 'logging', {}),
                         **app_conf)

    app = auth.install(app, CONF)

    # Create a CORS wrapper, and attach solum-specific defaults that must be
    # supported on all CORS responses.
    app = cors_middleware.CORS(app, CONF)

    return app
Пример #8
0
def setup_app(config=None):

    if not config:
        config = get_pecan_config()

    app_conf = dict(config.app)

    app = pecan.make_app(
        app_conf.pop('root'),
        logging=getattr(config, 'logging', {}),
        **app_conf
    )

    app = auth.install(app, CONF)

    # Create a CORS wrapper, and attach solum-specific defaults that must be
    # supported on all CORS responses.
    app = cors_middleware.CORS(app, CONF)

    return app