Skip to content

Commit 9b5ceed

Browse files
authored
Merge branch 'dev' into add-bilibili
2 parents 5791811 + 40ddd9d commit 9b5ceed

15 files changed

+327
-14
lines changed

.github/workflows/build.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ jobs:
7878
run: ./eng/common/cibuild.sh -configuration Release -prepareMachine
7979

8080
- name: Attest artifacts
81-
uses: actions/attest-build-provenance@c074443f1aee8d4aeeae555aebba3282517141b2 # v2.2.3
81+
uses: actions/attest-build-provenance@db473fddc028af60658334401dc6fa3ffd8669fd # v2.3.0
8282
if: |
8383
runner.os == 'Windows' &&
8484
github.event.repository.fork == false &&
@@ -114,7 +114,7 @@ jobs:
114114
steps:
115115

116116
- name: Download packages
117-
uses: actions/download-artifact@95815c38cf2ff2164869cbab79da8d1f422bc89e # v4.2.1
117+
uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4.3.0
118118
with:
119119
name: packages-windows
120120

@@ -152,7 +152,7 @@ jobs:
152152
steps:
153153

154154
- name: Download packages
155-
uses: actions/download-artifact@95815c38cf2ff2164869cbab79da8d1f422bc89e # v4.2.1
155+
uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4.3.0
156156
with:
157157
name: packages-windows
158158

@@ -175,7 +175,7 @@ jobs:
175175
steps:
176176

177177
- name: Download packages
178-
uses: actions/download-artifact@95815c38cf2ff2164869cbab79da8d1f422bc89e # v4.2.1
178+
uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4.3.0
179179
with:
180180
name: packages-windows
181181

.github/workflows/code-scan.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,12 +31,12 @@ jobs:
3131
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
3232

3333
- name: Initialize CodeQL
34-
uses: github/codeql-action/init@5f8171a638ada777af81d42b55959a643bb29017 # v3.28.12
34+
uses: github/codeql-action/init@60168efe1c415ce0f5521ea06d5c2062adbeed1b # v3.28.17
3535
with:
3636
build-mode: none
3737
languages: ${{ matrix.language }}
3838

3939
- name: Perform CodeQL Analysis
40-
uses: github/codeql-action/analyze@5f8171a638ada777af81d42b55959a643bb29017 # v3.28.12
40+
uses: github/codeql-action/analyze@60168efe1c415ce0f5521ea06d5c2062adbeed1b # v3.28.17
4141
with:
4242
category: '/language:${{ matrix.language }}'

.github/workflows/update-dotnet-sdks.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ permissions:
2121
jobs:
2222
update-sdk:
2323
name: Update .NET SDK
24-
uses: martincostello/update-dotnet-sdk/.github/workflows/update-dotnet-sdk.yml@85d667fd1555930e26433702522ad27d93e2b71a # v3.4.2
24+
uses: martincostello/update-dotnet-sdk/.github/workflows/update-dotnet-sdk.yml@e7501ebba8948a456d25ac2ff867af8c8f680454 # v3.8.1
2525
permissions:
2626
contents: write
2727
pull-requests: write

