Skip to content

Commit

Permalink
- Add a warning when BIMI records do not provide a mark certificate
Browse files Browse the repository at this point in the history
- Ude the correct dependency (`xmltodict`, not `xml2dict`)
  • Loading branch information
seanthegeek committed Oct 26, 2024
1 parent d9b9a33 commit b9823bf
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 3 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
Changelog
=========

5.6.2
-----

- Add a warning when BIMI records do not provide a mark certificate
- Ude the correct dependency (`xmltodict`, not `xml2dict`)

5.6.1
-----

Expand Down
2 changes: 1 addition & 1 deletion checkdmarc/_constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
See the License for the specific language governing permissions and
limitations under the License."""

__version__ = "5.6.1"
__version__ = "5.6.2"

OS = platform.system()
OS_RELEASE = platform.release()
Expand Down
6 changes: 6 additions & 0 deletions checkdmarc/bimi.py
Original file line number Diff line number Diff line change
Expand Up @@ -372,6 +372,7 @@ def parse_bimi_record(

pairs = BIMI_TAG_VALUE_REGEX.findall(record)
tags = OrderedDict()
certificate_provided = False

for pair in pairs:
tag = pair[0].lower().strip()
Expand Down Expand Up @@ -421,11 +422,16 @@ def parse_bimi_record(
try:
response = session.get(tag_value)
response.raise_for_status()
certificate_provided = True
except Exception as e:
warnings.append(
f"Unable to download Authority Evidence at "
f"{tag_value} - {str(e)}"
)
if not certificate_provided:
warnings.append(
"Most providers will not display a BIMI image without a mark certificate"
)

return OrderedDict(tags=tags, warnings=warnings)

Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ dependencies = [
"pyleri>=1.3.2",
"requests>=2.25.0",
"timeout-decorator>=0.4.1",
"xml2dict>=0.2.2",
"xmltodict>=0.14.2",
]

[project.scripts]
Expand Down
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ expiringdict>=1.1.4
pyleri>=1.3.2
publicsuffixlist>=0.10.0
requests>=2.25.0
xml2dict>=0.2.2
xml2dict>=0.14.2
timeout-decorator>=0.5.0
flake8>=3.8.4
sphinx>=3.3.1
Expand Down

0 comments on commit b9823bf

Please sign in to comment.