OIDC endpoints: typed lambdas instead of Delegate-cast method groups

Same routes and handlers. The casts crashed Stryker's Roslyn (NullReferenceException in method-group binding).

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
Meta Vens 2026-10-22 20:02:07 +02:00
commit 849c9e71fa

View file

@ -24,9 +24,9 @@ public static class OidcEndpoints
public static void MapBifrostOidc(this IEndpointRouteBuilder app)
{
app.MapMethods(OidcServiceCollectionExtensions.AuthorizationPath, ["GET", "POST"], (Delegate)AuthorizeAsync).AllowAnonymous();
app.MapPost(OidcServiceCollectionExtensions.TokenPath, (Delegate)ExchangeAsync).AllowAnonymous();
app.MapMethods(OidcServiceCollectionExtensions.UserInfoPath, ["GET", "POST"], (Delegate)UserInfoAsync).AllowAnonymous();
app.MapMethods(OidcServiceCollectionExtensions.AuthorizationPath, ["GET", "POST"], (HttpContext http, ICurrentBifrostActorAccessor actors) => AuthorizeAsync(http, actors)).AllowAnonymous();
app.MapPost(OidcServiceCollectionExtensions.TokenPath, (HttpContext http) => ExchangeAsync(http)).AllowAnonymous();
app.MapMethods(OidcServiceCollectionExtensions.UserInfoPath, ["GET", "POST"], (HttpContext http) => UserInfoAsync(http)).AllowAnonymous();
}
private static async Task<IResult> AuthorizeAsync(HttpContext http, ICurrentBifrostActorAccessor actors)