def latest_reports(): https_domains = Domain.eligible('https') total = len(https_domains) uses = 0 enforces = 0 hsts = 0 for domain in https_domains: report = domain['https'] # HTTPS needs to be enabled. # It's okay if it has a bad chain. # However, it's not okay if HTTPS is downgraded. if ( (report['uses'] >= 1) and (report['enforces'] >= 1) ): uses += 1 # Needs to be Default or Strict to be 'Yes' if report['enforces'] >= 2: enforces += 1 # Needs to be at least partially present if report['hsts'] >= 1: hsts += 1 https_report = { 'https': { 'eligible': total, 'uses': uses, 'enforces': enforces, 'hsts': hsts } } analytics_domains = Domain.eligible('analytics') total = len(analytics_domains) participating = 0 for domain in analytics_domains: report = domain['analytics'] if report['participating'] == True: participating += 1 analytics_report = { 'analytics': { 'eligible': total, 'participating': participating } } return [https_report, analytics_report]
def latest_reports(): https_domains = Domain.eligible('https') total = len(https_domains) uses = 0 enforces = 0 hsts = 0 for domain in https_domains: report = domain['https'] # HTTPS needs to be enabled. # It's okay if it has a bad chain. # However, it's not okay if HTTPS is downgraded. if ( (report['uses'] >= 1) and (report['enforces'] >= 1) ): uses += 1 # Needs to be Default or Strict to be 'Yes' if report['enforces'] >= 2: enforces += 1 # Needs to be present with >= 1 year max-age on canonical endpoint if report['hsts'] >= 2: hsts += 1 https_report = { 'https': { 'eligible': total, 'uses': uses, 'enforces': enforces, 'hsts': hsts } } analytics_domains = Domain.eligible('analytics') total = len(analytics_domains) participating = 0 for domain in analytics_domains: report = domain['analytics'] if report['participating'] == True: participating += 1 analytics_report = { 'analytics': { 'eligible': total, 'participating': participating } } return [https_report, analytics_report]
def latest_reports(): https_domains = Domain.eligible('https') total = len(https_domains) uses = 0 enforces = 0 hsts = 0 for domain in https_domains: report = domain['https'] # HTTPS needs to be enabled. # It's okay if it has a bad chain. # However, it's not okay if HTTPS is downgraded. if ((report['uses'] >= 1) and (report['enforces'] >= 1)): uses += 1 # Needs to be Default or Strict to be 'Yes' if report['enforces'] >= 2: enforces += 1 # Needs to be present with >= 1 year max-age on canonical endpoint if report['hsts'] >= 2: hsts += 1 https_report = { 'https': { 'eligible': total, 'uses': uses, 'enforces': enforces, 'hsts': hsts } } analytics_domains = Domain.eligible('analytics') total = len(analytics_domains) participating = 0 for domain in analytics_domains: report = domain['analytics'] if report['participating'] == True: participating += 1 analytics_report = { 'analytics': { 'eligible': total, 'participating': participating } } a11y_domains = Domain.eligible('a11y') a11y_report = {'a11y': {}} for domain in a11y_domains: a11y_report['a11y'][domain['domain']] = domain['a11y']['error_details'] cust_sat_domains = Domain.eligible('cust_sat') total = len(cust_sat_domains) participating = 0 for domain in cust_sat_domains: if domain['cust_sat']['participating']: participating += 1 cust_sat_report = { 'cust_sat': { 'eligible': total, 'participating': participating } } return [https_report, analytics_report, a11y_report, cust_sat_report]