middleware Package

middleware Package

WSGI Middleware.

profile Module

Middleware that profiles the request with cProfile and displays profiling information at the bottom of each page.

class galaxy.web.framework.middleware.profile.ProfileMiddleware(app, global_conf=None, limit=40)[source]

Bases: object

Middleware that profiles all requests.

All HTML pages will have profiling information appended to them. The data is isolated to that single request, and does not include data from previous requests.

galaxy.web.framework.middleware.profile.func_std_string(func_name)[source]

Match what old profile produced

galaxy.web.framework.middleware.profile.get_func_list(stats, sel_list)[source]

Use ‘sel_list’ to select a list of functions to display.

galaxy.web.framework.middleware.profile.pstats_as_html(stats, *sel_list)[source]

Return an HTML representation of a pstats.Stats object.

remoteuser Module

Middleware for handling $REMOTE_USER if use_remote_user is enabled.

class galaxy.web.framework.middleware.remoteuser.RemoteUser(app, maildomain=None, display_servers=None, admin_users=None, remote_user_header=None, remote_user_secret_header=None)[source]

Bases: object

error(start_response, title='Access denied', message='Please contact your local Galaxy administrator.')[source]

static Module

class galaxy.web.framework.middleware.static.CacheableStaticURLParser(directory, cache_seconds=None)[source]

Bases: paste.urlparser.StaticURLParser

galaxy.web.framework.middleware.static.make_static(global_conf, document_root, cache_seconds=None)[source]

translogger Module

Middleware for logging requests, using Apache combined log format

class galaxy.web.framework.middleware.translogger.TransLogger(application, logger=None, format=None, logging_level=20, logger_name='wsgi', setup_console_handler=True, set_logger_level=10)[source]

Bases: object

This logging middleware will log all requests as they go through. They are, by default, sent to a logger named 'wsgi' at the INFO level.

If setup_console_handler is true, then messages for the named logger will be sent to the console.

format = '%(REMOTE_ADDR)s - %(REMOTE_USER)s [%(time)s] "%(REQUEST_METHOD)s %(REQUEST_URI)s %(HTTP_VERSION)s" %(status)s %(bytes)s "%(HTTP_REFERER)s" "%(HTTP_USER_AGENT)s"'
write_log(environ, method, req_uri, start, status, bytes)[source]
galaxy.web.framework.middleware.translogger.make_filter(app, global_conf, logger_name='wsgi', format=None, logging_level=20, setup_console_handler=True, set_logger_level=10)[source]

This logging middleware will log all requests as they go through. They are, by default, sent to a logger named 'wsgi' at the INFO level.

If setup_console_handler is true, then messages for the named logger will be sent to the console.

xforwardedhost Module

class galaxy.web.framework.middleware.xforwardedhost.XForwardedHostMiddleware(app, global_conf=None)[source]

Bases: object

A WSGI middleware that changes the HTTP host header in the WSGI environ based on the X-Forwarded-Host header IF found