Skip to content
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

Register AuthN/Z middleware automatically in CreateSlimBuilder #47664

Merged
merged 1 commit into from
Apr 13, 2023

Conversation

eerhardt
Copy link
Member

WebApplication.CreateSlimBuilder() should auto-register AuthN/Z middleware when associated services are added This is consistent with CreateBuilder, and doesn't add much size to the app when AuthN/Z are not used.

Fix #47507

In measuring the size of dotnet publishing a dotnet new api -aot application on Windows x64:

before: 9.09 MB (9,539,584 bytes)
after: 9.17 MB (9,622,528 bytes)

This seems to be a good tradeoff, given the better usability when the app is using AuthN/Z.

cc @DamianEdwards @davidfowl

WebApplication.CreateSlimBuilder() should auto-register AuthN/Z middleware when associated services are added This is consistent with CreateBuilder, and doesn't add much size to the app when AuthN/Z are not used.

Fix dotnet#47507
@ghost ghost added the area-hosting Includes Hosting label Apr 12, 2023
@eerhardt eerhardt merged commit 53b9175 into dotnet:main Apr 13, 2023
@eerhardt eerhardt deleted the AddAuthByDefaultInSlim branch April 13, 2023 01:29
@ghost ghost added this to the 8.0-preview4 milestone Apr 13, 2023
@amcasey amcasey added area-networking Includes servers, yarp, json patch, bedrock, websockets, http client factory, and http abstractions and removed area-runtime labels Aug 25, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-hosting Includes Hosting area-networking Includes servers, yarp, json patch, bedrock, websockets, http client factory, and http abstractions
Projects
None yet
Development

Successfully merging this pull request may close these issues.

WebApplication.CreateSlimBuilder() should auto-register AuthN/Z middleware when associated services are added
3 participants