alphagov/backdrop — pull request #285 by jcbashdown (2014-05-08 14:20:40+00:00)
Title: Users from stagecraft

This pull request replaces the UserConfigRepository with UserConfigHttpRepository when the app config has USE_USER_CONFIG_HTTP_REPOSITORY set.

This repository uses a hypothetical stagecraft endpoint '/users/user_email' to fetch data about a given user and instantiate a UserConfig object. It has the same interface as the old repository minus the save method which now raises a not implemented error.

It factors out the logic to chat up stagecraft from DataSetConfigRepository to a common class HttpRepository that is then proxied too from this class and the UserConfigHttpRepository.

It uses a common get_user_repository method in each app which takes the app in order to instantiate the correct repository.

It has tests.