diff --git a/.changeset/heavy-baths-rule.md b/.changeset/heavy-baths-rule.md new file mode 100644 index 0000000000..4034035227 --- /dev/null +++ b/.changeset/heavy-baths-rule.md @@ -0,0 +1,5 @@ +--- +'@backstage/plugin-catalog-backend-module-github': minor +--- + +**BREAKING** The `GithubLocationAnalyzer` now requires the `AuthService` when being constructed and the `TokenManger` has been removed. diff --git a/plugins/catalog-backend-module-github/package.json b/plugins/catalog-backend-module-github/package.json index 42c56abf36..9028a33ab6 100644 --- a/plugins/catalog-backend-module-github/package.json +++ b/plugins/catalog-backend-module-github/package.json @@ -51,7 +51,6 @@ "test": "backstage-cli package test" }, "dependencies": { - "@backstage/backend-common": "^0.25.0", "@backstage/backend-plugin-api": "workspace:^", "@backstage/catalog-client": "workspace:^", "@backstage/catalog-model": "workspace:^", diff --git a/plugins/catalog-backend-module-github/report.api.md b/plugins/catalog-backend-module-github/report.api.md index 8cd87f646a..f6d69adbd0 100644 --- a/plugins/catalog-backend-module-github/report.api.md +++ b/plugins/catalog-backend-module-github/report.api.md @@ -26,7 +26,6 @@ import { SchedulerService } from '@backstage/backend-plugin-api'; import { SchedulerServiceTaskRunner } from '@backstage/backend-plugin-api'; import { ScmIntegrationRegistry } from '@backstage/integration'; import { ScmLocationAnalyzer } from '@backstage/plugin-catalog-node'; -import { TokenManager } from '@backstage/backend-common'; import { UserEntity } from '@backstage/catalog-model'; // @public @@ -128,8 +127,7 @@ export class GithubLocationAnalyzer implements ScmLocationAnalyzer { export type GithubLocationAnalyzerOptions = { config: Config; discovery: DiscoveryService; - tokenManager?: TokenManager; - auth?: AuthService; + auth: AuthService; githubCredentialsProvider?: GithubCredentialsProvider; catalog?: CatalogApi; }; diff --git a/plugins/catalog-backend-module-github/src/analyzers/GithubLocationAnalyzer.ts b/plugins/catalog-backend-module-github/src/analyzers/GithubLocationAnalyzer.ts index cbf43287a3..21d8e5b8ea 100644 --- a/plugins/catalog-backend-module-github/src/analyzers/GithubLocationAnalyzer.ts +++ b/plugins/catalog-backend-module-github/src/analyzers/GithubLocationAnalyzer.ts @@ -28,10 +28,6 @@ import { AnalyzeOptions, ScmLocationAnalyzer, } from '@backstage/plugin-catalog-node'; -import { - TokenManager, - createLegacyAuthAdapters, -} from '@backstage/backend-common'; import { Config } from '@backstage/config'; import { AuthService, DiscoveryService } from '@backstage/backend-plugin-api'; import { extname } from 'path'; @@ -40,8 +36,7 @@ import { extname } from 'path'; export type GithubLocationAnalyzerOptions = { config: Config; discovery: DiscoveryService; - tokenManager?: TokenManager; - auth?: AuthService; + auth: AuthService; githubCredentialsProvider?: GithubCredentialsProvider; catalog?: CatalogApi; }; @@ -61,11 +56,7 @@ export class GithubLocationAnalyzer implements ScmLocationAnalyzer { options.githubCredentialsProvider || DefaultGithubCredentialsProvider.fromIntegrations(this.integrations); - this.auth = createLegacyAuthAdapters({ - auth: options.auth, - discovery: options.discovery, - tokenManager: options.tokenManager, - }).auth; + this.auth = options.auth; } supports(url: string) { diff --git a/yarn.lock b/yarn.lock index 20037a1652..47568260b1 100644 --- a/yarn.lock +++ b/yarn.lock @@ -5579,7 +5579,6 @@ __metadata: version: 0.0.0-use.local resolution: "@backstage/plugin-catalog-backend-module-github@workspace:plugins/catalog-backend-module-github" dependencies: - "@backstage/backend-common": "npm:^0.25.0" "@backstage/backend-plugin-api": "workspace:^" "@backstage/backend-test-utils": "workspace:^" "@backstage/catalog-client": "workspace:^"