-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Bit of code ordering for the DNS check operations
- Loading branch information
Benjamin Bayart
committed
Jul 24, 2024
1 parent
31cbbbb
commit 55b0a2b
Showing
6 changed files
with
355 additions
and
303 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
from .domain import Domain | ||
from .dkim import DkimInfo | ||
from .utils import get_ip_address, make_auth_resolver | ||
|
||
__all__ = [ | ||
DkimInfo, | ||
Domain, | ||
get_ip_address, | ||
make_auth_resolver, | ||
] |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
|
||
class DkimInfo: | ||
v: str | None | ||
h: str | None | ||
k: str | None | ||
p: str | None | ||
|
||
def __init__(self, text: str): | ||
if text.startswith('"'): | ||
text = text.replace(" ","") | ||
text = text.replace('"', "") | ||
text = text.replace("\n", "") | ||
text = text.replace("\t", "") | ||
items = text.split(";") | ||
for item in items: | ||
print(f"Je regarde l'item {item}") | ||
(key, val) = item.split("=", 1) | ||
print(f"key = '{key}' et val = '{val}'") | ||
setattr(self, key, val) | ||
if self.v is None or self.h is None or self.k is None or self.p is None: | ||
raise Exception("Invalid DKIM") | ||
|
||
def __eq__(self, other) -> bool: | ||
if not isinstance(other, DkimInfo): | ||
return False | ||
if self.v == other.v and self.h == other.h and self.k == other.k and self.p == other.p: | ||
return True | ||
return False | ||
|
||
def __str__(self) -> str: | ||
return f"DkimInfo(v={self.v}, h={self.h}, k={self.k}, p={self.p})" | ||
|
||
|
Oops, something went wrong.