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