Changeset - 89f11587b2dc
[Not reviewed]
default
8 1 8
Mads Kiilerich (mads) - 5 years ago 2020-10-10 23:38:20
mads@kiilerich.com
Grafted from: 072efc5acc42
config: move WSGI middleware apps from lib to config

These middlewares are full WSGI applications - that is not so lib-ish. The
middleware is referenced from the application in config - that seems like a
good place for them to live.
9 files changed with 6 insertions and 6 deletions:
0 comments (0 inline, 0 general)
kallithea/config/application.py
Show inline comments
 
@@ -5,29 +5,29 @@
 
# (at your option) any later version.
 
#
 
# This program is distributed in the hope that it will be useful,
 
# but WITHOUT ANY WARRANTY; without even the implied warranty of
 
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 
# GNU General Public License for more details.
 
#
 
# You should have received a copy of the GNU General Public License
 
# along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
"""WSGI middleware initialization for the Kallithea application."""
 

	
 
from kallithea.config.app_cfg import base_config
 
from kallithea.lib.middleware.https_fixup import HttpsFixup
 
from kallithea.lib.middleware.permanent_repo_url import PermanentRepoUrl
 
from kallithea.lib.middleware.simplegit import SimpleGit
 
from kallithea.lib.middleware.simplehg import SimpleHg
 
from kallithea.lib.middleware.wrapper import RequestWrapper
 
from kallithea.config.middleware.https_fixup import HttpsFixup
 
from kallithea.config.middleware.permanent_repo_url import PermanentRepoUrl
 
from kallithea.config.middleware.simplegit import SimpleGit
 
from kallithea.config.middleware.simplehg import SimpleHg
 
from kallithea.config.middleware.wrapper import RequestWrapper
 
from kallithea.lib.utils2 import asbool
 

	
 

	
 
__all__ = ['make_app']
 

	
 

	
 
def wrap_app(app):
 
    """Wrap the TG WSGI application in Kallithea middleware"""
 
    config = app.config
 

	
 
    # we want our low level middleware to get to the request ASAP. We don't
 
    # need any stack middleware in them - especially no StatusCodeRedirect buffering
kallithea/config/middleware/__init__.py
Show inline comments
 
file renamed from kallithea/lib/middleware/__init__.py to kallithea/config/middleware/__init__.py
kallithea/config/middleware/appenlight.py
Show inline comments
 
file renamed from kallithea/lib/middleware/appenlight.py to kallithea/config/middleware/appenlight.py
kallithea/config/middleware/https_fixup.py
Show inline comments
 
file renamed from kallithea/lib/middleware/https_fixup.py to kallithea/config/middleware/https_fixup.py
kallithea/config/middleware/permanent_repo_url.py
Show inline comments
 
file renamed from kallithea/lib/middleware/permanent_repo_url.py to kallithea/config/middleware/permanent_repo_url.py
kallithea/config/middleware/pygrack.py
Show inline comments
 
file renamed from kallithea/lib/middleware/pygrack.py to kallithea/config/middleware/pygrack.py
kallithea/config/middleware/simplegit.py
Show inline comments
 
file renamed from kallithea/lib/middleware/simplegit.py to kallithea/config/middleware/simplegit.py
 
@@ -22,27 +22,27 @@ This file was forked by the Kallithea pr
 
Original author and date, and relevant copyright and licensing information is below:
 
:created_on: Apr 28, 2010
 
:author: marcink
 
:copyright: (c) 2013 RhodeCode GmbH, and others.
 
:license: GPLv3, see LICENSE.md for more details.
 

	
 
"""
 

	
 

	
 
import logging
 
import re
 

	
 
from kallithea.config.middleware.pygrack import make_wsgi_app
 
from kallithea.lib.base import BaseVCSController, get_path_info
 
from kallithea.lib.hooks import log_pull_action
 
from kallithea.lib.middleware.pygrack import make_wsgi_app
 
from kallithea.lib.utils import make_ui
 
from kallithea.model.db import Repository
 

	
 

	
 
log = logging.getLogger(__name__)
 

	
 

	
 
GIT_PROTO_PAT = re.compile(r'^/(.+)/(info/refs|git-upload-pack|git-receive-pack)$')
 

	
 

	
 
cmd_mapping = {
 
    'git-receive-pack': 'push',
kallithea/config/middleware/simplehg.py
Show inline comments
 
file renamed from kallithea/lib/middleware/simplehg.py to kallithea/config/middleware/simplehg.py
kallithea/config/middleware/wrapper.py
Show inline comments
 
file renamed from kallithea/lib/middleware/wrapper.py to kallithea/config/middleware/wrapper.py
0 comments (0 inline, 0 general)