Skip to content

Commit 8b5050e

Browse files
committed
C# Expose CertificatePath from DependabotProxy
1 parent 4a7413c commit 8b5050e

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

csharp/extractor/Semmle.Extraction.CSharp.DependencyFetching/DependabotProxy.cs

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,10 @@ internal class DependabotProxy
1616
/// The full address of the Dependabot proxy, if available.
1717
/// </summary>
1818
internal readonly string? Address;
19+
/// <summary>
20+
/// The path to the temporary file where the certificate is stored.
21+
/// </summary>
22+
internal readonly string? CertificatePath;
1923

2024
/// <summary>
2125
/// Gets a value indicating whether a Dependabot proxy is configured.
@@ -49,13 +53,13 @@ internal DependabotProxy(ILogger logger, TemporaryDirectory tempWorkingDirectory
4953
var certDirPath = new DirectoryInfo(Path.Join(tempWorkingDirectory.DirInfo.FullName, ".dependabot-proxy"));
5054
Directory.CreateDirectory(certDirPath.FullName);
5155

52-
var certFilePath = Path.Join(certDirPath.FullName, "proxy.crt");
53-
this.certFile = new FileInfo(certFilePath);
56+
this.CertificatePath = Path.Join(certDirPath.FullName, "proxy.crt");
57+
this.certFile = new FileInfo(this.CertificatePath);
5458

5559
using var writer = this.certFile.CreateText();
5660
writer.Write(cert);
5761

58-
logger.LogInfo($"Stored Dependabot proxy certificate at {certFilePath}");
62+
logger.LogInfo($"Stored Dependabot proxy certificate at {this.CertificatePath}");
5963
}
6064

6165
internal void ApplyProxy(ILogger logger, ProcessStartInfo startInfo)

0 commit comments

Comments
 (0)