diff options
author | Ludovic Chabant <ludovic@chabant.com> | 2019-04-15 05:39:21 +0000 |
---|---|---|
committer | Drew DeVault <sir@cmpwn.com> | 2019-04-18 09:46:40 -0400 |
commit | 39cbae1f85dc45ca43ec4cd2c84b78990519e535 (patch) | |
tree | 48566ab1e58018c12f4a5ce8534049abf07ceb8e | |
parent | 5b547f4af88027925116981b758745d01b023f12 (diff) |
Moved authorization endpoint to scm.sr.ht
-rw-r--r-- | gitsrht/blueprints/repo.py | 14 |
1 files changed, 1 insertions, 13 deletions
diff --git a/gitsrht/blueprints/repo.py b/gitsrht/blueprints/repo.py index 6f10028..028c8d6 100644 --- a/gitsrht/blueprints/repo.py +++ b/gitsrht/blueprints/repo.py @@ -16,7 +16,7 @@ from io import BytesIO from pygments import highlight from pygments.lexers import guess_lexer, guess_lexer_for_filename, TextLexer from pygments.formatters import HtmlFormatter -from scmsrht.access import get_repo, get_repo_or_redir, has_access, UserAccess +from scmsrht.access import get_repo, get_repo_or_redir from scmsrht.formatting import get_formatted_readme, get_highlighted_file from scmsrht.redis import redis from scmsrht.urls import get_clone_urls @@ -25,18 +25,6 @@ from srht.markdown import markdown repo = Blueprint('repo', __name__) -@repo.route("/authorize") -def authorize_http_access(): - original_uri = request.headers.get("X-Original-URI") - original_uri = original_uri.split("/") - owner, repo = original_uri[1], original_uri[2] - owner, repo = get_repo(owner, repo) - if not repo: - return "authorized", 200 - if not has_access(repo, UserAccess.read): - return "unauthorized", 403 - return "authorized", 200 - def get_readme(repo, tip, link_prefix=None): if not tip: return None |