|
1 | 1 | # @red-hat-developer-hub/backstage-plugin-bulk-import-backend |
2 | 2 |
|
| 3 | +## 7.3.0 |
| 4 | + |
| 5 | +### Minor Changes |
| 6 | + |
| 7 | +- 4eafd59: **BREAKING** Changes the behavior of the bulk-import backend plugin to return only repositories that are yet to be imported by filtering out the already imported ones. Therefore, the frontend will not display already imported repositories with status displayed as "Imported" anymore. The frontend fetches all repositories at once on the first page load and then all the pagination and search is done client-side. |
| 8 | +- a1ae6d2: ## On Behalf of User Access |
| 9 | + |
| 10 | + This release introduces the ability for the Bulk Import plugin to fetch repository and organization listings **on behalf of the signed-in user**, using their OAuth credentials rather than relying solely on server-side integration credentials (GitHub App, PAT, or GitLab token). |
| 11 | + |
| 12 | + ### What Changed |
| 13 | + |
| 14 | + **Backend (`bulk-import-backend`)** |
| 15 | + - Added a new `GET /api/bulk-import/scm-hosts` endpoint that returns the configured GitHub and GitLab integration host URLs as a `SCMHostList` object, enabling the frontend to discover which hosts to request OAuth tokens for. |
| 16 | + - The `GET /repositories` and `GET /organizations/{organizationName}/repositories` endpoints now **require** the `x-scm-tokens` request header — a JSON map of SCM host base URL to user OAuth token. Requests that omit this header, or supply an empty or oversized header, are rejected with HTTP 401. This ensures repository listings are always scoped to the signed-in user's access and never fall back to server-wide integration credentials. |
| 17 | + - The `x-scm-tokens` header is stripped from the request immediately upon receipt, before the permission check and before any audit event is created, so OAuth token values are never persisted in audit logs. |
| 18 | + - When user tokens are provided for GitHub, the Octokit response cache is intentionally disabled to prevent cross-user ETag cache leakage. Server-side credential paths are not affected. |
| 19 | + - Introduced a shared `GitApiService` interface and common SCM types (`SCMOrganization`, `SCMRepository`, `SCMFetchError`, etc.) to unify the GitHub and GitLab service implementations under a consistent contract. |
| 20 | + |
| 21 | + **Frontend (`bulk-import`)** |
| 22 | + - The plugin now has a **soft dependency** on `@backstage/integration-react`'s `ScmAuthApi`. If the API is registered in the application, the plugin automatically requests OAuth tokens for each configured SCM host and passes them to the backend to enable user-scoped repository listings. |
| 23 | + - Added `getSCMHosts()` to the `BulkImportAPI` interface with a corresponding `GET /api/bulk-import/scm-hosts` client call, used to discover host URLs before requesting user tokens. |
| 24 | + - User OAuth tokens are transmitted to the backend via the `X-SCM-Tokens` request header as a JSON-encoded map. |
| 25 | + - If the SCM OAuth integration is not configured or token collection fails for all hosts, the repository list query is **blocked** on the frontend and the hook surfaces a descriptive error. This prevents the frontend from firing a request that will always be rejected with 401. |
| 26 | + |
| 27 | + ### Required Configuration |
| 28 | + |
| 29 | + The GitHub and/or GitLab OAuth provider must be configured in the Backstage application for repository listing to work. Deployments that previously relied on server-side credentials alone for the repository list view must add an SCM OAuth provider to continue using this feature. |
| 30 | + |
| 31 | + If `ScmAuthApi` is not registered or tokens cannot be obtained for any configured SCM host, users will see an error prompting them to configure the SCM OAuth integration. |
| 32 | + |
| 33 | +- 328508c: Backstage version bump to v1.49.3 |
| 34 | + |
| 35 | +### Patch Changes |
| 36 | + |
| 37 | +- b3a0333: Fixed GitLab OAuth flow for on behalf of the signed-in user |
| 38 | +- 518943d: Updated dependency `@openapitools/openapi-generator-cli` to `2.31.1`. |
| 39 | + Updated dependency `@playwright/test` to `1.59.1`. |
| 40 | + Updated dependency `@red-hat-developer-hub/backstage-plugin-theme` to `^0.14.0`. |
| 41 | +- 8e0bb08: Updated dependency `@openapitools/openapi-generator-cli` to `2.30.2`. |
| 42 | + Updated dependency `openapicmd` to `2.9.0`. |
| 43 | + Updated dependency `@playwright/test` to `1.58.2`. |
| 44 | +- 3f9d1fe: Updated dependency `openapicmd` to `2.9.2`. |
| 45 | +- Updated dependencies [328508c] |
| 46 | + - @red-hat-developer-hub/backstage-plugin-bulk-import-common@7.3.0 |
| 47 | + |
3 | 48 | ## 7.2.1 |
4 | 49 |
|
5 | 50 | ### Patch Changes |
|
0 commit comments