Find the relevant certificate zones
(cert, zones)
| 136 | |
| 137 | |
| 138 | def get_cert_zones(cert, zones): |
| 139 | """ |
| 140 | Find the relevant certificate zones |
| 141 | """ |
| 142 | cert_zones = [] |
| 143 | |
| 144 | if "subject_common_names" in cert: |
| 145 | for cn in cert["subject_common_names"]: |
| 146 | for zone in zones: |
| 147 | if cn == zone or cn.endswith("." + zone): |
| 148 | if zone not in cert_zones: |
| 149 | cert_zones.append(zone) |
| 150 | |
| 151 | if "subject_dns_names" in cert: |
| 152 | for cn in cert["subject_dns_names"]: |
| 153 | for zone in zones: |
| 154 | if cn == zone or cn.endswith("." + zone): |
| 155 | if zone not in cert_zones: |
| 156 | cert_zones.append(zone) |
| 157 | |
| 158 | return cert_zones |
| 159 | |
| 160 | |
| 161 | def add_new_certificate_values( |
no outgoing calls
no test coverage detected