AspNet.Security.OAuth.Providers.sln

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -328,6 +328,7 @@ EndProject
328328
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AspNet.Security.OAuth.Linear", "src\AspNet.Security.OAuth.Linear\AspNet.Security.OAuth.Linear.csproj", "{B1167108-CA36-4C6B-85B0-1C7F5A24E4A4}"
329329
EndProject
330330
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AspNet.Security.OAuth.Bilibili", "src\AspNet.Security.OAuth.Bilibili\AspNet.Security.OAuth.Bilibili.csproj", "{8350C405-9E17-4110-B9A8-0AB43A8816B7}"
331+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AspNet.Security.OAuth.Contentful", "src\AspNet.Security.OAuth.Contentful\AspNet.Security.OAuth.Contentful.csproj", "{B1F6EA42-7B1B-469E-B304-6B2E6FE39852}"
331332
EndProject
332333
Global
333334
GlobalSection(SolutionConfigurationPlatforms) = preSolution
@@ -767,6 +768,10 @@ Global
767768
{8350C405-9E17-4110-B9A8-0AB43A8816B7}.Debug|Any CPU.Build.0 = Debug|Any CPU
768769
{8350C405-9E17-4110-B9A8-0AB43A8816B7}.Release|Any CPU.ActiveCfg = Release|Any CPU
769770
{8350C405-9E17-4110-B9A8-0AB43A8816B7}.Release|Any CPU.Build.0 = Release|Any CPU
771+
{B1F6EA42-7B1B-469E-B304-6B2E6FE39852}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
772+
{B1F6EA42-7B1B-469E-B304-6B2E6FE39852}.Debug|Any CPU.Build.0 = Debug|Any CPU
773+
{B1F6EA42-7B1B-469E-B304-6B2E6FE39852}.Release|Any CPU.ActiveCfg = Release|Any CPU
774+
{B1F6EA42-7B1B-469E-B304-6B2E6FE39852}.Release|Any CPU.Build.0 = Release|Any CPU
770775
EndGlobalSection
771776
GlobalSection(SolutionProperties) = preSolution
772777
HideSolutionNode = FALSE
@@ -886,6 +891,7 @@ Global
886891
{7F22DE22-FDE8-4A14-AA65-D5B36098533E} = {C1352FD3-AE8B-43EE-B45B-F6E0B3FBAC6D}
887892
{B1167108-CA36-4C6B-85B0-1C7F5A24E4A4} = {C1352FD3-AE8B-43EE-B45B-F6E0B3FBAC6D}
888893
{8350C405-9E17-4110-B9A8-0AB43A8816B7} = {C1352FD3-AE8B-43EE-B45B-F6E0B3FBAC6D}
894+
{B1F6EA42-7B1B-469E-B304-6B2E6FE39852} = {C1352FD3-AE8B-43EE-B45B-F6E0B3FBAC6D}
889895
EndGlobalSection
890896
GlobalSection(ExtensibilityGlobals) = postSolution
891897
SolutionGuid = {C7B54DE2-6407-4802-AD9C-CE54BF414C8C}

Directory.Packages.props

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@
44
<PackageVersion Include="JetBrains.Annotations" Version="2024.3.0" />
55
<PackageVersion Include="JustEat.HttpClientInterception" Version="5.1.0" />
66
<PackageVersion Include="MartinCostello.Logging.XUnit" Version="0.5.1" />
7-
<PackageVersion Include="Microsoft.AspNetCore.Authentication.Google" Version="9.0.3" />
8-
<PackageVersion Include="Microsoft.AspNetCore.Mvc.Testing" Version="9.0.3" />
9-
<PackageVersion Include="Microsoft.AspNetCore.TestHost" Version="9.0.3" />
7+
<PackageVersion Include="Microsoft.AspNetCore.Authentication.Google" Version="9.0.4" />
8+
<PackageVersion Include="Microsoft.AspNetCore.Mvc.Testing" Version="9.0.4" />
9+
<PackageVersion Include="Microsoft.AspNetCore.TestHost" Version="9.0.4" />
1010
<PackageVersion Include="Microsoft.IdentityModel.Protocols.OpenIdConnect" Version="8.0.0" />
1111
<PackageVersion Include="NSubstitute" Version="5.3.0" />
1212
<PackageVersion Include="Shouldly" Version="4.3.0" />

README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ This project is licensed under the **Apache License**. This means that you can u
123123

124124
## Migrating to OpenIddict
125125

126-
**The OpenIddict client and its 75+ web providers have significant advantages** over the
126+
**The OpenIddict client and its 100+ web providers have significant advantages** over the
127127
simpler OAuth 2.0-only authentication handler that is used by the aspnet-contrib providers:
128128

