Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Remove vep.verify[remote|local|dummy] functions.

They were adding needless confusion.  Clients should either use the
defaults provided by vep.verify(), or use a full-blown Verifier object.
  • Loading branch information...
commit 32798c0d16cb64e4d465802d231c82ff4159b386 1 parent 6fdc476
@rfk rfk authored
Showing with 12 additions and 53 deletions.
  1. +8 −0 CHANGES.txt
  2. +3 −41 vep/__init__.py
  3. +1 −12 vep/tests/test_verifiers.py
View
8 CHANGES.txt
@@ -1,3 +1,11 @@
+0.4.0 - ????-??-??
+==================
+
+ * Allow LocalVerifier to use of a custom JWT parser.
+ * Remove vep.verify_[remote|local|dummy] since they just cause
+ confusion. You should either accept the defaults provided by
+ vep.verify, or use a full-blown Verifier object.
+
0.3.2 - 2012-02-03
==================
View
44 vep/__init__.py
@@ -27,6 +27,9 @@
from vep.verifiers.dummy import DummyVerifier # NOQA
+_DEFAULT_REMOTE_VERIFIER = None
+
+
def verify(assertion, audience=None):
"""Verify the given VEP assertion.
@@ -35,48 +38,7 @@ def verify(assertion, audience=None):
method currently involves POSTing to the hosted verifier service on
browserid.org; eventually it will do local verification.
"""
- return verify_remote(assertion, audience)
-
-
-_DEFAULT_REMOTE_VERIFIER = None
-_DEFAULT_LOCAL_VERIFIER = None
-_DEFAULT_DUMMY_VERIFIER = None
-
-
-def verify_remote(assertion, audience=None):
- """Verify the given VEP assertion by posting to the remote verifier.
-
- This is a convenience wrapper that uses the RemoteVerifier class in its
- default configuration. If you have more particular needs, create your own
- instance of RemoteVerifier and use its verify() method.
- """
global _DEFAULT_REMOTE_VERIFIER
if _DEFAULT_REMOTE_VERIFIER is None:
_DEFAULT_REMOTE_VERIFIER = RemoteVerifier()
return _DEFAULT_REMOTE_VERIFIER.verify(assertion, audience)
-
-
-def verify_local(assertion, audience=None):
- """Verify the given VEP assertion by doing local certificate checking.
-
- This is a convenience wrapper that uses the LocalVerifier class in its
- default configuration. If you have more particular needs, create your own
- instance of LocalVerifier and use its verify() method.
- """
- global _DEFAULT_LOCAL_VERIFIER
- if _DEFAULT_LOCAL_VERIFIER is None:
- _DEFAULT_LOCAL_VERIFIER = LocalVerifier()
- return _DEFAULT_LOCAL_VERIFIER.verify(assertion, audience)
-
-
-def verify_dummy(assertion, audience=None):
- """Verify the given VEP assertion as a dummy assertion.
-
- This is a convenience wrapper that uses the DummyVerifier class in its
- default configuration. If you have more particular needs, create your own
- instance of DummyVerifier and use its verify() method.
- """
- global _DEFAULT_DUMMY_VERIFIER
- if _DEFAULT_DUMMY_VERIFIER is None:
- _DEFAULT_DUMMY_VERIFIER = DummyVerifier()
- return _DEFAULT_DUMMY_VERIFIER.verify(assertion, audience)
View
13 vep/tests/test_verifiers.py
@@ -414,18 +414,7 @@ def tearDown(self):
self.verifier.close()
-class TestShortcutFunctions(unittest.TestCase):
+class TestShortcutFunction(unittest.TestCase):
def test_shortcut(self):
self.assertRaises(TrustError, vep.verify, EXPIRED_ASSERTION)
-
- def test_shortcut_remote(self):
- self.assertRaises(TrustError, vep.verify_remote, EXPIRED_ASSERTION)
-
- def test_shortcut_local(self):
- with warnings.catch_warnings():
- warnings.simplefilter("always")
- self.assertRaises(TrustError, vep.verify_local, EXPIRED_ASSERTION)
-
- def test_shortcut_dummy(self):
- self.assertRaises(TrustError, vep.verify_dummy, EXPIRED_ASSERTION)
Please sign in to comment.
Something went wrong with that request. Please try again.