make the githubCredentialsProvider overrideable

Signed-off-by: Kiss Miklos <miklos@roadie.io>
This commit is contained in:
Kiss Miklos
2022-11-28 16:13:02 +01:00
parent 4e68ddd84b
commit 49ae28b46b
@@ -39,6 +39,7 @@ export type GithubLocationAnalyzerOptions = {
config: Config;
discovery: PluginEndpointDiscovery;
tokenManager: TokenManager;
githubCredentialsProvider?: GithubCredentialsProvider;
};
/** @public */
@@ -52,6 +53,7 @@ export class GithubLocationAnalyzer implements ScmLocationAnalyzer {
this.catalogClient = new CatalogClient({ discoveryApi: options.discovery });
this.integrations = ScmIntegrations.fromConfig(options.config);
this.githubCredentialsProvider =
options.githubCredentialsProvider ||
DefaultGithubCredentialsProvider.fromIntegrations(this.integrations);
this.tokenManager = options.tokenManager;
}