-
Notifications
You must be signed in to change notification settings - Fork 10.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Make CertificateConfig linker friendly #25485
Conversation
@Tratcher any way to get this in for 5.0 (area-owners.md looks out of date so not sure who to ping); as certs are kinda common as is setting them via config? Raised issue for the |
@@ -353,7 +353,18 @@ internal class CertificateConfig | |||
public CertificateConfig(IConfigurationSection configSection) | |||
{ | |||
ConfigSection = configSection; | |||
ConfigSection.Bind(this); | |||
|
|||
Path = configSection[nameof(Path)]; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Comment that this is to preserve linkability.
It's plausible if you rebase this on release/5.0. Is this the only bind in Kestrel config? I know bind is used extensively for other options types. Kestrel is already the odd one out for doing most of its own bindings. Put another way, doesn't this linking issue with Bind cripple most Options types? Does fixing Kestrel really help make your app linkable if none of the other options types work? |
This particular Bind method is only used here and in |
Hmm, I guess the other bind calls I'm used to seeing are in the templates. aspnetcore/src/ProjectTemplates/Web.ProjectTemplates/content/StarterWeb-CSharp/Startup.cs Line 68 in 1bf292d
Note these are moving in 5.0: aspnetcore/src/ProjectTemplates/Web.ProjectTemplates/content/StarterWeb-CSharp/Startup.cs Line 72 in 95c526f
To: https://github.com/AzureAD/microsoft-identity-web/blob/eb8af9c1bd6dd0014420dd6d06fd4083bda1f8b9/src/Microsoft.Identity.Web/WebApiExtensions/MicrosoftIdentityWebApiAuthenticationBuilderExtensions.cs#L89 |
Opened 5.0 targeted version #25493
Probably would need runtime fix in Configuration for that to recognise preserve the properties for the object's type that is passed in |
If #25493 gets merged then we can close this PR, 5.0 auto merges forward to master. |
Superseded by #25515 |
Currently can't use Certificates from config files if you link ASP.NET as all the setters for the config section are removed.
This directly references the properties rather than nebulously reflecting them via
object
so the linker will preserve them as they are directly used.Resolves #25482