Browse Source

Introduced ValidateOnStart method in all builders

pull/2477/head
sfgserr 2 months ago
parent
commit
4dd46d827d
  1. 35
      .vscode/launch.json
  2. 41
      .vscode/tasks.json
  3. 7
      src/OpenIddict.Client.AspNetCore/OpenIddictClientAspNetCoreBuilder.cs
  4. 7
      src/OpenIddict.Client.DataProtection/OpenIddictClientDataProtectionBuilder.cs
  5. 11
      src/OpenIddict.Client.Owin/OpenIddictClientOwinBuilder.cs
  6. 7
      src/OpenIddict.Client.SystemIntegration/OpenIddictClientSystemIntegrationBuilder.cs
  7. 7
      src/OpenIddict.Client.SystemNetHttp/OpenIddictClientSystemNetHttpBuilder.cs
  8. 7
      src/OpenIddict.Client.WebIntegration/OpenIddictClientWebIntegrationBuilder.cs
  9. 7
      src/OpenIddict.Client/OpenIddictClientBuilder.cs
  10. 7
      src/OpenIddict.Core/OpenIddictCoreBuilder.cs
  11. 7
      src/OpenIddict.EntityFramework/OpenIddictEntityFrameworkBuilder.cs
  12. 7
      src/OpenIddict.EntityFrameworkCore/OpenIddictEntityFrameworkCoreBuilder.cs
  13. 7
      src/OpenIddict.MongoDb/OpenIddictMongoDbBuilder.cs
  14. 7
      src/OpenIddict.Quartz/OpenIddictQuartzBuilder.cs
  15. 7
      src/OpenIddict.Server.AspNetCore/OpenIddictServerAspNetCoreBuilder.cs
  16. 7
      src/OpenIddict.Server.DataProtection/OpenIddictServerDataProtectionBuilder.cs
  17. 9
      src/OpenIddict.Server.Owin/OpenIddictServerOwinBuilder.cs
  18. 7
      src/OpenIddict.Server/OpenIddictServerBuilder.cs
  19. 7
      src/OpenIddict.Validation.AspNetCore/OpenIddictValidationAspNetCoreBuilder.cs
  20. 7
      src/OpenIddict.Validation.DataProtection/OpenIddictValidationDataProtectionBuilder.cs
  21. 7
      src/OpenIddict.Validation.Owin/OpenIddictValidationOwinBuilder.cs
  22. 7
      src/OpenIddict.Validation.ServerIntegration/OpenIddictValidationServerIntegrationBuilder.cs
  23. 7
      src/OpenIddict.Validation.SystemNetHttp/OpenIddictValidationSystemNetHttpBuilder.cs
  24. 7
      src/OpenIddict.Validation/OpenIddictValidationBuilder.cs

35
.vscode/launch.json

@ -0,0 +1,35 @@
{
"version": "0.2.0",
"configurations": [
{
// Use IntelliSense to find out which attributes exist for C# debugging
// Use hover for the description of the existing attributes
// For further information visit https://github.com/dotnet/vscode-csharp/blob/main/debugger-launchjson.md.
"name": ".NET Core Launch (web)",
"type": "coreclr",
"request": "launch",
"preLaunchTask": "build",
// If you have changed target frameworks, make sure to update the program path.
"program": "${workspaceFolder}/artifacts/bin/OpenIddict.Sandbox.AspNetCore.Server/Debug/net10.0/OpenIddict.Sandbox.AspNetCore.Server.dll",
"args": [],
"cwd": "${workspaceFolder}/sandbox/OpenIddict.Sandbox.AspNetCore.Server",
"stopAtEntry": false,
// Enable launching a web browser when ASP.NET Core starts. For more information: https://aka.ms/VSCode-CS-LaunchJson-WebBrowser
"serverReadyAction": {
"action": "openExternally",
"pattern": "\\bNow listening on:\\s+(https?://\\S+)"
},
"env": {
"ASPNETCORE_ENVIRONMENT": "Development"
},
"sourceFileMap": {
"/Views": "${workspaceFolder}/Views"
}
},
{
"name": ".NET Core Attach",
"type": "coreclr",
"request": "attach"
}
]
}

41
.vscode/tasks.json

