Add API token support to the Djblets web API infrastructure.

Review Request #7475 — Created July 2, 2015 and submitted — Latest diff uploaded

Information

Djblets
release-0.9.x
9a80f73...

Reviewers

Review Board 2.5 introduced support for using API tokens for
authentication, but this was limited to Review Board. This change ports
over that logic into Djblets, so that other applications can make use of
the same API token capabilities.

This consists of backends for authentication, mixins for WebAPIResource
subclasses, an abstract model that projects can subclass for storing API
token data, policy validation and enforcement, and a model manager.

There are also unit tests for API token policy validation, plus a new
assertion function for helping test ValidationError messages.

Unit tests for both Djblets and Review Board pass (with the API token code
ripped out of Review Board).