diff --git a/.config/dotnet-tools.json b/.config/dotnet-tools.json index b0b54bd..7c74cb2 100644 --- a/.config/dotnet-tools.json +++ b/.config/dotnet-tools.json @@ -3,7 +3,7 @@ "isRoot": true, "tools": { "nbgv": { - "version": "3.5.119", + "version": "3.6.133", "commands": [ "nbgv" ] diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 1db5d47..e68f9a4 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -11,14 +11,14 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout - uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # v3.3.0 + uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 with: fetch-depth: 0 # avoid shallow clone so nbgv can do its work. - - name: Install .NET 7 SDK - uses: actions/setup-dotnet@607fce577a46308457984d59e4954e075820f10a # v3.0.3 + - name: Install .NET 8 SDK + uses: actions/setup-dotnet@4d6c8fcf3c8f7a60068d26b594648e99df24cee3 # v4.0.0 with: - dotnet-version: 7.0.103 + dotnet-version: 8.0.200 - name: Build run: dotnet build --configuration Release --verbosity minimal @@ -30,7 +30,7 @@ jobs: BLIZZARD_CLIENT_SECRET: ${{ secrets.BLIZZARD_CLIENT_SECRET }} - name: Upload build artifacts - uses: actions/upload-artifact@0b7f8abb1508181956e8e162db84b466c27e18ce # v3.1.2 + uses: actions/upload-artifact@5d5d22a31266ced268874388b861e4b58bb5c2f3 # v4.3.1 with: name: NuGet packages path: | @@ -43,7 +43,7 @@ jobs: - name: Create GitHub Release if: ${{ startsWith(github.ref, 'refs/tags/v') }} # Only for a tag - uses: actions/create-release@0cb9c9b65d5d1901c1f53e5e66eaf4afd303e70e # v1 + uses: actions/create-release@0cb9c9b65d5d1901c1f53e5e66eaf4afd303e70e # v1.1.4 env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} with: diff --git a/Directory.Build.props b/Directory.Build.props index e349585..85b7028 100644 --- a/Directory.Build.props +++ b/Directory.Build.props @@ -2,7 +2,7 @@ Dan Jagnow, William Wolfram, and Travis Boatman - Copyright © 2017-2023 The ArgentPonyWarcraftClient Contributors + Copyright © 2017-2024 The ArgentPonyWarcraftClient Contributors $(MSBuildThisFileDirectory)artifacts *.nupkg *.snupkg true diff --git a/Directory.Packages.props b/Directory.Packages.props index 4b0f916..055ced8 100644 --- a/Directory.Packages.props +++ b/Directory.Packages.props @@ -4,29 +4,29 @@ - - + + - + all runtime; build; native; contentfiles; analyzers; buildtransitive - + - - - - + + + + all runtime; build; native; contentfiles; analyzers; buildtransitive - - - + + + \ No newline at end of file diff --git a/LICENSE b/LICENSE index 673c16c..09301c7 100644 --- a/LICENSE +++ b/LICENSE @@ -1,6 +1,6 @@ MIT License -Copyright (c) 2017 The ArgentPonyWarcraftClient Contributors +Copyright (c) 2017-2024 The ArgentPonyWarcraftClient Contributors Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/README.md b/README.md index a6a7712..e626935 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # Argent Pony Warcraft Client -The Argent Pony Warcraft Client is a .NET client for the [Blizzard World of Warcraft APIs](https://develop.battle.net/documentation/world-of-warcraft). It lets .NET applications easily access information about World of Warcraft characters, guilds, items, spells, and more. It is a [.NET Standard](https://docs.microsoft.com/en-us/dotnet/standard/net-standard) 2.0 library, which means it supports a broad range of platforms, including .NET 6 (long term support), .NET 7 (standard term support), and .NET Framework 4.6.2+. +The Argent Pony Warcraft Client is a .NET client for the [Blizzard World of Warcraft APIs](https://develop.battle.net/documentation/world-of-warcraft). It lets .NET applications easily access information about World of Warcraft characters, guilds, items, spells, and more. It is a [.NET Standard](https://docs.microsoft.com/en-us/dotnet/standard/net-standard) 2.0 library, which means it supports a broad range of platforms, including .NET 8 (long term support), and .NET Framework 4.6.2+. [![NuGet version](https://badge.fury.io/nu/ArgentPonyWarcraftClient.svg)](https://badge.fury.io/nu/ArgentPonyWarcraftClient) [![build](https://github.com/blizzard-net/warcraft/actions/workflows/build.yml/badge.svg)](https://github.com/blizzard-net/warcraft/actions/workflows/build.yml) diff --git a/global.json b/global.json index 1c924d0..39c53b8 100644 --- a/global.json +++ b/global.json @@ -1,6 +1,6 @@ { "sdk": { - "version": "7.0.103", + "version": "8.0.200", "rollForward": "latestMinor" } } diff --git a/src/ArgentPonyWarcraftClient/Client/WarcraftClient.cs b/src/ArgentPonyWarcraftClient/Client/WarcraftClient.cs index f80e576..2522ee0 100644 --- a/src/ArgentPonyWarcraftClient/Client/WarcraftClient.cs +++ b/src/ArgentPonyWarcraftClient/Client/WarcraftClient.cs @@ -207,8 +207,9 @@ private async Task GetOAuthTokenAsync(Region region) new KeyValuePair("grant_type", "client_credentials") }); - HttpResponseMessage request = await Client.PostAsync($"{host}/oauth/token", requestBody); - string response = await request.Content.ReadAsStringAsync(); + HttpResponseMessage responseMessage = await Client.PostAsync($"{host}/oauth/token", requestBody); + responseMessage.EnsureSuccessStatusCode(); + string response = await responseMessage.Content.ReadAsStringAsync(); return JsonSerializer.Deserialize(response); } diff --git a/tests/ArgentPonyWarcraftClient.Extensions.DependencyInjection.Tests/ArgentPonyWarcraftClient.Extensions.DependencyInjection.Tests.csproj b/tests/ArgentPonyWarcraftClient.Extensions.DependencyInjection.Tests/ArgentPonyWarcraftClient.Extensions.DependencyInjection.Tests.csproj index bd01baf..3aef9b5 100644 --- a/tests/ArgentPonyWarcraftClient.Extensions.DependencyInjection.Tests/ArgentPonyWarcraftClient.Extensions.DependencyInjection.Tests.csproj +++ b/tests/ArgentPonyWarcraftClient.Extensions.DependencyInjection.Tests/ArgentPonyWarcraftClient.Extensions.DependencyInjection.Tests.csproj @@ -1,7 +1,7 @@ - net7.0 + net8.0 false enable diff --git a/tests/ArgentPonyWarcraftClient.Integration.Tests/ArgentPonyWarcraftClient.Integration.Tests.csproj b/tests/ArgentPonyWarcraftClient.Integration.Tests/ArgentPonyWarcraftClient.Integration.Tests.csproj index dfcbc4c..f34e762 100644 --- a/tests/ArgentPonyWarcraftClient.Integration.Tests/ArgentPonyWarcraftClient.Integration.Tests.csproj +++ b/tests/ArgentPonyWarcraftClient.Integration.Tests/ArgentPonyWarcraftClient.Integration.Tests.csproj @@ -1,7 +1,7 @@ - net7.0 + net8.0 enable diff --git a/tests/ArgentPonyWarcraftClient.Integration.Tests/ProfileApi/CharacterMediaApiTests.cs b/tests/ArgentPonyWarcraftClient.Integration.Tests/ProfileApi/CharacterMediaApiTests.cs index 2dd8af4..ea47950 100644 --- a/tests/ArgentPonyWarcraftClient.Integration.Tests/ProfileApi/CharacterMediaApiTests.cs +++ b/tests/ArgentPonyWarcraftClient.Integration.Tests/ProfileApi/CharacterMediaApiTests.cs @@ -4,7 +4,7 @@ namespace ArgentPonyWarcraftClient.Integration.Tests.ProfileApi; public class CharacterMediaApiTests { - [ResilientFact] + [ResilientFact(Skip = "Currently returning 403 Forbidden, BLZWEBAPI00000403. Need to investigate.")] public async Task GetCharacterMediaSummaryAsync_Gets_CharacterMediaSummary() { ICharacterMediaApi warcraftClient = ClientFactory.BuildClient(); diff --git a/tests/ArgentPonyWarcraftClient.Integration.Tests/TestUtilities/RawBlizzardClient.cs b/tests/ArgentPonyWarcraftClient.Integration.Tests/TestUtilities/RawBlizzardClient.cs index 3613f3c..39b0793 100644 --- a/tests/ArgentPonyWarcraftClient.Integration.Tests/TestUtilities/RawBlizzardClient.cs +++ b/tests/ArgentPonyWarcraftClient.Integration.Tests/TestUtilities/RawBlizzardClient.cs @@ -66,8 +66,9 @@ private async Task GetOAuthTokenAsync(Region region) new KeyValuePair("grant_type", "client_credentials") }); - HttpResponseMessage request = await _client.PostAsync($"{host}/oauth/token", requestBody); - string response = await request.Content.ReadAsStringAsync(); + HttpResponseMessage responseMessage = await _client.PostAsync($"{host}/oauth/token", requestBody); + responseMessage.EnsureSuccessStatusCode(); + string response = await responseMessage.Content.ReadAsStringAsync(); return JsonSerializer.Deserialize(response); } diff --git a/tests/ArgentPonyWarcraftClient.Tests/ArgentPonyWarcraftClient.Tests.csproj b/tests/ArgentPonyWarcraftClient.Tests/ArgentPonyWarcraftClient.Tests.csproj index 05dda21..9690f07 100644 --- a/tests/ArgentPonyWarcraftClient.Tests/ArgentPonyWarcraftClient.Tests.csproj +++ b/tests/ArgentPonyWarcraftClient.Tests/ArgentPonyWarcraftClient.Tests.csproj @@ -1,7 +1,7 @@ - net7.0 + net8.0 enable diff --git a/tests/ArgentPonyWarcraftClient.Tests/ClientFactory.cs b/tests/ArgentPonyWarcraftClient.Tests/ClientFactory.cs index 76754ce..8c30e19 100644 --- a/tests/ArgentPonyWarcraftClient.Tests/ClientFactory.cs +++ b/tests/ArgentPonyWarcraftClient.Tests/ClientFactory.cs @@ -10,7 +10,7 @@ public static IWarcraftClient BuildMockClient(string requestUri, string response var mockHttp = new MockHttpMessageHandler(); mockHttp - .When("https://oauth.battle.net/oauth/token") + .When("https://us.battle.net/oauth/token") .Respond( mediaType: "application/json", content: @"{""access_token"": ""ACCESS-TOKEN"", ""token_type"": ""bearer"", ""expires_in"": 86399, ""scope"": ""example.scope""}"); @@ -32,7 +32,7 @@ public static IWarcraftClient BuildMockClient(string requestUri, string response var mockHttp = new MockHttpMessageHandler(); mockHttp - .When("https://oauth.battle.net/oauth/token") + .When("https://us.battle.net/oauth/token") .Respond( mediaType: "application/json", content: @"{""access_token"": ""ACCESS-TOKEN"", ""token_type"": ""bearer"", ""expires_in"": 86399, ""scope"": ""example.scope""}");