< Summary

Information
Class: Elsa.ExternalAuthentication.Validation.ExternalCallbackBaseUriValidator
Assembly: Elsa.ExternalAuthentication
File(s): /home/runner/work/elsa-core/elsa-core/src/modules/Elsa.ExternalAuthentication/Validation/ExternalCallbackBaseUriValidator.cs
Line coverage
100%
Covered lines: 8
Uncovered lines: 0
Coverable lines: 8
Total lines: 18
Line coverage: 100%
Branch coverage
94%
Covered branches: 17
Total branches: 18
Branch coverage: 94.4%
Method coverage

Feature is only available for sponsors

Upgrade to PRO version

Metrics

MethodBranch coverage Crap Score Cyclomatic complexity Line coverage
IsValid(...)94.44%1818100%
get_ErrorMessage()100%11100%

File(s)

/home/runner/work/elsa-core/elsa-core/src/modules/Elsa.ExternalAuthentication/Validation/ExternalCallbackBaseUriValidator.cs

#LineLine coverage
 1using Elsa.ExternalAuthentication.Options;
 2
 3namespace Elsa.ExternalAuthentication.Validation;
 4
 5/// <summary>Validates the deployment-owned public callback base used by upstream identity providers.</summary>
 6public static class ExternalCallbackBaseUriValidator
 7{
 8    public static bool IsValid(Uri? uri, bool allowDevelopmentLoopback) =>
 49        uri is { IsAbsoluteUri: true } &&
 410        string.IsNullOrEmpty(uri.UserInfo) &&
 411        string.IsNullOrEmpty(uri.Fragment) &&
 412        string.IsNullOrEmpty(uri.Query) &&
 413        !uri.Host.Contains('*') &&
 414        (string.Equals(uri.Scheme, Uri.UriSchemeHttps, StringComparison.OrdinalIgnoreCase) ||
 415         allowDevelopmentLoopback && uri.IsLoopback && string.Equals(uri.Scheme, Uri.UriSchemeHttp, StringComparison.Ord
 16
 317    public static string ErrorMessage => "External Authentication Redirects:ExternalCallbackBaseUri must be an absolute 
 18}