1010
1111namespace Semmle . Extraction . CSharp . DependencyFetching
1212{
13- public class DependabotProxy : IDependabotProxy
13+ public class RegistryProxy : IRegistryProxy
1414 {
1515 /// <summary>
1616 /// Represents configurations for package registries.
@@ -65,13 +65,13 @@ public class RegistryConfig
6565
6666 public X509Certificate2 ? Certificate { get ; private set ; }
6767
68- private DependabotProxy ( IDependabotProxyConfiguration config , ILogger logger , TemporaryDirectory tempWorkingDirectory )
68+ private RegistryProxy ( IRegistryProxyConfiguration config , ILogger logger , TemporaryDirectory tempWorkingDirectory )
6969 {
7070 Address = $ "http://{ config . Host } :{ config . Port } ";
7171
7272 if ( ! string . IsNullOrWhiteSpace ( config . Certificate ) )
7373 {
74- var certDirPath = new DirectoryInfo ( Path . Join ( tempWorkingDirectory . DirInfo . FullName , ".dependabot -proxy" ) ) ;
74+ var certDirPath = new DirectoryInfo ( Path . Join ( tempWorkingDirectory . DirInfo . FullName , ".registry -proxy" ) ) ;
7575 Directory . CreateDirectory ( certDirPath . FullName ) ;
7676
7777 CertificatePath = Path . Join ( certDirPath . FullName , "proxy.crt" ) ;
@@ -81,7 +81,7 @@ private DependabotProxy(IDependabotProxyConfiguration config, ILogger logger, Te
8181 writer . Write ( config . Certificate ) ;
8282 writer . Close ( ) ;
8383
84- logger . LogInfo ( $ "Stored Dependabot proxy certificate at { CertificatePath } ") ;
84+ logger . LogInfo ( $ "Stored registry proxy certificate at { CertificatePath } ") ;
8585
8686 Certificate = X509Certificate2 . CreateFromPem ( config . Certificate ) ;
8787 }
@@ -127,37 +127,37 @@ private DependabotProxy(IDependabotProxyConfiguration config, ILogger logger, Te
127127 }
128128 }
129129
130- internal static IDependabotProxy ? Make ( ILogger logger , IDiagnosticsWriter diagnosticsWriter , TemporaryDirectory tempWorkingDirectory )
130+ internal static IRegistryProxy ? Make ( ILogger logger , IDiagnosticsWriter diagnosticsWriter , TemporaryDirectory tempWorkingDirectory )
131131 {
132132 // Setting HTTP(S)_PROXY and SSL_CERT_FILE have no effect on Windows or macOS,
133- // but we would still end up using the Dependabot proxy to check for feed reachability.
133+ // but we would still end up using the registry proxy to check for feed reachability.
134134 // This would result in us discovering that the feeds are reachable, but `dotnet` would
135135 // fail to connect to them. To prevent this from happening, we do not initialise an
136- // instance of `DependabotProxy ` on those platforms.
136+ // instance of `RegistryProxy ` on those platforms.
137137 if ( SystemBuildActions . Instance . IsWindows ( ) || SystemBuildActions . Instance . IsMacOs ( ) )
138138 {
139139 return null ;
140140 }
141141
142- return Make ( new DependabotProxyConfiguration ( ) , logger , diagnosticsWriter , tempWorkingDirectory ) ;
142+ return Make ( new RegistryProxyConfiguration ( ) , logger , diagnosticsWriter , tempWorkingDirectory ) ;
143143 }
144144
145145 /// <summary>
146- /// Creates an instance of the Dependabot proxy using the specified configuration.
146+ /// Creates an instance of the registry proxy using the specified configuration.
147147 /// Returns null if the proxy cannot be created.
148148 /// This overload is exposed primarily to enable platform-independent unit testing.
149149 /// </summary>
150- internal static IDependabotProxy ? Make (
151- IDependabotProxyConfiguration proxyConfig , ILogger logger , IDiagnosticsWriter diagnosticsWriter , TemporaryDirectory tempWorkingDirectory )
150+ internal static IRegistryProxy ? Make (
151+ IRegistryProxyConfiguration proxyConfig , ILogger logger , IDiagnosticsWriter diagnosticsWriter , TemporaryDirectory tempWorkingDirectory )
152152 {
153153 if ( string . IsNullOrWhiteSpace ( proxyConfig . Host ) || string . IsNullOrWhiteSpace ( proxyConfig . Port ) )
154154 {
155- logger . LogDebug ( "No Dependabot proxy credentials are configured." ) ;
155+ logger . LogDebug ( "No registry proxy credentials are configured." ) ;
156156 return null ;
157157 }
158158
159- var result = new DependabotProxy ( proxyConfig , logger , tempWorkingDirectory ) ;
160- logger . LogInfo ( $ "Dependabot proxy configured at { result . Address } ") ;
159+ var result = new RegistryProxy ( proxyConfig , logger , tempWorkingDirectory ) ;
160+ logger . LogInfo ( $ "Registry proxy configured at { result . Address } ") ;
161161
162162 // Emit a diagnostic for the discovered private registries, so that it is easy
163163 // for users to see that they were picked up.
0 commit comments