def oidc_provider_init_app(name=None): name = name or __name__ app = Flask(name) app.config.from_pyfile('application.cfg') app.users = {'test_user': {'name': 'Testing Name'}} from .views import oidc_provider_views app.register_blueprint(oidc_provider_views) # Initialize the oidc_provider after views to be able to set correct urls app.provider = init_oidc_provider(app) return app
def oidc_provider_init_app(name=None): name = name or __name__ app = Flask(name) app.config.from_pyfile("application.cfg") app.users = {"test_user": {"name": "Testing Name"}} from .views import oidc_blueprint app.register_blueprint(oidc_blueprint) # Initialize the oidc_provider after views to be able to set correct urls app.provider = init_oidc_provider(app) return app
def oidc_provider_init_app(name=None): name = name or __name__ app = Flask(name) app.config.from_pyfile('application.cfg') from views import oidc_provider_views app.register_blueprint(oidc_provider_views) # Initialize the oidc_provider after views to be able to set correct urls app.provider = init_oidc_provider(app) sess = Session() sess.init_app(app) login_manager = LoginManager() login_manager.init_app(app) return app
def oidc_provider_init_app(name=None, config=None): name = name or __name__ app = Flask(name) app.config.from_envvar(SE_LEG_PROVIDER_SETTINGS_ENVVAR) if config: app.config.update(config) # Init logging app = init_logging(app) # Init middleware app.wsgi_app = LocalhostMiddleware(app.wsgi_app, server_name=app.config['SERVER_NAME']) # Initialize registry for plugin handling r = Registry(app=app) r['packages'] = PackageRegistry(app) r['extensions'] = ExtensionRegistry(app) r['config'] = ConfigurationRegistry(app) r['blueprints'] = BlueprintAutoDiscoveryRegistry(app=app) # Init dbs app.authn_requests = OpStorageWrapper(app.config['DB_URI'], 'authn_requests') app.users = OpStorageWrapper(app.config['DB_URI'], 'userinfo') # Init queues app = init_redis_connection(app) app.authn_response_queue = rq.Queue('authn_responses', connection=app.redis) app.authn_response_delay_queue = Scheduler(queue_name='authn_responses', connection=app.redis) # Set up views from .views.oidc_provider import oidc_provider_views app.register_blueprint(oidc_provider_views) from .views.status import status_views app.register_blueprint(status_views) # Initialize the oidc_provider after views to be able to set correct urls app.provider = init_oidc_provider(app) return app