< Summary

Information
Class: Elsa.ExternalAuthentication.Endpoints.Broker.CompleteLogoutRequest
Assembly: Elsa.ExternalAuthentication
File(s): /home/runner/work/elsa-core/elsa-core/src/modules/Elsa.ExternalAuthentication/Endpoints/Broker/CompleteLogout.cs
Line coverage
100%
Covered lines: 2
Uncovered lines: 0
Coverable lines: 2
Total lines: 36
Line coverage: 100%
Branch coverage
N/A
Covered branches: 0
Total branches: 0
Branch coverage: N/A
Method coverage

Feature is only available for sponsors

Upgrade to PRO version

Metrics

MethodBranch coverage Crap Score Cyclomatic complexity Line coverage
get_ConnectionKey()100%11100%
get_State()100%11100%

File(s)

/home/runner/work/elsa-core/elsa-core/src/modules/Elsa.ExternalAuthentication/Endpoints/Broker/CompleteLogout.cs

#LineLine coverage
 1using Elsa.Abstractions;
 2using Elsa.ExternalAuthentication.Constants;
 3using Elsa.ExternalAuthentication.Services;
 4using FastEndpoints;
 5using Microsoft.AspNetCore.Builder;
 6using Microsoft.AspNetCore.RateLimiting;
 7
 8namespace Elsa.ExternalAuthentication.Endpoints.Broker;
 9
 10internal sealed class CompleteLogout(IExternalAuthenticationBroker broker) : ElsaEndpoint<CompleteLogoutRequest>
 11{
 12    public override void Configure()
 13    {
 14        Get("/external-authentication/logout/callback/{connectionKey}");
 15        AllowAnonymous();
 16        Options(x => x.RequireRateLimiting(ExternalAuthenticationRateLimitPolicyNames.ProviderCallback));
 17    }
 18
 19    public override async Task HandleAsync(CompleteLogoutRequest request, CancellationToken cancellationToken)
 20    {
 21        var result = await broker.CompleteLogoutAsync(Route<string>("connectionKey") ?? request.ConnectionKey ?? string.
 22        if (result.Error is { } error)
 23        {
 24            await BrokerEndpointSupport.SendErrorAsync(Send, error, cancellationToken);
 25            return;
 26        }
 27
 28        await Send.RedirectAsync(result.RedirectUri!.ToString(), false, true);
 29    }
 30}
 31
 32internal sealed class CompleteLogoutRequest
 33{
 134    public string? ConnectionKey { get; set; }
 135    public string? State { get; set; }
 36}

Methods/Properties

get_ConnectionKey()
get_State()