Пример #1
0
 def setUp(self):
     from certbot.plugins.webroot import Authenticator
     self.path = tempfile.mkdtemp()
     self.root_challenge_path = os.path.join(self.path, ".well-known",
                                             "acme-challenge")
     self.validation_path = os.path.join(
         self.root_challenge_path,
         "ZXZhR3hmQURzNnBTUmIyTEF2OUlaZjE3RHQzanV4R0orUEN0OTJ3citvQQ")
     self.config = mock.MagicMock(webroot_path=self.path,
                                  webroot_map={"thing.com": self.path})
     self.auth = Authenticator(self.config, "webroot")
Пример #2
0
 def setUp(self):
     from certbot.plugins.webroot import Authenticator
     # On Linux directories created by tempfile.mkdtemp inherit their permissions from their
     # parent directory. So the actual permissions are inconsistent over various tests env.
     # To circumvent this, a dedicated sub-workspace is created under the workspace, using
     # filesystem.mkdir to get consistent permissions.
     self.workspace = tempfile.mkdtemp()
     self.path = os.path.join(self.workspace, 'webroot')
     filesystem.mkdir(self.path)
     self.partial_root_challenge_path = os.path.join(
         self.path, ".well-known")
     self.root_challenge_path = os.path.join(self.path, ".well-known",
                                             "acme-challenge")
     self.validation_path = os.path.join(
         self.root_challenge_path,
         "ZXZhR3hmQURzNnBTUmIyTEF2OUlaZjE3RHQzanV4R0orUEN0OTJ3citvQQ")
     self.config = mock.MagicMock(webroot_path=self.path,
                                  webroot_map={"thing.com": self.path})
     self.auth = Authenticator(self.config, "webroot")
Пример #3
0
 def _get_config_after_perform(self, config):
     from certbot.plugins.webroot import Authenticator
     auth = Authenticator(config, "webroot")
     auth.perform([self.achall])
     return auth.config