Skip to content

Commit

Permalink
category fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
mxsasha committed Feb 12, 2025
1 parent 42e56e5 commit 30ebaab
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 20 deletions.
38 changes: 19 additions & 19 deletions checks/categories.py
Original file line number Diff line number Diff line change
Expand Up @@ -1313,9 +1313,9 @@ def result_bad(self, tech_data):
class WebCaa(Subtest):
def __init__(self):
super(WebCaa, self).__init__(
name="cert_caa",
label="detail web cert-caa label",
explanation="detail web cert-caa exp",
name="caa",
label="detail web caa label",
explanation="detail web caa exp",
worst_status=scoring.CAA_WORST_STATUS,
full_score=scoring.CAA_GOOD,
model_score_field="caa_score",
Expand Down Expand Up @@ -1943,31 +1943,31 @@ def result_has_daneTA(self, tech_data):

class MailCaa(Subtest):
def __init__(self):
super(MailCaa, self).__init__(
name="cert_caa",
label="detail mail cert-caa label",
explanation="detail mail cert-caa exp",
tech_string="detail mail cert-caa tech table",
init_tech_type="",
super().__init__(
name="caa",
label="detail mail caa label",
explanation="detail mail caa exp",
worst_status=scoring.CAA_WORST_STATUS,
full_score=scoring.CAA_GOOD,
model_score_field="cert_caa_score",
model_score_field="caa_score",
init_tech_type="table_translatable",
tech_data_translation_root="detail tech data caa",
)

def result_good(self, tech_data):
def result_good(self, tech_data: list[TranslatableTechTableItem]):
self._status(STATUS_SUCCESS)
self.verdict = "detail mail cert-caa verdict good"
self.tech_data = ""
self.verdict = "detail mail caa verdict good"
self.tech_data = [tti.to_dict() for tti in tech_data]

def result_info(self, tech_data):
def result_recommendations(self, tech_data: list[TranslatableTechTableItem]):
self._status(STATUS_INFO)
self.verdict = "detail mail cert-caa verdict warning"
self.tech_data = ""
self.verdict = "detail mail caa verdict recommendations"
self.tech_data = [tti.to_dict() for tti in tech_data]

def result_bad(self, tech_data):
def result_bad(self, tech_data: list[TranslatableTechTableItem]):
self._status(STATUS_FAIL)
self.verdict = "detail mail cert-caa verdict bad"
self.tech_data = ""
self.verdict = "detail mail caa verdict bad"
self.tech_data = [tti.to_dict() for tti in tech_data]


class MailTlsZeroRTT(Subtest):
Expand Down
5 changes: 4 additions & 1 deletion checks/tasks/tls.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@
resolve_a_aaaa,
resolve_dane,
results_per_domain,
TranslatableTechTableItem,
)
from checks.tasks.tls_connection import (
MAX_REDIRECT_DEPTH,
Expand Down Expand Up @@ -888,7 +889,9 @@ def annotate_and_combine_all(good_items, sufficient_items, bad_items, phaseout_i
else:
category.subtests["cert_hostmatch"].result_good()

caa_found_host_message = [{"msg_id": "found_host", "context": {"host": dttls.caa_found_host}}]
caa_found_host_message = [
TranslatableTechTableItem(msg_id="found_host", context={"host": dttls.caa_found_host})
]
caa_tech_table = caa_found_host_message + dttls.caa_errors + dttls.caa_recommendations
if not dttls.caa_enabled or dttls.caa_errors:
category.subtests["caa"].result_bad(caa_tech_table)
Expand Down

0 comments on commit 30ebaab

Please sign in to comment.