From f45fd6bd764e0a197615692664db824fbc18934e Mon Sep 17 00:00:00 2001 From: "Collin M. Barrett" Date: Mon, 15 Oct 2018 11:09:03 -0500 Subject: [PATCH] authenticate GitHub API calls --- src/FilterLists.Services/GitHub/GitHubService.cs | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/FilterLists.Services/GitHub/GitHubService.cs b/src/FilterLists.Services/GitHub/GitHubService.cs index 0e8afc530..edbea3552 100644 --- a/src/FilterLists.Services/GitHub/GitHubService.cs +++ b/src/FilterLists.Services/GitHub/GitHubService.cs @@ -12,7 +12,15 @@ namespace FilterLists.Services.GitHub public class GitHubService { private const string RawFileUrlRoot = "raw.githubusercontent.com"; - private readonly GitHubClient client = new GitHubClient(new ProductHeaderValue("FilterLists")); + private const string ProductHeader = "FilterLists"; + private const string ReadOnlyPersonalAccessToken = "25ef3c8e20d2fcacf1583e7650b63cfa3e784fec"; + private readonly GitHubClient client; + + public GitHubService() => + client = new GitHubClient(new ProductHeaderValue(ProductHeader)) + { + Credentials = new Credentials(ReadOnlyPersonalAccessToken) + }; public async Task GetCommitDatesAsync(string rawFileUrl) {