lookup repo permissions from SRC_ACCESS_TOKEN for LSIF upload
Created by: Strum355
This PR allows determining whether a user can upload LSIF for a repository from the SRC_ACCESS_TOKEN, instead of having to provide a Github Access Token
Test plan
TODO: we tried locally, but couldn't figure out how 2
What we tried:
- set
allowSignup
to true in extsvc config for the Github service - Signup with my/this account
- https://sourcegraph.test:3443/users/Strum355/settings/repositories says "The authenticated user does not have access to this external service", yet I can view the repo in search results
- Postgres output is as follows, where user_id 2 = strum355 and not a site-admin:
postgres=# select * from user_permissions ;
user_id | permission | object_type | updated_at | synced_at | object_ids_ints
---------+------------+-------------+------------------------------+------------------------------+-----------------
2 | read | repos | 2022-04-14 17:48:57.03302+00 | 2022-04-14 17:48:57.03302+00 | {}
- I also cant add a github codehost for Strum355 as we're not in dotcom mode
-
🤷 confused