mirror of
https://github.com/quantum5/nginx-krbauth.git
synced 2025-04-24 12:32:03 -04:00
Correctly handle checking non-GET requests
This commit is contained in:
parent
d6a08d43cb
commit
cc52f74d9f
|
@ -11,9 +11,11 @@ import gssapi
|
||||||
import ldap
|
import ldap
|
||||||
from flask import Flask, Response, redirect, request
|
from flask import Flask, Response, redirect, request
|
||||||
from gssapi.exceptions import BadMechanismError, GSSError, GeneralError
|
from gssapi.exceptions import BadMechanismError, GSSError, GeneralError
|
||||||
|
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/check', endpoint='krbauth.check'))
|
||||||
|
|
||||||
timestamp = struct.Struct('!q')
|
timestamp = struct.Struct('!q')
|
||||||
hmac_digest = hashlib.sha512
|
hmac_digest = hashlib.sha512
|
||||||
|
@ -177,7 +179,7 @@ def auth():
|
||||||
return make_401('No Authorization header sent', context)
|
return make_401('No Authorization header sent', context)
|
||||||
|
|
||||||
|
|
||||||
@app.route('/krbauth/check')
|
@app.endpoint('krbauth.check')
|
||||||
def check():
|
def check():
|
||||||
if verify_cookie(request.cookies.get('krbauth'), Context.from_request()):
|
if verify_cookie(request.cookies.get('krbauth'), Context.from_request()):
|
||||||
return Response(status=200)
|
return Response(status=200)
|
||||||
|
|
Loading…
Reference in a new issue