Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1151)

Unified Diff: third_party/twisted_8_1/twisted/plugins/cred_memory.py

Issue 12261012: Remove third_party/twisted_8_1 (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/tools/build
Patch Set: Created 7 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: third_party/twisted_8_1/twisted/plugins/cred_memory.py
diff --git a/third_party/twisted_8_1/twisted/plugins/cred_memory.py b/third_party/twisted_8_1/twisted/plugins/cred_memory.py
deleted file mode 100644
index 33153f79706bbedb7299c7c282dccdfc2655c30d..0000000000000000000000000000000000000000
--- a/third_party/twisted_8_1/twisted/plugins/cred_memory.py
+++ /dev/null
@@ -1,68 +0,0 @@
-# -*- test-case-name: twisted.test.test_strcred -*-
-#
-# Copyright (c) 2007-2008 Twisted Matrix Laboratories.
-# See LICENSE for details.
-
-"""
-Cred plugin for an in-memory user database.
-"""
-
-from zope.interface import implements
-
-from twisted import plugin
-from twisted.cred.strcred import ICheckerFactory
-from twisted.cred.checkers import InMemoryUsernamePasswordDatabaseDontUse
-from twisted.cred.credentials import IUsernamePassword, IUsernameHashedPassword
-
-
-
-inMemoryCheckerFactoryHelp = """
-A checker that uses an in-memory user database.
-
-This is only of use in one-off test programs or examples which
-don't want to focus too much on how credentials are verified. You
-really don't want to use this for anything else. It is a toy.
-"""
-
-
-
-class InMemoryCheckerFactory(object):
- """
- A factory for in-memory credentials checkers.
-
- This is only of use in one-off test programs or examples which don't
- want to focus too much on how credentials are verified.
-
- You really don't want to use this for anything else. It is, at best, a
- toy. If you need a simple credentials checker for a real application,
- see L{cred_passwd.PasswdCheckerFactory}.
- """
- implements(ICheckerFactory, plugin.IPlugin)
- authType = 'memory'
- authHelp = inMemoryCheckerFactoryHelp
- argStringFormat = 'A colon-separated list (name:password:...)'
- credentialInterfaces = (IUsernamePassword,
- IUsernameHashedPassword)
-
- def generateChecker(self, argstring):
- """
- This checker factory expects to get a list of
- username:password pairs, with each pair also separated by a
- colon. For example, the string 'alice:f:bob:g' would generate
- two users, one named 'alice' and one named 'bob'.
- """
- checker = InMemoryUsernamePasswordDatabaseDontUse()
- if argstring:
- pieces = argstring.split(':')
- if len(pieces) % 2:
- from twisted.cred.strcred import InvalidAuthArgumentString
- raise InvalidAuthArgumentString(
- "argstring must be in format U:P:...")
- for i in range(0, len(pieces), 2):
- username, password = pieces[i], pieces[i+1]
- checker.addUser(username, password)
- return checker
-
-
-
-theInMemoryCheckerFactory = InMemoryCheckerFactory()
« no previous file with comments | « third_party/twisted_8_1/twisted/plugins/cred_file.py ('k') | third_party/twisted_8_1/twisted/plugins/cred_unix.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698