diff --git a/lib/githubFetcher.js b/lib/githubFetcher.js index 9f493f5..b009c2b 100644 --- a/lib/githubFetcher.js +++ b/lib/githubFetcher.js @@ -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) { diff --git a/lib/processor.js b/lib/processor.js index 22d7bd9..e018fb3 100644 --- a/lib/processor.js +++ b/lib/processor.js @@ -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`);