Skip to content
This repository was archived by the owner on Dec 13, 2018. It is now read-only.

Commit db9ae62

Browse files
committed
IInitializeOptions => IPostConfigureOptions
1 parent 4034158 commit db9ae62

File tree

21 files changed

+51
-56
lines changed

21 files changed

+51
-56
lines changed

src/Microsoft.AspNetCore.Authentication.Cookies/CookieAuthenticationInitializer.cs renamed to src/Microsoft.AspNetCore.Authentication.Cookies/CookieAuthenticationPostConfigureOptions.cs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,21 +10,21 @@ namespace Microsoft.AspNetCore.Authentication.Cookies
1010
/// <summary>
1111
/// Used to setup defaults for all <see cref="CookieAuthenticationOptions"/>.
1212
/// </summary>
13-
public class CookieAuthenticationInitializer : IInitializeOptions<CookieAuthenticationOptions>
13+
public class PostConfigureCookieAuthenticationOptions : IPostConfigureOptions<CookieAuthenticationOptions>
1414
{
1515
private readonly IDataProtectionProvider _dp;
1616

17-
public CookieAuthenticationInitializer(IDataProtectionProvider dataProtection)
17+
public PostConfigureCookieAuthenticationOptions(IDataProtectionProvider dataProtection)
1818
{
1919
_dp = dataProtection;
2020
}
2121

2222
/// <summary>
23-
/// Invoked to initialize a TOptions instance.
23+
/// Invoked to post configure a TOptions instance.
2424
/// </summary>
25-
/// <param name="name">The name of the options instance being initialized.</param>
26-
/// <param name="options">The options instance to initialize.</param>
27-
public void Initialize(string name, CookieAuthenticationOptions options)
25+
/// <param name="name">The name of the options instance being configured.</param>
26+
/// <param name="options">The options instance to configure.</param>
27+
public void PostConfigure(string name, CookieAuthenticationOptions options)
2828
{
2929
options.DataProtectionProvider = options.DataProtectionProvider ?? _dp;
3030

src/Microsoft.AspNetCore.Authentication.Cookies/CookieExtensions.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ public static IServiceCollection AddCookieAuthentication(this IServiceCollection
2121

2222
public static IServiceCollection AddCookieAuthentication(this IServiceCollection services, string authenticationScheme, Action<CookieAuthenticationOptions> configureOptions)
2323
{
24-
services.TryAddEnumerable(ServiceDescriptor.Singleton<IInitializeOptions<CookieAuthenticationOptions>, CookieAuthenticationInitializer>());
24+
services.TryAddEnumerable(ServiceDescriptor.Singleton<IPostConfigureOptions<CookieAuthenticationOptions>, PostConfigureCookieAuthenticationOptions>());
2525
return services.AddScheme<CookieAuthenticationOptions, CookieAuthenticationHandler>(authenticationScheme, configureOptions);
2626
}
2727
}

src/Microsoft.AspNetCore.Authentication.Facebook/FacebookExtensions.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33

44
using System;
55
using Microsoft.AspNetCore.Authentication.Facebook;
6+
using Microsoft.AspNetCore.Authentication.Facebook.Internal;
67
using Microsoft.Extensions.Options.Infrastructure;
78

89
namespace Microsoft.Extensions.DependencyInjection

src/Microsoft.AspNetCore.Authentication.Facebook/FacebookConfigureOptions.cs renamed to src/Microsoft.AspNetCore.Authentication.Facebook/Internal/FacebookConfigureOptions.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@
44
using Microsoft.Extensions.Configuration;
55
using Microsoft.Extensions.Options.Infrastructure;
66

7-
namespace Microsoft.AspNetCore.Authentication.Facebook
7+
namespace Microsoft.AspNetCore.Authentication.Facebook.Internal
88
{
9-
internal class FacebookConfigureOptions : ConfigureDefaultOptions<FacebookOptions>
9+
public class FacebookConfigureOptions : ConfigureDefaultOptions<FacebookOptions>
1010
{
1111
public FacebookConfigureOptions(IConfiguration config) :
1212
base(FacebookDefaults.AuthenticationScheme,

src/Microsoft.AspNetCore.Authentication.Google/GoogleExtensions.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33

44
using System;
55
using Microsoft.AspNetCore.Authentication.Google;
6+
using Microsoft.AspNetCore.Authentication.Google.Internal;
67
using Microsoft.Extensions.Options.Infrastructure;
78

89
namespace Microsoft.Extensions.DependencyInjection

src/Microsoft.AspNetCore.Authentication.Google/GoogleConfigureOptions.cs renamed to src/Microsoft.AspNetCore.Authentication.Google/Internal/GoogleConfigureOptions.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@
44
using Microsoft.Extensions.Configuration;
55
using Microsoft.Extensions.Options.Infrastructure;
66

7-
namespace Microsoft.AspNetCore.Authentication.Google
7+
namespace Microsoft.AspNetCore.Authentication.Google.Internal
88
{
9-
internal class GoogleConfigureOptions : ConfigureDefaultOptions<GoogleOptions>
9+
public class GoogleConfigureOptions : ConfigureDefaultOptions<GoogleOptions>
1010
{
1111
public GoogleConfigureOptions(IConfiguration config) :
1212
base(GoogleDefaults.AuthenticationScheme,

src/Microsoft.AspNetCore.Authentication.JwtBearer/JwtBearerConfigureOptions.cs renamed to src/Microsoft.AspNetCore.Authentication.JwtBearer/Internal/JwtBearerConfigureOptions.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@
44
using Microsoft.Extensions.Configuration;
55
using Microsoft.Extensions.Options.Infrastructure;
66

7-
namespace Microsoft.AspNetCore.Authentication.JwtBearer
7+
namespace Microsoft.AspNetCore.Authentication.JwtBearer.Internal
88
{
9-
internal class JwtBearerConfigureOptions : ConfigureDefaultOptions<JwtBearerOptions>
9+
public class JwtBearerConfigureOptions : ConfigureDefaultOptions<JwtBearerOptions>
1010
{
1111
// Bind to "Bearer" section by default
1212
public JwtBearerConfigureOptions(IConfiguration config) :

src/Microsoft.AspNetCore.Authentication.JwtBearer/JwtBearerExtensions.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33

44
using System;
55
using Microsoft.AspNetCore.Authentication.JwtBearer;
6+
using Microsoft.AspNetCore.Authentication.JwtBearer.Internal;
67
using Microsoft.Extensions.DependencyInjection.Extensions;
78
using Microsoft.Extensions.Options;
89
using Microsoft.Extensions.Options.Infrastructure;
@@ -19,7 +20,7 @@ public static IServiceCollection AddJwtBearerAuthentication(this IServiceCollect
1920

2021
public static IServiceCollection AddJwtBearerAuthentication(this IServiceCollection services, string authenticationScheme, Action<JwtBearerOptions> configureOptions)
2122
{
22-
services.TryAddEnumerable(ServiceDescriptor.Singleton<IInitializeOptions<JwtBearerOptions>, JwtBearerInitializer>());
23+
services.TryAddEnumerable(ServiceDescriptor.Singleton<IPostConfigureOptions<JwtBearerOptions>, JwtBearerPostConfigureOptions>());
2324
services.AddSingleton<ConfigureDefaultOptions<JwtBearerOptions>, JwtBearerConfigureOptions>();
2425
return services.AddScheme<JwtBearerOptions, JwtBearerHandler>(authenticationScheme, configureOptions);
2526
}

src/Microsoft.AspNetCore.Authentication.JwtBearer/JwtBearerInitializer.cs renamed to src/Microsoft.AspNetCore.Authentication.JwtBearer/JwtBearerPostConfigureOptions.cs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,14 +12,14 @@ namespace Microsoft.AspNetCore.Authentication.JwtBearer
1212
/// <summary>
1313
/// Used to setup defaults for all <see cref="JwtBearerOptions"/>.
1414
/// </summary>
15-
public class JwtBearerInitializer : IInitializeOptions<JwtBearerOptions>
15+
public class JwtBearerPostConfigureOptions : IPostConfigureOptions<JwtBearerOptions>
1616
{
1717
/// <summary>
18-
/// Invoked to initialize a JwtBearerOptions instance.
18+
/// Invoked to post configure a JwtBearerOptions instance.
1919
/// </summary>
20-
/// <param name="name">The name of the options instance being initialized.</param>
21-
/// <param name="options">The options instance to initialize.</param>
22-
public void Initialize(string name, JwtBearerOptions options)
20+
/// <param name="name">The name of the options instance being configured.</param>
21+
/// <param name="options">The options instance to configure.</param>
22+
public void PostConfigure(string name, JwtBearerOptions options)
2323
{
2424
if (string.IsNullOrEmpty(options.TokenValidationParameters.ValidAudience) && !string.IsNullOrEmpty(options.Audience))
2525
{

src/Microsoft.AspNetCore.Authentication.MicrosoftAccount/MicrosoftAccountConfigureOptions.cs renamed to src/Microsoft.AspNetCore.Authentication.MicrosoftAccount/Internal/MicrosoftAccountConfigureOptions.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@
44
using Microsoft.Extensions.Configuration;
55
using Microsoft.Extensions.Options.Infrastructure;
66

7-
namespace Microsoft.AspNetCore.Authentication.MicrosoftAccount
7+
namespace Microsoft.AspNetCore.Authentication.MicrosoftAccount.Internal
88
{
9-
internal class MicrosoftAccountConfigureOptions : ConfigureDefaultOptions<MicrosoftAccountOptions>
9+
public class MicrosoftAccountConfigureOptions : ConfigureDefaultOptions<MicrosoftAccountOptions>
1010
{
1111
// Bind to "Microsoft" section by default
1212
public MicrosoftAccountConfigureOptions(IConfiguration config) :

0 commit comments

Comments
 (0)