getlantern/lantern-controller — pull request #78 by aranhoide (2014-10-09 13:56:54+00:00)
Title: assign a random low trust fallback to any users with none.

This is done right when the client asks for a new S3Config. The check for
whether the user already had a fallback costs us nothing, since we were already
retrieving the LanternUser entry there.

The list of low trust fallbacks is hardcoded since at this point it can't be
obtained programmatically, and attacking this particular issue on its own seems
pointless considering that, as it is, this scheme to give away fallbacks is
trivially defeated by a straightforward sybil attack anyway, so if we keep
doing something on these lines we'll need a more extensive rethink and rewrite
in any case.

Although this won't work in a test controller, it will fail gracefully by
returning the config that this endpoint used to return by default.

I also tested this on my test controller with the test that enables such
graceful degradation disabled, so I could verify that the relevant fields in
the right LanternUser entry are updated correctly.