Use Py3k-compatible 'implementer' class decorator.
| | |
| | | from zope.interface import implements |
| | | from zope.interface import implementer |
| | | |
| | | from repoze.who.interfaces import IAPI |
| | | from repoze.who.interfaces import IAPIFactory |
| | |
| | | return environ.get('repoze.who.api') |
| | | |
| | | |
| | | @implementer(IAPIFactory) |
| | | class APIFactory(object): |
| | | implements(IAPIFactory) |
| | | |
| | | def __init__(self, |
| | | identifiers=(), |
| | |
| | | return result |
| | | |
| | | |
| | | @implementer(IAPI) |
| | | class API(object): |
| | | implements(IAPI) |
| | | |
| | | def __init__(self, |
| | | environ, |
| | |
| | | import os |
| | | import time |
| | | |
| | | from zope.interface import implements |
| | | from zope.interface import implementer |
| | | |
| | | from repoze.who.interfaces import IIdentifier |
| | | from repoze.who.interfaces import IAuthenticator |
| | |
| | | return _NOW_TESTING |
| | | return datetime.datetime.now() |
| | | |
| | | @implementer(IIdentifier, IAuthenticator) |
| | | class AuthTktCookiePlugin(object): |
| | | implements(IIdentifier, IAuthenticator) |
| | | |
| | | |
| | | userid_type_decoders = {'int':int} |
| | |
| | | from repoze.who._compat import AUTHORIZATION |
| | | from webob.exc import HTTPUnauthorized |
| | | |
| | | from zope.interface import implements |
| | | from zope.interface import implementer |
| | | |
| | | from repoze.who.interfaces import IIdentifier |
| | | from repoze.who.interfaces import IChallenger |
| | | |
| | | @implementer(IIdentifier, IChallenger) |
| | | class BasicAuthPlugin(object): |
| | | |
| | | implements(IIdentifier, IChallenger) |
| | | |
| | | def __init__(self, realm): |
| | | self.realm = realm |
| | |
| | | import itertools |
| | | |
| | | from zope.interface import implements |
| | | from zope.interface import implementer |
| | | |
| | | from repoze.who.interfaces import IAuthenticator |
| | | from repoze.who.utils import resolveDotted |
| | |
| | | yield 'aaaaaa:bbbbbb' |
| | | |
| | | |
| | | @implementer(IAuthenticator) |
| | | class HTPasswdPlugin(object): |
| | | |
| | | implements(IAuthenticator) |
| | | |
| | | def __init__(self, filename, check): |
| | | self.filename = filename |
| | |
| | | import cgi |
| | | |
| | | from webob.exc import HTTPFound |
| | | from zope.interface import implements |
| | | from zope.interface import implementer |
| | | |
| | | from repoze.who.interfaces import IChallenger |
| | | from repoze.who._compat import construct_url |
| | | from repoze.who._compat import header_value |
| | | |
| | | @implementer(IChallenger) |
| | | class RedirectorPlugin(object): |
| | | """ Plugin for issuing challenges as redirects to a configured URL. |
| | | |
| | |
| | | supplied an ``X-Authorization-Failure-Reason`` header, the plugin |
| | | includes that reason in the query string of the redirected URL. |
| | | """ |
| | | implements(IChallenger) |
| | | |
| | | |
| | | def __init__(self, |
| | | login_url, |
| | | came_from_param='came_from', |
| | |
| | | from zope.interface import implements |
| | | from zope.interface import implementer |
| | | |
| | | from repoze.who.interfaces import IAuthenticator |
| | | from repoze.who.interfaces import IMetadataProvider |
| | |
| | | return psycopg2.connect(kw['repoze.who.dsn']) #pragma NO COVERAGE |
| | | return conn_factory #pragma NO COVERAGE |
| | | |
| | | @implementer(IAuthenticator) |
| | | class SQLAuthenticatorPlugin: |
| | | implements(IAuthenticator) |
| | | |
| | | |
| | | def __init__(self, query, conn_factory, compare_fn): |
| | | # statement should be pyformat dbapi binding-style, e.g. |
| | | # "select user_id, password from users where login=%(login)s" |
| | |
| | | if self.compare_fn(identity['password'], password): |
| | | return user_id |
| | | |
| | | @implementer(IMetadataProvider) |
| | | class SQLMetadataProviderPlugin: |
| | | implements(IMetadataProvider) |
| | | |
| | | |
| | | def __init__(self, name, query, conn_factory, filter): |
| | | self.name = name |
| | | self.query = query |