Skip to content

Commit

Permalink
Merge pull request #100 from Dentsudatalab/revert-halv-swap-from-acce…
Browse files Browse the repository at this point in the history
…ss-token-to-api-token

Revert a halv hearted swap
  • Loading branch information
Mathias Frøhlich authored Aug 1, 2022
2 parents 7fadc81 + 45dbfbf commit e3d4c6d
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 7 deletions.
11 changes: 7 additions & 4 deletions .github/workflows/dotnet_cd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,13 @@ jobs:
path: ~/.nuget/packages # Mac/Linux
key: ${{ hashFiles('*/packages.lock.json') }}

- name: Setup .NET Core SDK
uses: actions/setup-dotnet@v2
- name: Setup .NET Core SDK & nuget.config
uses: actions/setup-dotnet@v1
env:
NUGET_AUTH_TOKEN: ${{ secrets.REGISTRY_AUTH_WRITE_TOKEN }}
with:
dotnet-version: 2.2.x
dotnet-version: 3.1.x
source-url: https://nuget.pkg.github.com/dentsudatalab/index.json

- name: Get version number & set in env
env:
Expand All @@ -41,4 +44,4 @@ jobs:
run: dotnet pack --configuration Release -p:PackageVersion=$VERSION

- name: Push NuGet package
run: dotnet nuget push bin/Release/DentsuDataLab.AccuRanker.$VERSION.nupkg -s "nuget.org" -k ${{ secrets.NUGET_AUTH_TOKEN }}
run: curl -vX PUT -u "$GITHUB_ACTOR:${{ secrets.REGISTRY_AUTH_WRITE_TOKEN }}" -F package=@bin/Release/DentsuDataLab.AccuRanker.$VERSION.nupkg https://nuget.pkg.github.com/dentsudatalab/
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -352,6 +352,8 @@ MigrationBackup/
# Ionide (cross platform F# VS Code tools) working folder
.ionide/

.idea/*

### VisualStudioCode ###
.vscode/*
!.vscode/settings.json
Expand Down
7 changes: 4 additions & 3 deletions AccuRanker/Services/BaseAccuRankerService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,9 @@ public abstract class BaseAccuRankerService

protected AuthValues AuthValues;

protected BaseAccuRankerService(HttpClient httpClient, AccuRankerAuthorizationService authService)
protected BaseAccuRankerService(
HttpClient httpClient,
AccuRankerAuthorizationService authService)
{
HttpClient = httpClient;
AuthService = authService;
Expand All @@ -41,9 +43,8 @@ public void SetAuthValues(AuthValues authValues)
protected async Task AuthorizeClient(AuthValues authValues)
{
var client = await AuthService.AuthorizeClient(authValues);

HttpClient.DefaultRequestHeaders.Authorization =
new AuthenticationHeaderValue("Token", authValues.ClientSecret);
new AuthenticationHeaderValue("Bearer", client.AccessToken);
}

internal virtual async Task<IEnumerable<T>> GetAllPages<T>(AccuRankerQueryBuilder baseQuery, int pageSize = 500)
Expand Down

0 comments on commit e3d4c6d

Please sign in to comment.