Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Apply code review feedback to use more appropriate helper functions i…
…n parsing a boolean config option
  • Loading branch information
Michael J. Lyons (XBOX) committed Jul 19, 2024
commit 55d626240ff4b427a04082f4e33a5e34e0d46ed8
6 changes: 2 additions & 4 deletions src/shared/Microsoft.AzureRepos/AzureReposHostProvider.cs

This comment was marked as outdated.

Original file line number Diff line number Diff line change
Expand Up @@ -549,13 +549,11 @@ private bool UseServicePrincipal(out ServicePrincipalIdentity sp)

if (hasCertThumbprint)
{
bool hasX5CSetting = _context.Settings.TryGetSetting(
sp.SendX5C = _context.Settings.TryGetSetting(
AzureDevOpsConstants.EnvironmentVariables.ServicePrincipalCertificateSendX5C,
Constants.GitConfiguration.Credential.SectionName,
AzureDevOpsConstants.GitConfiguration.Credential.ServicePrincipalCertificateSendX5C,
out string certHasX5C);

sp.SendX5C = !hasX5CSetting || certHasX5C != "false";
out string certHasX5CStr) && certHasX5CStr.ToBooleanyOrDefault(false);

X509Certificate2 cert = X509Utils.GetCertificateByThumbprint(certThumbprint);
if (cert is null)
Expand Down