зеркало из
1
0
Форкнуть 0

Account: use a public authorization token for accounts

Instead of using a single configured app, use a public auth
token (essentially, any random app configured), to split it
from being contextual and provide theoretically more ability
to query.
This commit is contained in:
Jeff Wilcox 2023-12-13 08:48:50 -08:00
Родитель 8f538f417f
Коммит 2e079f107b
1 изменённых файлов: 4 добавлений и 2 удалений

Просмотреть файл

@ -12,7 +12,7 @@ import { corporateLinkToJson } from './corporateLink';
import { Organization } from './organization';
import { AppPurpose } from '../lib/github/appPurposes';
import { ILinkProvider } from '../lib/linkProviders';
import { CacheDefault, getMaxAgeSeconds } from '.';
import { CacheDefault, Operations, getMaxAgeSeconds } from '.';
import {
AccountJsonFormat,
CoreCapability,
@ -358,8 +358,10 @@ export class Account {
cacheOptions.backgroundRefresh = options.backgroundRefresh;
}
try {
const ops = operations as Operations;
const entity = (await operations.github.request(
this.authorize(AppPurpose.Data),
ops.getPublicAuthorizationToken(),
// this.authorize(AppPurpose.Data),
'GET /user/:id',
parameters,
cacheOptions