Apply fastAuthenticate() everywhere doing client-server communication

This commit is contained in:
Andrew Grant committed 2021-07-02 10:44:25 -04:00
1 parent 7b9b6f05e5
commit c53ef0c6e5
1 file changed
+24
+24
View File
@@ -626,6 +626,12 @@ def clientGetWorkload(request):
if random.randrange(2) == 1:
return HttpResponse('None')
try:
# Authenticate using saved IP addresses
user, machine = fastAuthenticate(request)
except UnableToAuthenticate:
# Verify the User's credentials
try: user = authenticate(request, True)
except UnableToAuthenticate: return HttpResponse('Bad Credentials')
@@ -664,6 +670,12 @@ def clientWrongBench(request):
# #
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
try:
# Authenticate using saved IP addresses
user, machine = fastAuthenticate(request)
except UnableToAuthenticate:
# Verify the User's credentials
try: user = authenticate(request, True)
except UnableToAuthenticate: return HttpResponse('Bad Credentials')
@@ -705,6 +717,12 @@ def clientSubmitNPS(request):
# #
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
try:
# Authenticate using saved IP addresses
user, machine = fastAuthenticate(request)
except UnableToAuthenticate:
# Verify the User's credentials
try: user = authenticate(request, True)
except UnableToAuthenticate: return HttpResponse('Bad Credentials')
@@ -729,6 +747,12 @@ def clientSubmitError(request):
# #
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
try:
# Authenticate using saved IP addresses
user, machine = fastAuthenticate(request)
except UnableToAuthenticate:
# Verify the User's credentials
try: user = authenticate(request, True)
except UnableToAuthenticate: return HttpResponse('Bad Credentials')