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
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)
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)
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)
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)
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)
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
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