OXIESEC PANEL
- Current Dir:
/
/
usr
/
lib
/
python3
/
dist-packages
/
twisted
/
plugins
Server IP: 139.59.38.164
Upload:
Create Dir:
Name
Size
Modified
Perms
📁
..
-
03/31/2022 06:22:38 AM
rwxr-xr-x
📄
__init__.py
590 bytes
09/08/2017 10:38:36 AM
rw-r--r--
📁
__pycache__
-
03/31/2022 06:22:39 AM
rwxr-xr-x
📄
cred_anonymous.py
1017 bytes
09/08/2017 10:38:36 AM
rw-r--r--
📄
cred_file.py
1.83 KB
09/08/2017 10:38:36 AM
rw-r--r--
📄
cred_memory.py
2.33 KB
09/08/2017 10:38:36 AM
rw-r--r--
📄
cred_sshkeys.py
1.46 KB
09/08/2017 10:38:36 AM
rw-r--r--
📄
cred_unix.py
3.75 KB
09/23/2017 05:51:46 AM
rw-r--r--
📄
dropin.cache
6.05 KB
03/31/2022 06:22:40 AM
rwxr-xr-x
📄
twisted_conch.py
519 bytes
09/08/2017 10:38:36 AM
rw-r--r--
📄
twisted_core.py
589 bytes
09/08/2017 10:38:35 AM
rw-r--r--
📄
twisted_ftp.py
229 bytes
09/08/2017 10:38:36 AM
rw-r--r--
📄
twisted_inet.py
260 bytes
09/08/2017 10:38:36 AM
rw-r--r--
📄
twisted_names.py
247 bytes
09/08/2017 10:38:36 AM
rw-r--r--
📄
twisted_portforward.py
275 bytes
09/08/2017 10:38:36 AM
rw-r--r--
📄
twisted_reactors.py
1.84 KB
09/08/2017 10:38:35 AM
rw-r--r--
📄
twisted_runner.py
278 bytes
09/08/2017 10:38:36 AM
rw-r--r--
📄
twisted_socks.py
247 bytes
09/08/2017 10:38:36 AM
rw-r--r--
📄
twisted_trial.py
2.04 KB
09/08/2017 10:38:36 AM
rw-r--r--
📄
twisted_web.py
312 bytes
09/08/2017 10:38:36 AM
rw-r--r--
📄
twisted_words.py
1 KB
09/08/2017 10:38:36 AM
rw-r--r--
Editing: cred_file.py
Close
# -*- test-case-name: twisted.test.test_strcred -*- # # Copyright (c) Twisted Matrix Laboratories. # See LICENSE for details. """ Cred plugin for a file of the format 'username:password'. """ from __future__ import absolute_import, division import sys from zope.interface import implementer from twisted import plugin from twisted.cred.checkers import FilePasswordDB from twisted.cred.strcred import ICheckerFactory from twisted.cred.credentials import IUsernamePassword, IUsernameHashedPassword fileCheckerFactoryHelp = """ This checker expects to receive the location of a file that conforms to the FilePasswordDB format. Each line in the file should be of the format 'username:password', in plain text. """ invalidFileWarning = 'Warning: not a valid file' @implementer(ICheckerFactory, plugin.IPlugin) class FileCheckerFactory(object): """ A factory for instances of L{FilePasswordDB}. """ authType = 'file' authHelp = fileCheckerFactoryHelp argStringFormat = 'Location of a FilePasswordDB-formatted file.' # Explicitly defined here because FilePasswordDB doesn't do it for us credentialInterfaces = (IUsernamePassword, IUsernameHashedPassword) errorOutput = sys.stderr def generateChecker(self, argstring): """ This checker factory expects to get the location of a file. The file should conform to the format required by L{FilePasswordDB} (using defaults for all initialization parameters). """ from twisted.python.filepath import FilePath if not argstring.strip(): raise ValueError('%r requires a filename' % self.authType) elif not FilePath(argstring).isfile(): self.errorOutput.write('%s: %s\n' % (invalidFileWarning, argstring)) return FilePasswordDB(argstring) theFileCheckerFactory = FileCheckerFactory()