Fix login

This commit is contained in:
2025-11-20 03:12:07 +01:00
parent 2e24f0edf9
commit 6cbaf08cfc
4 changed files with 10 additions and 5 deletions

3
.gitignore vendored
View File

@@ -1,4 +1,5 @@
.venv .venv
corenetworks-credentials.ini corenetworks-credentials.ini
.python-version .python-version
**.pyc **.pyc
certbot-test

View File

@@ -62,7 +62,9 @@ class Authenticator(dns_common.DNSAuthenticator):
def _get_corenetworks_client(self): def _get_corenetworks_client(self):
return _CoreNetworksAPIClient( return _CoreNetworksAPIClient(
self.credentials.conf("login"), self.credentials.conf("password"), self.ttl self.credentials.conf("username"),
self.credentials.conf("password"),
self.ttl,
) )
@@ -71,8 +73,8 @@ class _CoreNetworksAPIClient:
Encapsulates all communication with the Core Networks API. Encapsulates all communication with the Core Networks API.
""" """
def __init__(self, login, password, ttl): def __init__(self, username, password, ttl):
self.login = login self.username = username
self.password = password self.password = password
self.ttl = ttl self.ttl = ttl
self.token = None self.token = None
@@ -83,9 +85,11 @@ class _CoreNetworksAPIClient:
return self.token return self.token
try: try:
print(self.username)
print(self.password)
response = requests.post( response = requests.post(
f"{API_BASE_URL}/auth/token", f"{API_BASE_URL}/auth/token",
json={"login": self.login, "password": self.password}, json={"login": self.username, "password": self.password},
timeout=30, timeout=30,
) )
response.raise_for_status() response.raise_for_status()