129129
* **OpenIddict fully supports OpenID Connect**, which allows enforcing additional security checks for providers that implement it.
@@ -174,6 +174,7 @@ If a provider you're looking for does not exist, consider making a PR to add one
174174
| Calendly | [![NuGet](https://img.shields.io/nuget/v/AspNet.Security.OAuth.Calendly?logo=nuget&label=NuGet&color=blue)](https://www.nuget.org/packages/AspNet.Security.OAuth.Calendly/ "Download AspNet.Security.OAuth.Calendly from NuGet.org") | [![MyGet](https://img.shields.io/myget/aspnet-contrib/vpre/AspNet.Security.OAuth.Calendly?logo=nuget&label=MyGet&color=blue)](https://www.myget.org/feed/aspnet-contrib/package/nuget/AspNet.Security.OAuth.Calendly "Download AspNet.Security.OAuth.Calendly from MyGet.org") | [Documentation](https://developer.calendly.com/api-docs/3cefb59b832eb-calendly-o-auth-2-0 "Calendly developer documentation") |
175175
| CiscoSpark (Webex Teams) | [![NuGet](https://img.shields.io/nuget/v/AspNet.Security.OAuth.CiscoSpark?logo=nuget&label=NuGet&color=blue)](https://www.nuget.org/packages/AspNet.Security.OAuth.CiscoSpark/ "Download AspNet.Security.OAuth.CiscoSpark from NuGet.org") | [![MyGet](https://img.shields.io/myget/aspnet-contrib/vpre/AspNet.Security.OAuth.CiscoSpark?logo=nuget&label=MyGet&color=blue)](https://www.myget.org/feed/aspnet-contrib/package/nuget/AspNet.Security.OAuth.CiscoSpark "Download AspNet.Security.OAuth.CiscoSpark from MyGet.org") | [Documentation](https://developer.webex.com/docs/api/getting-started/accounts-and-authentication "Webex Teams developer documentation") |
176176
| Coinbase | [![NuGet](https://img.shields.io/nuget/v/AspNet.Security.OAuth.Coinbase?logo=nuget&label=NuGet&color=blue)](https://www.nuget.org/packages/AspNet.Security.OAuth.Coinbase/ "Download AspNet.Security.OAuth.Coinbase from NuGet.org") | [![MyGet](https://img.shields.io/myget/aspnet-contrib/vpre/AspNet.Security.OAuth.Coinbase?logo=nuget&label=MyGet&color=blue)](https://www.myget.org/feed/aspnet-contrib/package/nuget/AspNet.Security.OAuth.Coinbase "Download AspNet.Security.OAuth.Coinbase from MyGet.org") | [Documentation](https://developers.coinbase.com/docs/wallet/coinbase-connect/integrating "Coinbase developer documentation") |
177+
| Contentful | [![NuGet](https://img.shields.io/nuget/v/AspNet.Security.OAuth.Contentful?logo=nuget&label=NuGet&color=blue)](https://www.nuget.org/packages/AspNet.Security.OAuth.Contentful/ "Download AspNet.Security.OAuth.Contentful from NuGet.org") | [![MyGet](https://img.shields.io/myget/aspnet-contrib/vpre/AspNet.Security.OAuth.Contentful?logo=nuget&label=MyGet&color=blue)](https://www.myget.org/feed/aspnet-contrib/package/nuget/AspNet.Security.OAuth.Contentful "Download AspNet.Security.OAuth.Contentful from MyGet.org") | [Documentation](https://www.contentful.com/developers/docs/extensibility/oauth/ "Contentful developer documentation") |
177178
| DeviantArt | [![NuGet](https://img.shields.io/nuget/v/AspNet.Security.OAuth.DeviantArt?logo=nuget&label=NuGet&color=blue)](https://www.nuget.org/packages/AspNet.Security.OAuth.DeviantArt/ "Download AspNet.Security.OAuth.DeviantArt from NuGet.org") | [![MyGet](https://img.shields.io/myget/aspnet-contrib/vpre/AspNet.Security.OAuth.DeviantArt?logo=nuget&label=MyGet&color=blue)](https://www.myget.org/feed/aspnet-contrib/package/nuget/AspNet.Security.OAuth.DeviantArt "Download AspNet.Security.OAuth.DeviantArt from MyGet.org") | [Documentation](https://www.deviantart.com/developers/ "DeviantArt developer documentation") |
178179
| Deezer | [![NuGet](https://img.shields.io/nuget/v/AspNet.Security.OAuth.Deezer?logo=nuget&label=NuGet&color=blue)](https://www.nuget.org/packages/AspNet.Security.OAuth.Deezer/ "Download AspNet.Security.OAuth.Deezer from NuGet.org") | [![MyGet](https://img.shields.io/myget/aspnet-contrib/vpre/AspNet.Security.OAuth.Deezer?logo=nuget&label=MyGet&color=blue)](https://www.myget.org/feed/aspnet-contrib/package/nuget/AspNet.Security.OAuth.Deezer "Download AspNet.Security.OAuth.Deezer from MyGet.org") | [Documentation](https://developers.deezer.com/api/oauth "Deezer developer documentation") |
179180
| DigitalOcean | [![NuGet](https://img.shields.io/nuget/v/AspNet.Security.OAuth.DigitalOcean?logo=nuget&label=NuGet&color=blue)](https://www.nuget.org/packages/AspNet.Security.OAuth.DigitalOcean/ "Download AspNet.Security.OAuth.DigitalOcean from NuGet.org") | [![MyGet](https://img.shields.io/myget/aspnet-contrib/vpre/AspNet.Security.OAuth.DigitalOcean?logo=nuget&label=MyGet&color=blue)](https://www.myget.org/feed/aspnet-contrib/package/nuget/AspNet.Security.OAuth.DigitalOcean "Download AspNet.Security.OAuth.DigitalOcean from MyGet.org") | [Documentation](https://docs.digitalocean.com/reference/api/oauth-api/ "DigitalOcean developer documentation") |

eng/Versions.props

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
<PropertyGroup>
44
<MajorVersion>9</MajorVersion>
5-
<MinorVersion>2</MinorVersion>
5+
<MinorVersion>3</MinorVersion>
66
<PatchVersion>1</PatchVersion>
77
<VersionPrefix>$(MajorVersion).$(MinorVersion).$(PatchVersion)</VersionPrefix>
88
<PackageValidationBaselineVersion Condition=" '$(EnablePackageValidation)' == 'true' AND '$(PackageValidationBaselineVersion)' == '' ">9.0.0</PackageValidationBaselineVersion>

global.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
{
22
"sdk": {
3-
"version": "9.0.202",
3+
"version": "9.0.203",
44
"allowPrerelease": true,
55
"rollForward": "major"
66
},
77

88
"tools": {
9-
"dotnet": "9.0.202"
9+
"dotnet": "9.0.203"
1010
},
1111

1212
"msbuild-sdks": {
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
<Project Sdk="Microsoft.NET.Sdk">
2+
3+
<PropertyGroup>
4+
<PackageValidationBaselineVersion>9.3.0</PackageValidationBaselineVersion>
5+
<TargetFramework>$(DefaultNetCoreTargetFramework)</TargetFramework>
6+
</PropertyGroup>
7+
8+
<PropertyGroup>
9+
<Description>ASP.NET Core security middleware enabling Contentful authentication.</Description>
10+
<Authors>Jerrie Pelser</Authors>
11+
<PackageTags>contentful;aspnetcore;authentication;oauth;security</PackageTags>
12+
</PropertyGroup>
13+
14+
<ItemGroup>
15+
<FrameworkReference Include="Microsoft.AspNetCore.App" />
16+
<PackageReference Include="JetBrains.Annotations" PrivateAssets="All" />
17+
</ItemGroup>
18+
19+
</Project>
Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
/*
2+
* Licensed under the Apache License, Version 2.0 (http://www.apache.org/licenses/LICENSE-2.0)
3+
* See https://github.com/aspnet-contrib/AspNet.Security.OAuth.Providers
4+
* for more information concerning the license and the contributors participating to this project.
5+
*/
6+
7+
namespace AspNet.Security.OAuth.Contentful;
8+
9+
/// <summary>
10+
/// Default values used by the Contentful authentication middleware.
11+
/// </summary>
12+
public static class ContentfulAuthenticationDefaults
13+
{
14+
/// <summary>
15+
/// Default value for the <see cref="AuthenticationScheme.Name"/>.
16+
/// </summary>
17+
public const string AuthenticationScheme = "Contentful";
18+
19+
/// <summary>
20+
/// Default value for the <see cref="AuthenticationScheme.DisplayName"/>.
21+
/// </summary>
22+
public static readonly string DisplayName = "Contentful";
23+
24+
/// <summary>
25+
/// Default value for the <see cref="AuthenticationSchemeOptions.ClaimsIssuer"/>.
26+
/// </summary>
27+
public static readonly string Issuer = "Contentful";
28+
29+
/// <summary>
30+
/// Default value for the <see cref="RemoteAuthenticationOptions.CallbackPath"/>.
31+
/// </summary>
32+
public static readonly string CallbackPath = "/signin-contentful";
33+
34+
/// <summary>
35+
/// Default value for the <see cref="OAuthOptions.AuthorizationEndpoint"/>.
36+
/// </summary>
37+
public static readonly string AuthorizationEndpoint = "https://be.contentful.com/oauth/authorize";
38+
39+
/// <summary>
40+
/// Default value for the <see cref="OAuthOptions.TokenEndpoint"/>.
41+
/// </summary>
42+
public static readonly string TokenEndpointFormat = "https://be.contentful.com/oauth/token";
43+
44+
/// <summary>
45+
/// Default value for <see cref="OAuthOptions.UserInformationEndpoint"/>.
46+
/// </summary>
47+
public static readonly string UserInformationEndpoint = "https://api.contentful.com/users/me";
48+
}
Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
/*
2+
* Licensed under the Apache License, Version 2.0 (http://www.apache.org/licenses/LICENSE-2.0)
3+
* See https://github.com/aspnet-contrib/AspNet.Security.OAuth.Providers
4+
* for more information concerning the license and the contributors participating to this project.
5+
*/
6+
7+
using AspNet.Security.OAuth.Contentful;
8+
9+
namespace Microsoft.Extensions.DependencyInjection;
10+
11+
public static class ContentfulAuthenticationExtensions
12+
{
13+
/// <summary>
14+
/// Adds <see cref="ContentfulAuthenticationHandler"/> to the specified
15+
/// <see cref="AuthenticationBuilder"/>, which enables Contentful authentication capabilities.
16+
/// </summary>
17+
/// <param name="builder">The authentication builder.</param>
18+
/// <returns>A reference to this instance after the operation has completed.</returns>
19+
public static AuthenticationBuilder AddContentful([NotNull] this AuthenticationBuilder builder)
20+
{
21+
return builder.AddContentful(ContentfulAuthenticationDefaults.AuthenticationScheme, options => { });
22+
}
23+
24+
/// <summary>
25+
/// Adds <see cref="ContentfulAuthenticationHandler"/> to the specified
26+
/// <see cref="AuthenticationBuilder"/>, which enables Contentful authentication capabilities.
27+
/// </summary>
28+
/// <param name="builder">The authentication builder.</param>
29+
/// <param name="configuration">The delegate used to configure the Contentful options.</param>
30+
/// <returns>A reference to this instance after the operation has completed.</returns>
31+
public static AuthenticationBuilder AddContentful(
32+
[NotNull] this AuthenticationBuilder builder,
33+
[NotNull] Action<ContentfulAuthenticationOptions> configuration)
34+
{
35+
return builder.AddContentful(ContentfulAuthenticationDefaults.AuthenticationScheme, configuration);
36+
}
37+
38+
/// <summary>
39+
/// Adds <see cref="ContentfulAuthenticationHandler"/> to the specified
40+
/// <see cref="AuthenticationBuilder"/>, which enables Contentful authentication capabilities.
41+
/// </summary>
42+
/// <param name="builder">The authentication builder.</param>
43+
/// <param name="scheme">The authentication scheme associated with this instance.</param>
44+
/// <param name="configuration">The delegate used to configure the Contentful options.</param>
45+
/// <returns>The <see cref="AuthenticationBuilder"/>.</returns>
46+
public static AuthenticationBuilder AddContentful(
47+
[NotNull] this AuthenticationBuilder builder,
48+
[NotNull] string scheme,
49+
[NotNull] Action<ContentfulAuthenticationOptions> configuration)
50+
{
51+
return builder.AddContentful(scheme, ContentfulAuthenticationDefaults.DisplayName, configuration);
52+
}
53+
54+
/// <summary>
55+
/// Adds <see cref="ContentfulAuthenticationHandler"/> to the specified
56+
/// <see cref="AuthenticationBuilder"/>, which enables Contentful authentication capabilities.
57+
/// </summary>
58+
/// <param name="builder">The authentication builder.</param>
59+
/// <param name="scheme">The authentication scheme associated with this instance.</param>
60+
/// <param name="caption">The optional display name associated with this instance.</param>
61+
/// <param name="configuration">The delegate used to configure the Contentful options.</param>
62+
/// <returns>The <see cref="AuthenticationBuilder"/>.</returns>
63+
public static AuthenticationBuilder AddContentful(
64+
[NotNull] this AuthenticationBuilder builder,
65+
[NotNull] string scheme,
66+
[NotNull] string caption,
67+
[NotNull] Action<ContentfulAuthenticationOptions> configuration)
68+
{
69+
return builder.AddOAuth<ContentfulAuthenticationOptions, ContentfulAuthenticationHandler>(scheme, caption, configuration);
70+
}
71+
}

0 commit comments

Comments
 (0)