talons/talons — pull request #33 by meantheory (2014-11-08 23:05:31+00:00)
Title: created ability to short circuit the authentication process on a per resource basis

I would like the ability to turn off or short circuit the authentication process in certain circumstances. Doing this on a per Resource basis would fit my use cases nicely. Using it is as simple as adding the following to your Resource class.

NO_TALON_AUTH = True

I tested this against the head of falcon and it works fine for me. ymmv.

I looked into writing a test or two for this but the project is using testing tools I am currently unfamiliar with. I did manage to get the suite to run and it did blow up with the following:

$ testr run
running=${PYTHON:-python} -m subunit.run discover -t ./
======================================================================
FAIL: tests.auth.test_create_middleware.TestMiddleware.test_call
tags: worker-0
----------------------------------------------------------------------
Traceback (most recent call last):
File "/vagrant/talons/tests/auth/test_create_middleware.py", line 86, in test_call
self.assertEquals(None, m(req, None, None))
TypeError: __call__() missing 1 required positional argument: 'params'
Traceback (most recent call last):
testtools.testresult.real._StringException: Empty attachments:
pythonlogging:''

Traceback (most recent call last):
File "/vagrant/talons/tests/auth/test_create_middleware.py", line 86, in test_call
self.assertEquals(None, m(req, None, None))
TypeError: __call__() missing 1 required positional argument: 'params'

Traceback (most recent call last):
testtools.testresult.real._StringException: Empty attachments:
pythonlogging:''

Traceback (most recent call last):
File "/vagrant/talons/tests/auth/test_create_middleware.py", line 86, in test_call
self.assertEquals(None, m(req, None, None))
TypeError: __call__() missing 1 required positional argument: 'params'
Ran 31 tests in 0.069s (-0.004s)
FAILED (id=1, failures=1 (+1))