Model UserExternalSource to link with external accounts
Summary:
The model UserExternalSource allows to track relationships
between local user and external providers users:
The claim "Our local user_id N matches GitHub user_id M"
is a property maintained in a specific users_external_sources
table, and available through UserExternalSource.
A new method User::tryGetFromExternalSource allows to fetch
the local user from an external source name and user_id.
Test Plan:
Migration
Tested through ./artisan migrate.
Unit
- Non data destructive unit test for tryGetFromExternalSource not found case
- Manual test for tryGetFromExternalSource found case
Integration
- Add a record between a GitHub account and a user id account
- Implemented in AuthController external login
- Successfully logged in
Reviewers: dereckson
Differential Revision: http://devcentral.nasqueron.org/D432