@ -0,0 +1,41 @@
{
"version": "2.0.0",
"tasks": [
{
"label": "build",
"command": "dotnet",
"type": "process",
"args": [
"build",
"${workspaceFolder}/sandbox/OpenIddict.Sandbox.AspNetCore.Server/OpenIddict.Sandbox.AspNetCore.Server.csproj",
"/property:GenerateFullPaths=true",
"/consoleloggerparameters:NoSummary;ForceNoAlign"
],
"problemMatcher": "$msCompile"
},
{
"label": "publish",
"command": "dotnet",
"type": "process",
"args": [
"publish",
"${workspaceFolder}/sandbox/OpenIddict.Sandbox.AspNetCore.Server/OpenIddict.Sandbox.AspNetCore.Server.csproj",
"/property:GenerateFullPaths=true",
"/consoleloggerparameters:NoSummary;ForceNoAlign"
],
"problemMatcher": "$msCompile"
},
{
"label": "watch",
"command": "dotnet",
"type": "process",
"args": [
"watch",
"run",
"--project",
"${workspaceFolder}/sandbox/OpenIddict.Sandbox.AspNetCore.Server/OpenIddict.Sandbox.AspNetCore.Server.csproj"
],
"problemMatcher": "$msCompile"
}
]
}

7
src/OpenIddict.Client.AspNetCore/OpenIddictClientAspNetCoreBuilder.cs

@ -30,6 +30,13 @@ public sealed class OpenIddictClientAspNetCoreBuilder
[EditorBrowsable(EditorBrowsableState.Never)]
public IServiceCollection Services { get; }
public OpenIddictClientAspNetCoreBuilder ValidateOnStart()
{
Services.AddOptionsWithValidateOnStart<OpenIddictClientAspNetCoreOptions>();
return this;
}
/// <summary>
/// Amends the default OpenIddict client ASP.NET Core configuration.
/// </summary>

7
src/OpenIddict.Client.DataProtection/OpenIddictClientDataProtectionBuilder.cs

@ -29,6 +29,13 @@ public sealed class OpenIddictClientDataProtectionBuilder
[EditorBrowsable(EditorBrowsableState.Never)]
public IServiceCollection Services { get; }
public OpenIddictClientDataProtectionBuilder ValidateOnStart()
{
Services.AddOptionsWithValidateOnStart<OpenIddictClientDataProtectionOptions>();
return this;
}
/// <summary>
/// Amends the default OpenIddict client ASP.NET Core Data Protection configuration.
/// </summary>

11
src/OpenIddict.Client.Owin/OpenIddictClientOwinBuilder.cs

@ -4,7 +4,11 @@
* the license and the contributors participating to this project.
*/
using System;
using System.ComponentModel;
using Microsoft.Owin;
using Microsoft.Owin.Infrastructure;
using Microsoft.Owin.Security;
using OpenIddict.Client;
using OpenIddict.Client.Owin;
using Owin;
@ -30,6 +34,13 @@ public sealed class OpenIddictClientOwinBuilder
[EditorBrowsable(EditorBrowsableState.Never)]
public IServiceCollection Services { get; }
public OpenIddictClientOwinBuilder ValidateOnStart()
{
Services.AddOptionsWithValidateOnStart<OpenIddictClientOwinOptions>();
return this;
}
/// <summary>
/// Amends the default OpenIddict client OWIN/Katana configuration.
/// </summary>

7
src/OpenIddict.Client.SystemIntegration/OpenIddictClientSystemIntegrationBuilder.cs

@ -32,6 +32,13 @@ public sealed class OpenIddictClientSystemIntegrationBuilder
[EditorBrowsable(EditorBrowsableState.Never)]
public IServiceCollection Services { get; }
public OpenIddictClientSystemIntegrationBuilder ValidateOnStart()
{
Services.AddOptionsWithValidateOnStart<OpenIddictClientSystemIntegrationOptions>();
return this;
}
/// <summary>
/// Amends the default OpenIddict client system integration configuration.
/// </summary>

7
src/OpenIddict.Client.SystemNetHttp/OpenIddictClientSystemNetHttpBuilder.cs

@ -33,6 +33,13 @@ public sealed class OpenIddictClientSystemNetHttpBuilder
[EditorBrowsable(EditorBrowsableState.Never)]
public IServiceCollection Services { get; }
public OpenIddictClientSystemNetHttpBuilder ValidateOnStart()
{
Services.AddOptionsWithValidateOnStart<OpenIddictClientSystemNetHttpOptions>();
return this;
}
/// <summary>
/// Amends the default OpenIddict client/System.Net.Http configuration.
/// </summary>

7
src/OpenIddict.Client.WebIntegration/OpenIddictClientWebIntegrationBuilder.cs

@ -27,6 +27,13 @@ public sealed partial class OpenIddictClientWebIntegrationBuilder
[EditorBrowsable(EditorBrowsableState.Never)]
public IServiceCollection Services { get; }
public OpenIddictClientWebIntegrationBuilder ValidateOnStart()
{
Services.AddOptionsWithValidateOnStart<OpenIddictClientWebIntegrationOptions>();
return this;
}
/// <summary>
/// Amends the default OpenIddict client Web integration configuration.
/// </summary>

7
src/OpenIddict.Client/OpenIddictClientBuilder.cs

@ -34,6 +34,13 @@ public sealed class OpenIddictClientBuilder
[EditorBrowsable(EditorBrowsableState.Never)]
public IServiceCollection Services { get; }
public OpenIddictClientBuilder ValidateOnStart()
{
Services.AddOptionsWithValidateOnStart<OpenIddictClientOptions>();
return this;
}
/// <summary>
/// Registers an event handler using the specified configuration delegate.
/// </summary>

7
src/OpenIddict.Core/OpenIddictCoreBuilder.cs

@ -30,6 +30,13 @@ public sealed class OpenIddictCoreBuilder
[EditorBrowsable(EditorBrowsableState.Never)]
public IServiceCollection Services { get; }
public OpenIddictCoreBuilder ValidateOnStart()
{
Services.AddOptionsWithValidateOnStart<OpenIddictCoreOptions>();
return this;
}
/// <summary>
/// Amends the default OpenIddict core configuration.
/// </summary>

7
src/OpenIddict.EntityFramework/OpenIddictEntityFrameworkBuilder.cs

@ -31,6 +31,13 @@ public sealed class OpenIddictEntityFrameworkBuilder
[EditorBrowsable(EditorBrowsableState.Never)]
public IServiceCollection Services { get; }
public OpenIddictEntityFrameworkBuilder ValidateOnStart()
{
Services.AddOptionsWithValidateOnStart<OpenIddictEntityFrameworkOptions>();
return this;
}
/// <summary>
/// Amends the default OpenIddict Entity Framework 6.x configuration.
/// </summary>

7
src/OpenIddict.EntityFrameworkCore/OpenIddictEntityFrameworkCoreBuilder.cs

@ -31,6 +31,13 @@ public sealed class OpenIddictEntityFrameworkCoreBuilder
[EditorBrowsable(EditorBrowsableState.Never)]
public IServiceCollection Services { get; }
public OpenIddictEntityFrameworkCoreBuilder ValidateOnStart()
{
Services.AddOptionsWithValidateOnStart<OpenIddictEntityFrameworkCoreOptions>();
return this;
}
/// <summary>
/// Amends the default OpenIddict Entity Framework Core configuration.
/// </summary>

7
src/OpenIddict.MongoDb/OpenIddictMongoDbBuilder.cs

@ -31,6 +31,13 @@ public sealed class OpenIddictMongoDbBuilder
[EditorBrowsable(EditorBrowsableState.Never)]
public IServiceCollection Services { get; }
public OpenIddictMongoDbBuilder ValidateOnStart()
{
Services.AddOptionsWithValidateOnStart<OpenIddictMongoDbOptions>();
return this;
}
/// <summary>
/// Amends the default OpenIddict MongoDB configuration.
/// </summary>

7
src/OpenIddict.Quartz/OpenIddictQuartzBuilder.cs

@ -27,6 +27,13 @@ public sealed class OpenIddictQuartzBuilder
[EditorBrowsable(EditorBrowsableState.Never)]
public IServiceCollection Services { get; }
public OpenIddictQuartzBuilder ValidateOnStart()
{
Services.AddOptionsWithValidateOnStart<OpenIddictQuartzOptions>();
return this;
}
/// <summary>
/// Amends the default OpenIddict Quartz.NET configuration.
/// </summary>

7
src/OpenIddict.Server.AspNetCore/OpenIddictServerAspNetCoreBuilder.cs

@ -29,6 +29,13 @@ public sealed class OpenIddictServerAspNetCoreBuilder
[EditorBrowsable(EditorBrowsableState.Never)]
public IServiceCollection Services { get; }
public OpenIddictServerAspNetCoreBuilder ValidateOnStart()
{
Services.AddOptionsWithValidateOnStart<OpenIddictServerAspNetCoreOptions>();
return this;
}
/// <summary>
/// Amends the default OpenIddict server ASP.NET Core configuration.
/// </summary>

7
src/OpenIddict.Server.DataProtection/OpenIddictServerDataProtectionBuilder.cs

@ -29,6 +29,13 @@ public sealed class OpenIddictServerDataProtectionBuilder
[EditorBrowsable(EditorBrowsableState.Never)]
public IServiceCollection Services { get; }
public OpenIddictServerDataProtectionBuilder ValidateOnStart()
{
Services.AddOptionsWithValidateOnStart<OpenIddictServerDataProtectionOptions>();
return this;
}
/// <summary>
/// Amends the default OpenIddict server ASP.NET Core Data Protection configuration.
/// </summary>

9
src/OpenIddict.Server.Owin/OpenIddictServerOwinBuilder.cs

@ -29,7 +29,14 @@ public sealed class OpenIddictServerOwinBuilder
[EditorBrowsable(EditorBrowsableState.Never)]
public IServiceCollection Services { get; }
/// <summary>
public OpenIddictServerOwinBuilder ValidateOnStart()
{
Services.AddOptionsWithValidateOnStart<OpenIddictServerOwinOptions>();
return this;
}
/// <summary>
/// Amends the default OpenIddict server OWIN/Katana configuration.
/// </summary>
/// <param name="configuration">The delegate used to configure the OpenIddict options.</param>

7
src/OpenIddict.Server/OpenIddictServerBuilder.cs

@ -34,6 +34,13 @@ public sealed class OpenIddictServerBuilder
[EditorBrowsable(EditorBrowsableState.Never)]
public IServiceCollection Services { get; }
public OpenIddictServerBuilder ValidateOnStart()
{
Services.AddOptionsWithValidateOnStart<OpenIddictServerOptions>();
return this;
}
/// <summary>
/// Registers an event handler using the specified configuration delegate.
/// </summary>

7
src/OpenIddict.Validation.AspNetCore/OpenIddictValidationAspNetCoreBuilder.cs

@ -28,6 +28,13 @@ public sealed class OpenIddictValidationAspNetCoreBuilder
[EditorBrowsable(EditorBrowsableState.Never)]
public IServiceCollection Services { get; }
public OpenIddictValidationAspNetCoreBuilder ValidateOnStart()
{
Services.AddOptionsWithValidateOnStart<OpenIddictValidationAspNetCoreOptions>();
return this;
}
/// <summary>
/// Amends the default OpenIddict validation ASP.NET Core configuration.
/// </summary>

7
src/OpenIddict.Validation.DataProtection/OpenIddictValidationDataProtectionBuilder.cs

@ -29,6 +29,13 @@ public sealed class OpenIddictValidationDataProtectionBuilder
[EditorBrowsable(EditorBrowsableState.Never)]
public IServiceCollection Services { get; }
public OpenIddictValidationDataProtectionBuilder ValidateOnStart()
{
Services.AddOptionsWithValidateOnStart<OpenIddictValidationDataProtectionOptions>();
return this;
}
/// <summary>
/// Amends the default OpenIddict validation ASP.NET Core Data Protection configuration.
/// </summary>

7
src/OpenIddict.Validation.Owin/OpenIddictValidationOwinBuilder.cs

@ -28,6 +28,13 @@ public sealed class OpenIddictValidationOwinBuilder
[EditorBrowsable(EditorBrowsableState.Never)]
public IServiceCollection Services { get; }
public OpenIddictValidationOwinBuilder ValidateOnStart()
{
Services.AddOptionsWithValidateOnStart<OpenIddictValidationOwinOptions>();
return this;
}
/// <summary>
/// Amends the default OpenIddict validation OWIN/Katana configuration.
/// </summary>

7
src/OpenIddict.Validation.ServerIntegration/OpenIddictValidationServerIntegrationBuilder.cs

@ -27,6 +27,13 @@ public sealed class OpenIddictValidationServerIntegrationBuilder
[EditorBrowsable(EditorBrowsableState.Never)]
public IServiceCollection Services { get; }
public OpenIddictValidationServerIntegrationBuilder ValidateOnStart()
{
Services.AddOptionsWithValidateOnStart<OpenIddictValidationServerIntegrationOptions>();
return this;
}
/// <summary>
/// Amends the default OpenIddict validation/server integration configuration.
/// </summary>

7
src/OpenIddict.Validation.SystemNetHttp/OpenIddictValidationSystemNetHttpBuilder.cs

@ -32,6 +32,13 @@ public sealed class OpenIddictValidationSystemNetHttpBuilder
[EditorBrowsable(EditorBrowsableState.Never)]
public IServiceCollection Services { get; }
public OpenIddictValidationSystemNetHttpBuilder ValidateOnStart()
{
Services.AddOptionsWithValidateOnStart<OpenIddictValidationSystemNetHttpOptions>();
return this;
}
/// <summary>
/// Amends the default OpenIddict validation/System.Net.Http configuration.
/// </summary>

7
src/OpenIddict.Validation/OpenIddictValidationBuilder.cs

@ -33,6 +33,13 @@ public sealed class OpenIddictValidationBuilder
[EditorBrowsable(EditorBrowsableState.Never)]
public IServiceCollection Services { get; }
public OpenIddictValidationBuilder ValidateOnStart()
{
Services.AddOptionsWithValidateOnStart<OpenIddictValidationOptions>();
return this;
}
/// <summary>
/// Registers an event handler using the specified configuration delegate.
/// </summary>

Loading…
Cancel
Save