Merge pull request #14902 from RoadieHQ/make-githubcredentialsprovider-overrideable
Make githubCredentialsProvider overrideable in GithubLocationAnalyzer
This commit is contained in:
@@ -0,0 +1,5 @@
|
||||
---
|
||||
'@backstage/plugin-catalog-backend-module-github': patch
|
||||
---
|
||||
|
||||
Added the githubCredentialsProvider property to the GithubLocationAnalyzerOptions to be able to override the GithubCredentialsProvider.
|
||||
@@ -128,6 +128,7 @@ export type GithubLocationAnalyzerOptions = {
|
||||
config: Config;
|
||||
discovery: PluginEndpointDiscovery;
|
||||
tokenManager: TokenManager;
|
||||
githubCredentialsProvider?: GithubCredentialsProvider;
|
||||
};
|
||||
|
||||
// @public
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user