feat: Allow sync domain with basic auth (#861)

This commit is contained in:
jbe-dw
2021-01-16 20:37:11 +01:00
committed by GitHub
parent c3d438842f
commit dd0a5f6326
2 changed files with 12 additions and 1 deletions

View File

@ -291,3 +291,13 @@ def dyndns_login_required(f):
return f(*args, **kwargs)
return decorated_function
def apikey_or_basic_auth(f):
@wraps(f)
def decorated_function(*args, **kwargs):
api_auth_header = request.headers.get('X-API-KEY')
if api_auth_header:
return apikey_auth(f)(*args, **kwargs)
else:
return api_basic_auth(f)(*args, **kwargs)
return decorated_function