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_at
column. - Otherwise, update the
expired_at
column.
Part of #14899
TODOs
-
Implements errcode.IsUnauthorized
for GitHub and GitLab errors -
Add tests for db.ExternalAccounts
-
Add tests for PermsSyncer