diff options
author | drebs <drebs@leap.se> | 2013-05-23 16:09:23 -0300 |
---|---|---|
committer | drebs <drebs@leap.se> | 2013-05-23 16:09:39 -0300 |
commit | 6fc38f043e51131647e2a16dad8e1abd10440821 (patch) | |
tree | abb091b4c2e81bf9104dc139e009ac8ff11d3073 | |
parent | 0cab642cb1b93185c85bacf10b7ca93a313b7f66 (diff) |
Remove non-token auth schemes.
* Closes #2371.
-rw-r--r-- | src/leap/soledad/auth.py | 5 | ||||
-rw-r--r-- | src/leap/soledad/tests/test_leap_backend.py | 22 |
2 files changed, 3 insertions, 24 deletions
diff --git a/src/leap/soledad/auth.py b/src/leap/soledad/auth.py index 562a8263..8c093099 100644 --- a/src/leap/soledad/auth.py +++ b/src/leap/soledad/auth.py @@ -25,6 +25,7 @@ they can do token-based auth requests to the Soledad server. from u1db.remote.http_client import HTTPClientBase +from u1db import errors class TokenBasedAuth(object): @@ -66,5 +67,5 @@ class TokenBasedAuth(object): auth = '%s:%s' % (uuid, token) return [('Authorization', 'Token %s' % auth.encode('base64')[:-1])] else: - return HTTPClientBase._sign_request( - self, method, url_query, params) + raise errors.UnknownAuthMethod( + 'Wrong credentials: %s' % self._creds) diff --git a/src/leap/soledad/tests/test_leap_backend.py b/src/leap/soledad/tests/test_leap_backend.py index 8afae6f6..2e4b3b01 100644 --- a/src/leap/soledad/tests/test_leap_backend.py +++ b/src/leap/soledad/tests/test_leap_backend.py @@ -46,9 +46,6 @@ from leap.soledad import auth from leap.soledad.tests import u1db_tests as tests -from leap.soledad.tests.u1db_tests.test_remote_sync_target import ( - make_oauth_http_app, -) from leap.soledad.tests import BaseSoledadTest from leap.soledad.tests.u1db_tests import test_backends from leap.soledad.tests.u1db_tests import test_http_database @@ -128,12 +125,6 @@ def copy_token_http_database_for_test(test, db): class LeapTests(test_backends.AllDatabaseTests, BaseSoledadTest): scenarios = LEAP_SCENARIOS + [ - ('oauth_http', {'make_database_for_test': - test_backends.make_oauth_http_database_for_test, - 'copy_database_for_test': - test_backends.copy_oauth_http_database_for_test, - 'make_document_for_test': make_leap_document_for_test, - 'make_app_with_state': make_oauth_http_app}), ('token_http', {'make_database_for_test': make_token_http_database_for_test, 'copy_database_for_test': @@ -362,13 +353,6 @@ def leap_sync_target(test, path): test.getURL(path), crypto=test._soledad._crypto) -def oauth_leap_sync_target(test, path): - st = leap_sync_target(test, '~/' + path) - st.set_oauth_credentials(tests.consumer1.key, tests.consumer1.secret, - tests.token1.key, tests.token1.secret) - return st - - def token_leap_sync_target(test, path): st = leap_sync_target(test, path) st.set_token_credentials('user-uuid', 'auth-token') @@ -379,12 +363,6 @@ class TestLeapSyncTarget( test_remote_sync_target.TestRemoteSyncTargets, BaseSoledadTest): scenarios = [ - ('http', {'make_app_with_state': make_soledad_app, - 'make_document_for_test': make_leap_document_for_test, - 'sync_target': leap_sync_target}), - ('oauth_http', {'make_app_with_state': make_oauth_http_app, - 'make_document_for_test': make_leap_document_for_test, - 'sync_target': oauth_leap_sync_target}), ('token_soledad', {'make_app_with_state': make_token_soledad_app, 'make_document_for_test': make_leap_document_for_test, |