Marinus maintains a configuration which tells it meta information about the organizations that it tracks. This includes registration information that would be included in Whois records and TLS certificates. This function initializes that table with empty values and is part of the initia
(mongo_collection)
| 263 | |
| 264 | |
| 265 | def create_config_collection(mongo_collection): |
| 266 | """ |
| 267 | Marinus maintains a configuration which tells it meta information about the organizations that it tracks. |
| 268 | This includes registration information that would be included in Whois records and TLS certificates. |
| 269 | This function initializes that table with empty values and is part of the initial set up process. |
| 270 | """ |
| 271 | new_config = {} |
| 272 | new_config["DNS_Admins"] = [] |
| 273 | new_config["SSL_Orgs"] = [] |
| 274 | new_config["Whois_Orgs"] = [] |
| 275 | new_config["Whois_Name_Servers"] = [] |
| 276 | now = datetime.now() |
| 277 | new_config["updated"] = now |
| 278 | |
| 279 | config_collection = mongo_collection.get_config_connection() |
| 280 | if config_collection.count_documents({}) > 0: |
| 281 | print("WARNING: The config collection already exists. Skipping initialiation.") |
| 282 | return |
| 283 | |
| 284 | config_collection.insert_one(new_config) |
| 285 | |
| 286 | |
| 287 | def add_tls_org(mongo_connector, org): |
no test coverage detected