authz: utilize expired_at and last_valid_at columns of user_external_accounts
Created by: unknwon
This PR does two things in the PermsSyncer:
- When successfully used a token from
user_external_accounts, we update thelast_valid_atcolumn. - Otherwise, update the
expired_atcolumn.
Part of #14899
TODOs
-
Implements errcode.IsUnauthorizedfor GitHub and GitLab errors -
Add tests for db.ExternalAccounts -
Add tests for PermsSyncer