mirror of
https://github.com/cwinfo/powerdns-admin.git
synced 2025-07-06 22:24:05 +00:00
feat: Allow sync domain with basic auth (#861)
This commit is contained in:
@ -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
|
||||
|
Reference in New Issue
Block a user