MCPcopy
hub / github.com/HelloZeroNet/ZeroNet / getValidSigners

Method getValidSigners

src/Content/ContentManager.py:780–792  ·  view source on GitHub ↗
(self, inner_path, content=None)

Source from the content-addressed store, hash-verified

778 # The valid signers of content.json file
779 # Return: ["1KRxE1s3oDyNDawuYWpzbLUwNm8oDbeEp6", "13ReyhCsjhpuCVahn1DHdf6eMqqEVev162"]
780 def getValidSigners(self, inner_path, content=None):
781 valid_signers = []
782 if inner_path == "content.json": # Root content.json
783 if "content.json" in self.contents and "signers" in self.contents["content.json"]:
784 valid_signers += self.contents["content.json"]["signers"][:]
785 else:
786 rules = self.getRules(inner_path, content)
787 if rules and "signers" in rules:
788 valid_signers += rules["signers"]
789
790 if self.site.address not in valid_signers:
791 valid_signers.append(self.site.address) # Site address always valid
792 return valid_signers
793
794 # Return: The required number of valid signs for the content.json
795 def getSignsRequired(self, inner_path, content=None):

Callers 9

getRulesMethod · 0.95
signMethod · 0.95
verifyFileMethod · 0.95
hasFilePermissionMethod · 0.80
actionFileWriteMethod · 0.80
actionFileRulesMethod · 0.80
testSignersMethod · 0.80
testIncludeMethod · 0.80

Calls 1

getRulesMethod · 0.95

Tested by 2

testSignersMethod · 0.64
testIncludeMethod · 0.64