Correctly authenticate non-GET requests

This commit is contained in:
Quantum 2021-08-21 17:14:44 -04:00
parent 3832d2738d
commit d5d69b69a7

View file

@ -16,6 +16,7 @@ from werkzeug.routing import Rule
app = Flask(__name__) app = Flask(__name__)
app.logger.setLevel(logging.INFO) app.logger.setLevel(logging.INFO)
app.url_map.add(Rule('/krbauth', endpoint='krbauth.auth'))
app.url_map.add(Rule('/krbauth/check', endpoint='krbauth.check')) app.url_map.add(Rule('/krbauth/check', endpoint='krbauth.check'))
timestamp = struct.Struct('!q') timestamp = struct.Struct('!q')
@ -169,7 +170,7 @@ def auth_basic(context: Context, next_url: str) -> Response:
return auth_success(context, next_url) return auth_success(context, next_url)
@app.route('/krbauth') @app.endpoint('krbauth.auth')
def auth() -> Response: def auth() -> Response:
next_url = request.args.get('next', '/') next_url = request.args.get('next', '/')
context = Context.from_request() context = Context.from_request()