55using System . Net . Http ;
66using System . Threading ;
77using System . Threading . Tasks ;
8+ using System . Web ;
89using Autofac ;
910using GitHubVulnerabilities2Db . Collector ;
1011using GitHubVulnerabilities2Db . Configuration ;
1112using GitHubVulnerabilities2Db . Gallery ;
1213using GitHubVulnerabilities2Db . GraphQL ;
1314using GitHubVulnerabilities2Db . Ingest ;
15+ using Microsoft . ApplicationInsights . Extensibility ;
1416using Microsoft . Extensions . Configuration ;
1517using Microsoft . Extensions . DependencyInjection ;
1618using Microsoft . Extensions . Options ;
2123using NuGet . Services . Storage ;
2224using NuGetGallery ;
2325using NuGetGallery . Auditing ;
26+ using NuGetGallery . Configuration ;
27+ using NuGetGallery . Diagnostics ;
2428using NuGetGallery . Security ;
2529
2630namespace GitHubVulnerabilities2Db
@@ -109,6 +113,19 @@ protected void ConfigureGalleryServices(ContainerBuilder containerBuilder)
109113 containerBuilder
110114 . RegisterType < PackageUpdateService > ( )
111115 . As < IPackageUpdateService > ( ) ;
116+
117+ containerBuilder . RegisterType < AppConfiguration > ( )
118+ . As < IAppConfiguration > ( )
119+ . SingleInstance ( ) ;
120+
121+ var contentService = new FakeContentService ( ) ;
122+ containerBuilder . RegisterInstance ( contentService )
123+ . As < IContentService > ( )
124+ . SingleInstance ( ) ;
125+
126+ containerBuilder . RegisterType < ContentObjectService > ( )
127+ . As < IContentObjectService > ( )
128+ . SingleInstance ( ) ;
112129 }
113130
114131 protected void ConfigureQueryServices ( ContainerBuilder containerBuilder )
@@ -165,4 +182,18 @@ private DurableCursor CreateCursor(IComponentContext ctx, Func<GitHubVulnerabili
165182 return new DurableCursor ( storage . ResolveUri ( getBlobName ( config ) ) , storage , DateTimeOffset . MinValue ) ;
166183 }
167184 }
185+
186+ public class FakeContentService : IContentService
187+ {
188+ public void ClearCache ( )
189+ {
190+ //no-op
191+ }
192+
193+ public Task < IHtmlString > GetContentItemAsync ( string name , TimeSpan expiresIn )
194+ {
195+ // no-op
196+ return Task . FromResult ( ( IHtmlString ) null ) ;
197+ }
198+ }
168199}
0 commit comments