(self, to, inner_path, use_my_cert=False, content=None)
| 706 | return self.response(to, "ok") |
| 707 | |
| 708 | def actionFileRules(self, to, inner_path, use_my_cert=False, content=None): |
| 709 | if not content: # No content defined by function call |
| 710 | content = self.site.content_manager.contents.get(inner_path) |
| 711 | |
| 712 | if not content: # File not created yet |
| 713 | cert = self.user.getCert(self.site.address) |
| 714 | if cert and cert["auth_address"] in self.site.content_manager.getValidSigners(inner_path): |
| 715 | # Current selected cert if valid for this site, add it to query rules |
| 716 | content = {} |
| 717 | content["cert_auth_type"] = cert["auth_type"] |
| 718 | content["cert_user_id"] = self.user.getCertUserId(self.site.address) |
| 719 | content["cert_sign"] = cert["cert_sign"] |
| 720 | |
| 721 | rules = self.site.content_manager.getRules(inner_path, content) |
| 722 | if inner_path.endswith("content.json") and rules: |
| 723 | if content: |
| 724 | rules["current_size"] = len(json.dumps(content)) + sum([file["size"] for file in list(content.get("files", {}).values())]) |
| 725 | else: |
| 726 | rules["current_size"] = 0 |
| 727 | return self.response(to, rules) |
| 728 | |
| 729 | # Add certificate to user |
| 730 | def actionCertAdd(self, to, domain, auth_type, auth_user_name, cert): |
nothing calls this directly
no test coverage detected