зеркало из https://github.com/microsoft/ghcrawler.git
Add repo types for token trait user
This commit is contained in:
Родитель
cb74e8aad6
Коммит
2fb14f598d
|
@ -137,8 +137,9 @@ class GitHubFetcher {
|
|||
}
|
||||
|
||||
_getToken(request) {
|
||||
const typeDetails = this._getTypeDetails(request.type);
|
||||
return this.tokenFactory.getToken(typeDetails.tokenTraits);
|
||||
const traits = this._getTypeDetails(request.type).tokenTraits;
|
||||
const repoType = request.context.repoType;
|
||||
return this.tokenFactory.getToken(traits.concat(repoType ? [repoType] : []));
|
||||
}
|
||||
|
||||
_getHeaders(request) {
|
||||
|
|
|
@ -126,6 +126,9 @@ class Processor {
|
|||
// * invitations
|
||||
// * stargazers
|
||||
const document = request.document;
|
||||
if (document.private) {
|
||||
request.context.repoType = 'private';
|
||||
}
|
||||
request.addRootSelfLink();
|
||||
request.linkSiblings(`urn:user:${document.owner.id}:repos`);
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче