Class StartupSecurityPostureExtensions
- Namespace
- ReferenceApplication.Web.Extensions
- Assembly
- ReferenceApplication.Web.dll
Provides startup-only diagnostics for security-relevant supported deployment postures.
public static class StartupSecurityPostureExtensions
- Inheritance
-
StartupSecurityPostureExtensions
- Inherited Members
Methods
GetRegisteredDevelopmentOnlyComponents(IServiceProvider)
Lists the Development-only components the host's service provider has registered.
public static IReadOnlyList<string> GetRegisteredDevelopmentOnlyComponents(IServiceProvider services)
Parameters
servicesIServiceProviderThe application's root service provider.
Returns
- IReadOnlyList<string>
The display names of the registered components, in a fixed order; empty when none is registered.
Remarks
The answer comes from the running host's own registrations, not from configuration, so a deployment can prove from its startup log that none of the demo identity or governance sandbox components is present.
LogApplicationSecurityPosture(WebApplication)
Emits structured startup diagnostics for supported security postures that require operator awareness.
public static WebApplication LogApplicationSecurityPosture(this WebApplication app)
Parameters
appWebApplicationThe application whose startup posture is being reported.
Returns
- WebApplication
The original WebApplication for chaining.
LogApplicationSecurityPosture(ILogger, IConfiguration, IHostEnvironment)
Emits structured startup diagnostics using the supplied application services. This overload keeps the posture rules independently testable.
public static void LogApplicationSecurityPosture(ILogger logger, IConfiguration configuration, IHostEnvironment environment)
Parameters
loggerILoggerThe startup logger.
configurationIConfigurationThe application configuration.
environmentIHostEnvironmentThe host environment.
LogDevelopmentOnlyComponents(ILogger, IServiceProvider)
Reports which Development-only components the host's service provider has registered.
public static void LogDevelopmentOnlyComponents(ILogger logger, IServiceProvider services)
Parameters
loggerILoggerThe startup logger.
servicesIServiceProviderThe application's root service provider.