merge master

Signed-off-by: secustor <sebastian@poxhofer.at>
This commit is contained in:
secustor
2025-10-03 09:57:22 +02:00
669 changed files with 18292 additions and 3017 deletions
+5
View File
@@ -0,0 +1,5 @@
---
'@backstage/plugin-catalog-backend': patch
---
Internal refactor to remove remnants of the old backend system
+5
View File
@@ -0,0 +1,5 @@
---
'@backstage/plugin-search-backend-module-pg': patch
---
Truncate long docs to fit PG index size limit
+5
View File
@@ -0,0 +1,5 @@
---
'@backstage/plugin-catalog-backend': patch
---
Log before provider-orphaning eviction happens
@@ -0,0 +1,5 @@
---
'@backstage/plugin-mui-to-bui': minor
---
This is the first release of the Material UI to Backstage UI migration helper plugin. It adds a new page at `/mui-to-bui` that converts an existing MUI v5 theme into Backstage UI (BUI) CSS variables, with live preview and copy/download.
+5
View File
@@ -0,0 +1,5 @@
---
'@backstage/backend-defaults': minor
---
implement support for direct url for AzureBlobStorageUrlReader search function
+5
View File
@@ -0,0 +1,5 @@
---
'@backstage/ui': patch
---
remove default selection of tab
+5
View File
@@ -0,0 +1,5 @@
---
'@backstage/plugin-catalog-backend': patch
---
Fix for duplicate search results in entity-facets API call
+5
View File
@@ -0,0 +1,5 @@
---
'@backstage/plugin-catalog-graph': patch
---
Add missing API implementation for catalog graph plugin in NFS apps.
+5
View File
@@ -0,0 +1,5 @@
---
'@backstage/create-app': patch
---
Bumped create-app version.
+5
View File
@@ -0,0 +1,5 @@
---
'@backstage/create-app': patch
---
Bumped create-app version.
+5
View File
@@ -0,0 +1,5 @@
---
'@backstage/create-app': patch
---
Bumped create-app version.
+5
View File
@@ -0,0 +1,5 @@
---
'@backstage/plugin-scaffolder-react': patch
---
Don't change loading to false until we've actually got some log state
+5
View File
@@ -0,0 +1,5 @@
---
'@backstage/plugin-catalog-react': patch
---
Correct translation key from "type" to "owner" for owner column in entity table to ensure the right translation is loaded.
+5
View File
@@ -0,0 +1,5 @@
---
'@backstage/plugin-kubernetes-react': patch
---
The configmaps added to be rendered
+25
View File
@@ -0,0 +1,25 @@
---
'@backstage/plugin-catalog-backend': patch
---
Moved catalog processor and provider disabling and priorities under own config objects.
This is due to issue with some existing providers, such as GitHub, using array syntax for the provider configuration.
The new config format is not backwards compatible, so users will need to update their config files. The new format
is as follows:
```yaml
catalog:
providerOptions:
providerA:
disabled: false
providerB:
disabled: true
processorOptions:
processorA:
disabled: false
priority: 10
processorB:
disabled: true
```
+5
View File
@@ -0,0 +1,5 @@
---
'@backstage/core-components': patch
---
Swap base token for semantic token in ItemCardHeader to ensure readability in light mode.
+5
View File
@@ -0,0 +1,5 @@
---
'@backstage/integration': patch
---
remove host from azure blob storage integration type
+5
View File
@@ -0,0 +1,5 @@
---
'@backstage/plugin-org': patch
---
Add `initialRelationAggregation` and `showAggregateMembersToggle` options to `EntityMembersListCard` as well to `EntityOwnershipCard`
+5
View File
@@ -0,0 +1,5 @@
---
'@backstage/plugin-notifications-backend-module-slack': minor
---
Adds username as optional config in order to send Slack notifications with a specific username in the case when using one Slack App for more than just Backstage.
+5
View File
@@ -0,0 +1,5 @@
---
'@backstage/plugin-scaffolder-backend-module-gcp': patch
---
Fix documentation strings to mention GCP instead of Azure
+18
View File
@@ -0,0 +1,18 @@
---
'@backstage/plugin-scaffolder-backend-module-confluence-to-markdown': patch
'@backstage/plugin-scaffolder-backend-module-bitbucket-server': patch
'@backstage/plugin-scaffolder-backend-module-bitbucket-cloud': patch
'@backstage/plugin-scaffolder-backend-module-notifications': patch
'@backstage/plugin-scaffolder-backend-module-cookiecutter': patch
'@backstage/plugin-scaffolder-backend-module-bitbucket': patch
'@backstage/plugin-scaffolder-backend-module-gerrit': patch
'@backstage/plugin-scaffolder-backend-module-github': patch
'@backstage/plugin-scaffolder-backend-module-gitlab': patch
'@backstage/plugin-scaffolder-backend-module-sentry': patch
'@backstage/plugin-scaffolder-backend-module-yeoman': patch
'@backstage/plugin-scaffolder-backend-module-azure': patch
'@backstage/plugin-scaffolder-backend-module-gitea': patch
'@backstage/plugin-scaffolder-backend-module-rails': patch
---
Updating import for the `scaffolderActionsExtensionPoint` to be the main export
+19
View File
@@ -0,0 +1,19 @@
---
'@backstage/cli': patch
---
Added a new `--entrypoint` option to the `package start` command, which allows you to specify a custom entry directory/file for development applications. This is particularly useful when maintaining separate dev apps for different versions of your plugin (e.g., stable and alpha).
**Example usage:**
Consider the following plugin dev folder structure:
```
dev/
index.tsx
alpha/
index.ts
```
- The default `yarn package start` command uses the `dev/` folder as the entry point and executes `dev/index.tsx` file;
- Running `yarn package start --entrypoint dev/alpha` will instead use `dev/alpha/` as the entry point and execute `dev/alpha/index.ts` file.
+5
View File
@@ -0,0 +1,5 @@
---
'@backstage/ui': patch
---
Enable tooltips on disabled buttons with automatic wrapper
+5
View File
@@ -0,0 +1,5 @@
---
'@backstage/plugin-search-backend-module-pg': patch
---
Added the < character to the query filter regexp
+50 -2
View File
@@ -203,7 +203,55 @@
"@backstage/plugin-techdocs-react": "1.3.3",
"@backstage/plugin-user-settings": "0.8.26",
"@backstage/plugin-user-settings-backend": "0.3.6",
"@backstage/plugin-user-settings-common": "0.0.1"
"@backstage/plugin-user-settings-common": "0.0.1",
"@backstage/plugin-mui-to-bui": "0.1.0"
},
"changesets": []
"changesets": [
"brave-teeth-reply",
"brown-falcons-own",
"brown-turkeys-send",
"bui-themer-bui-palette-additions",
"calm-trains-tie",
"clever-papers-watch",
"cold-coats-show",
"cool-baboons-count",
"create-app-1758639549",
"create-app-1758718573",
"create-app-1759243273",
"curvy-bobcats-melt",
"eager-toes-start",
"famous-loops-tickle",
"fast-heads-brake",
"fast-queens-guess",
"five-olives-bet",
"giant-weeks-jump",
"heavy-cooks-divide",
"hungry-crews-fetch",
"itchy-falcons-leave",
"kind-places-reply",
"legal-eagles-jog",
"modern-pugs-appear",
"moody-singers-deny",
"nice-readers-judge",
"public-sites-admire",
"public-wombats-say",
"rare-states-pay",
"ready-poems-change",
"ready-pots-arrive",
"red-dodos-work",
"red-times-bet",
"salty-words-wash",
"short-aliens-invite",
"six-cooks-battle",
"slimy-signs-agree",
"solid-bikes-leave",
"tame-hairs-smash",
"tender-cups-tap",
"thirty-rules-press",
"tired-mice-cheer",
"twelve-guests-sit",
"unified-theme-attr-stack",
"wet-spiders-wait",
"wide-flies-jog"
]
}
+6
View File
@@ -0,0 +1,6 @@
---
'@backstage/core-components': patch
'@backstage/plugin-catalog-graph': patch
---
Fixed DependencyGraph `svg` size not adapting to the container size
+5
View File
@@ -0,0 +1,5 @@
---
'@backstage/core-components': patch
---
Fixed dependency graph automatically scrolling forever
+6
View File
@@ -0,0 +1,6 @@
---
'@backstage/plugin-catalog-backend-module-azure': patch
'@backstage/integration': patch
---
Adds config definitions for Azure Blob Storage.
+9
View File
@@ -0,0 +1,9 @@
---
'@backstage/plugin-scaffolder-node': minor
---
**BREAKING** - Marking optional fields as required in the `TaskBroker`, these can be fixed with a no-op `() => void` if you don't want to implement the functions.
- `cancel`, `recoverTasks` and `retry` are the required methods on the `TaskBroker` interface.
**NOTE**: If you're affected by this breaking change, please reach out to us in an issue as we're thinking about completely removing the `TaskBroker` extension point soon and would like to hear your use cases for the upcoming re-architecture of the `scaffolder-backend` plugin.
+5
View File
@@ -0,0 +1,5 @@
---
'@backstage/plugin-scaffolder': patch
---
Add missing `templatingExtensions` option to RouterProps.contextMenu to allow global control across scaffolder pages
+9
View File
@@ -0,0 +1,9 @@
---
'@backstage/plugin-catalog-backend': patch
---
Added new `catalog:validate-entity` action to actions registry.
This action can be used to validate entities against the software catalog.
This is useful for validating `catalog-info.yaml` file changes locally using the
Backstage MCP server.
+13
View File
@@ -0,0 +1,13 @@
---
'@backstage/plugin-scaffolder-node': patch
---
**BREAKING ALPHA**: We've moved the `scaffolderActionsExtensionPoint` from `/alpha` to the main export.
```tsx
// before
import { scaffolderActionsExtensionPoint } from '@backstage/plugin-scaffolder-node/alpha';
// after
import { scaffolderActionsExtensionPoint } from '@backstage/plugin-scaffolder-node';
```
+11
View File
@@ -0,0 +1,11 @@
---
'@backstage/backend-defaults': minor
---
Adds support for configuring server-level HTTP options through the
`app-config.yaml` file under the `backend.server` key. Supported options
include `headersTimeout`, `keepAliveTimeout`, `requestTimeout`, `timeout`,
`maxHeadersCount`, and `maxRequestsPerSocket`.
These are passed directly to the underlying Node.js HTTP server.
If omitted, Node.js defaults are used.
+13
View File
@@ -0,0 +1,13 @@
---
'@backstage/plugin-api-docs': minor
---
Remove explicit dependency on `isomorphic-form-data`.
This explicit dependency was added to address [an issue](https://github.com/swagger-api/swagger-ui/issues/7436) in the
dependency `swagger-ui-react`. That [issue has since been resolved](https://github.com/swagger-api/swagger-ui/issues/7436#issuecomment-889792304),
and `isomorphic-form-data` no longer needs to be declared.
Additionally, this changeset updates the `swagger-ui-react` dependency to version `5.19.0` or higher, which includes
[compatibility](https://github.com/swagger-api/swagger-ui?tab=readme-ov-file#compatibility) with the latest versions of
the OpenAPI specification.
+6
View File
@@ -0,0 +1,6 @@
---
'@backstage/config-loader': patch
'@backstage/config': patch
---
Allow colon to be used as config key.
+5
View File
@@ -0,0 +1,5 @@
---
'@backstage/plugin-notifications-backend': patch
---
Fixed exclude entity reference not working in notification sending
+9
View File
@@ -0,0 +1,9 @@
---
'@backstage/plugin-scaffolder-node': patch
---
**DEPRECATION**: We're going to be working on refactoring a lot of the internals of the Scaffolder backend plugin, and with that comes a lot of deprecations and removals for public types that are making these things hard.
If you're using these types, please reach out to us either on Discord or a GitHub issue with your use cases.
- `SerializedTask`, `SerializedTaskEvent`, `TaskBroker`, `TaskContext`, `TaskBrokerDispatchOptions`, `TaskBrokerDispatchResult`, `TaskCompletionState`, `TaskEventType`, `TaskFilter`, `TaskFilters`, `TaskStatus` are the types that have now been marked as deprecated, and will be removed in a future release.
+6
View File
@@ -0,0 +1,6 @@
---
'@backstage/plugin-catalog-backend-module-bitbucket-cloud': patch
'@backstage/plugin-bitbucket-cloud-common': patch
---
Allow for passing a `pagelen` parameter to configure the `pagelength` property of the `BitbucketCloudEntityProvider` `searchCode` pagination to resolve [bug](https://jira.atlassian.com/browse/BCLOUD-23644) pertaining to duplicate results being returned.
+5
View File
@@ -0,0 +1,5 @@
---
'@backstage/ui': patch
---
Improved SearchField component flex layout and animations. Fixed SearchField behavior in Header components by switching from width-based transitions to flex-basis transitions for better responsive behavior. Added new Storybook stories to test SearchField integration with Header component.
+5
View File
@@ -0,0 +1,5 @@
---
'@backstage/backend-defaults': minor
---
Add a new `externalTokenHandlersServiceRef` to allow custom external token validations
+5
View File
@@ -0,0 +1,5 @@
---
'@backstage/ui': patch
---
Avoid overriding onChange when spreading props
+5
View File
@@ -0,0 +1,5 @@
---
'@backstage/plugin-kubernetes-react': patch
---
Fixes calculation of CPU utilization in the PodTable
+5
View File
@@ -0,0 +1,5 @@
---
'@backstage/plugin-catalog-backend-module-gitlab': patch
---
Fixed an issue in `GitlabDiscoveryEntityProvider` where entity fetching could fail for projects with special characters or that had been renamed or moved.
+5
View File
@@ -0,0 +1,5 @@
---
'@backstage/theme': patch
---
The `UnifiedThemeProvider` now coordinates theme attributes on the document `body` in case multiple theme providers are rendered.
+7
View File
@@ -0,0 +1,7 @@
---
'@backstage/plugin-scaffolder-backend': major
---
**BREAKING** - Removing the deprecated types and interfaces, there's no replacement for these types, and hopefully not currently used as they offer no value with the plugin being on the new backend system and no way to consume them.
Affected types: `CreateWorkerOptions`, `CurrentClaimedTask`, `DatabaseTaskStore`, `DatabaseTaskStoreOptions`, `TaskManager`, `TaskStore`, `TaskStoreCreateTaskOptions`, `TaskStoreCreateTaskResult`, `TaskStoreEmitOptions`, `TaskStoreListEventsOptions`, `TaskStoreRecoverTaskOptions`, `TaskStoreShutDownTaskOptions`, `TaskWorker` and `TemplateActionRegistry`.
+5
View File
@@ -0,0 +1,5 @@
---
'@backstage/plugin-scaffolder': patch
---
Added missing form fields for the new frontend system.
+5
View File
@@ -0,0 +1,5 @@
---
'@backstage/cli': patch
---
Added automatic detection and support for the Backstage Yarn plugin when generating new packages with `yarn new`. When the plugin is installed, new packages will automatically use `backstage:^` ranges for `@backstage/*` dependencies.
+1 -1
View File
@@ -14,7 +14,7 @@ The following files contain guidelines for the project:
Before any of these commands can be run, you need to run `yarn install` in the project root.
- Build: There is no need to build the project during development, and it is verified automatically in the CI pipeline.
- Test: Use `yarn test <path>` in the project root to run tests. The path can be either a single file or a directory, and be omitted to run tests for all changed files.
- Test: Use `yarn test --no-watch <path>` in the project root to run tests. The path can be either a single file or a directory. Always provide a path, avoid running all tests.
- Type checking: Use `yarn tsc` in the project root to run the type checker.
- Code formatting: Use `yarn prettier --write <path>` to format code.
- Lint: Use `yarn lint --fix` in the project root to run the linter.
+2 -10
View File
@@ -6,16 +6,8 @@ on:
pull_request:
paths-ignore:
- '.github/workflows/verify_chromatic.yml'
- 'storybook/**'
- 'packages/config/src/**'
- 'packages/theme/src/**'
- 'packages/types/src/**'
- 'packages/errors/src/**'
- 'packages/version-bridge/src/**'
- 'packages/test-utils/src/**'
- 'packages/core-app-api/src/**'
- 'packages/core-plugin-api/src/**'
- 'packages/core-components/src/**'
- '.storybook/**'
- 'packages/ui/src/**'
- '**/*.stories.tsx'
permissions:
+32 -11
View File
@@ -1,20 +1,15 @@
name: Chromatic
on:
# NOTE: If you change these you must update verify_storybook-noop.yml as well
workflow_dispatch:
push:
branches:
- master
pull_request:
paths:
- '.github/workflows/verify_chromatic.yml'
- '.storybook/**'
- 'packages/ui/src/**'
- 'packages/config/src/**'
- 'packages/theme/src/**'
- 'packages/types/src/**'
- 'packages/errors/src/**'
- 'packages/version-bridge/src/**'
- 'packages/test-utils/src/**'
- 'packages/core-app-api/src/**'
- 'packages/core-plugin-api/src/**'
- 'packages/core-components/src/**'
- 'packages/ui/**'
- '**/*.stories.tsx'
jobs:
@@ -36,7 +31,7 @@ jobs:
- name: Checkout code
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
fetch-depth: 0 # Required to retrieve git history
fetch-depth: 10000 # Required to retrieve git history
- name: Use node.js ${{ matrix.node-version }}
uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0
@@ -53,6 +48,7 @@ jobs:
run: yarn build-storybook:chromatic
- name: Run Chromatic
id: chromatic
uses: chromaui/action@latest
with:
token: ${{ secrets.GITHUB_TOKEN }}
@@ -61,3 +57,28 @@ jobs:
projectToken: chpt_dab72dc0f97d55b
storybookBuildDir: dist-storybook
onlyChanged: true
externals: |
packages/ui/**/*.css
packages/ui/css/**
packages/ui/src/**/*.css
- name: Prepare Chromatic Message
if: github.event_name == 'pull_request' && steps.chromatic.outputs.url
id: prepare-message
run: |
if [ "${{ steps.chromatic.outputs.changeCount }}" = "0" ] || [ -z "${{ steps.chromatic.outputs.changeCount }}" ]; then
echo "changes-text=No visual changes detected - [**View build in Chromatic**](${{ steps.chromatic.outputs.buildUrl }})" >> $GITHUB_OUTPUT
else
echo "changes-text=**${{ steps.chromatic.outputs.changeCount }}** visual changes are waiting for review - [**Review changes in Chromatic**](${{ steps.chromatic.outputs.buildUrl }})" >> $GITHUB_OUTPUT
fi
- name: Post Chromatic Link in PR Comment
if: github.event_name == 'pull_request' && steps.chromatic.outputs.url
uses: mshick/add-pr-comment@v2
with:
message: |
## 🎨 Visual Testing with Chromatic
- ${{ steps.prepare-message.outputs.changes-text }}
- **${{ steps.chromatic.outputs.specCount}}** stories for **${{ steps.chromatic.outputs.componentCount}}** Components - [**Preview changes in Storybook**](${{ steps.chromatic.outputs.storybookUrl }})
repo-token: ${{ secrets.GITHUB_TOKEN }}
+4 -5
View File
@@ -41,11 +41,10 @@ jobs:
with:
python-version: '3.9'
- name: install dependencies
run: yarn install --immutable
- name: generate types
run: yarn tsc
- name: yarn install
uses: backstage/actions/yarn-install@b3c1841fd69e1658ac631afafd0fb140a2309024 # v0.6.17
with:
cache-prefix: ${{ runner.os }}-v${{ matrix.node-version }}
- name: build techdocs-cli
working-directory: packages/techdocs-cli
@@ -1,35 +0,0 @@
diff --git a/dist/preview.d.ts b/dist/preview.d.ts
index 73525b5fe07240d27733b59362cf2076cd28a6ed..0420e6b170a65b6d0db64fcfcfa07b68cd851942 100644
--- a/dist/preview.d.ts
+++ b/dist/preview.d.ts
@@ -174,7 +174,7 @@ type UnionToIntersection<Union> = (
declare function __definePreview<Addons extends PreviewAddon<never>[]>(input: {
addons: Addons;
} & ProjectAnnotations<ReactTypes & InferTypes<Addons>>): ReactPreview<ReactTypes & InferTypes<Addons>>;
-interface ReactPreview<T extends AddonTypes> extends Preview<ReactTypes & T> {
+interface ReactPreview<T extends AddonTypes = any> extends Omit<Preview<ReactTypes & T>, 'meta'> {
meta<TArgs extends Args, Decorators extends DecoratorFunction<ReactTypes & T, any>, TMetaArgs extends Partial<TArgs>>(meta: {
render?: ArgsStoryFn<ReactTypes & T, TArgs>;
component?: ComponentType<TArgs>;
@@ -187,16 +187,13 @@ interface ReactPreview<T extends AddonTypes> extends Preview<ReactTypes & T> {
}>;
}
type DecoratorsArgs<TRenderer extends Renderer, Decorators> = UnionToIntersection<Decorators extends DecoratorFunction<TRenderer, infer TArgs> ? TArgs : unknown>;
-interface ReactMeta<T extends ReactTypes, MetaInput extends ComponentAnnotations<T>> extends Meta<T, MetaInput> {
+interface ReactMeta<T extends ReactTypes = any, MetaInput = any> extends Omit<Meta<T, ComponentAnnotations<T, any>>, 'story'> {
story<TInput extends (() => ReactTypes['storyResult']) | (StoryAnnotations<T, T['args']> & {
render: () => ReactTypes['storyResult'];
- })>(story?: TInput): ReactStory<T, TInput extends () => ReactTypes['storyResult'] ? {
- render: TInput;
- } : TInput>;
- story<TInput extends Simplify<StoryAnnotations<T, AddMocks<T['args'], MetaInput['args']>, SetOptional<T['args'], keyof T['args'] & keyof MetaInput['args']>>>>(story?: TInput): ReactStory<T, TInput>;
+ })>(story?: TInput): ReactStory<T>;
+ story<TInput = any>(story?: TInput): ReactStory<T>;
}
-interface ReactStory<T extends ReactTypes, TInput extends StoryAnnotations<T, T['args']>> extends Story<T, TInput> {
+interface ReactStory<T extends ReactTypes> {
Component: ComponentType<Partial<T['args']>>;
}
-
export { ReactPreview, ReactStory, __definePreview };
\ No newline at end of file
+27 -27
View File
@@ -43,12 +43,12 @@ export const gridItemPropDefs: Record<string, PropDef> = {
values: [...columnsValues, 'full'],
responsive: true,
},
start: {
colStart: {
type: 'enum | string',
values: [...columnsValues, 'auto'],
responsive: true,
},
end: {
colEnd: {
type: 'enum | string',
values: [...columnsValues, 'auto'],
responsive: true,
@@ -60,7 +60,7 @@ export const gridItemPropDefs: Record<string, PropDef> = {
export const gridUsageSnippet = `import { Grid } from '@backstage/ui';
<Grid />`;
<Grid.Root />`;
export const gridDefaultSnippet = `<Grid.Root>
<DecorativeBox />
@@ -68,44 +68,44 @@ export const gridDefaultSnippet = `<Grid.Root>
<DecorativeBox />
</Grid.Root>`;
export const gridSimpleSnippet = `<Grid columns={3} gap="md">
export const gridSimpleSnippet = `<Grid.Root columns="3" gap="md">
<Box>Hello World</Box>
<Box>Hello World</Box>
<Box>Hello World</Box>
</Grid>`;
</Grid.Root>`;
export const gridComplexSnippet = `<Grid columns={3} gap="md">
<Grid.Item colSpan={1}>
<Box>Hello World</Box>
export const gridComplexSnippet = `<Grid.Root columns="3" gap="md">
<Grid.Item colSpan="1">
Hello World
</Grid.Item>
<Grid.Item colSpan={2}>
<Box>Hello World</Box>
<Grid.Item colSpan="2">
Hello World
</Grid.Item>
</Grid>`;
</Grid.Root>`;
export const gridMixingRowsSnippet = `<Grid columns={3} gap="md">
<Grid.Item colSpan={1} rowSpan={2}>
<Box>Hello World</Box>
export const gridMixingRowsSnippet = `<Grid.Root columns="3" gap="md">
<Grid.Item colSpan="1" rowSpan="2">
Hello World
</Grid.Item>
<Grid.Item colSpan={2}>
<Box>Hello World</Box>
<Grid.Item colSpan="2">
Hello World
</Grid.Item>
<Grid.Item colSpan={2}>
<Box>Hello World</Box>
<Grid.Item colSpan="2">
Hello World
</Grid.Item>
</Grid>`;
</Grid.Root>`;
export const gridResponsiveSnippet = `<Grid columns={{ xs: 1, md: 3 }} gap={{ xs: 'xs', md: 'md' }}>
export const gridResponsiveSnippet = `<Grid.Root columns={{ xs: 1, md: 3 }} gap={{ xs: 'xs', md: 'md' }}>
<Grid.Item colSpan={{ xs: 1, md: 2 }}>
<Box>Hello World</Box>
<Hello World
</Grid.Item>
<Grid.Item colSpan={{ xs: 1, md: 1 }}>
<Box>Hello World</Box>
Hello World
</Grid.Item>
</Grid>`;
</Grid.Root>`;
export const gridStartEndSnippet = `<Grid columns={3} gap="md">
<Grid.Item start={2} end={4}>
<Box>Hello World</Box>
export const gridStartEndSnippet = `<Grid.Root columns="3" gap="md">
<Grid.Item colStart="2" colEnd="4">
Hello World
</Grid.Item>
</Grid>`;
</Grid.Root>`;
@@ -212,6 +212,11 @@ export const cellPropDefs: Record<string, PropDef> = {
description:
"A string representation of the cell's contents, used for features like typeahead.",
},
leadingIcon: {
type: 'enum',
values: ['ReactNode'],
description: 'Optional icon to display before the cell content.',
},
...classNamePropDefs,
...stylePropDefs,
};
Binary file not shown.

After

Width:  |  Height:  |  Size: 163 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 216 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 138 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 231 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 242 KiB

+111 -1
View File
@@ -414,9 +414,13 @@ Each entry has one or more of the following fields:
## Adding custom or logic for validation and issuing of tokens
The `pluginTokenHandlerDecoratorServiceRef` can be used to decorate the existing token handler without having to re-implement the entire `AuthService` implementation.
The `pluginTokenHandlerDecoratorServiceRef` and `externalTokenHandlersServiceRef` can be used to extend the existing token handler without having to re-implement the entire `AuthService` implementation.
This is particularly useful when you want to add additional logic to the handler, such as logging or metrics or custom token validation.
### PluginTokenHandler decoration
The `pluginTokenHandlerDecoratorServiceRef` can be used to decorate the default PluginTokenHandler used for create and verify tokens from plugins.
The `PluginTokenHandler` interface has two methods:
- `issueToken`: This method is used to issue a token for a plugin. It takes in the `pluginId` and `targetPluginId` as arguments, and an optional `limitedUserToken` object which can be used to issue a token on behalf of another user. The method returns a promise that resolves to an object containing the issued token.
@@ -439,3 +443,109 @@ const decoratedPluginTokenHandler = createServiceFactory({
},
});
```
### Adding custom ExternalTokenHandler
The `externalTokenHandlersServiceRef` can be used to add custom external token handlers to the default implementation.
Your service factory must return an object with a `type` property that matches the token type in your configuration (e.g., 'custom', 'api-key'). When Backstage encounters tokens of this type, it calls your `initialize` method with all the configuration entries that match this type. Your factory can return either a single token handler or an array of handlers to process and validate these tokens.
:::note Note
During token verification, all the token handlers are tested. Consider this when adding many token handlers, as it may impact performance.
:::
For example, if we want to add a custom external token handler for the `custom` type:
our config would look like this:
```yaml title="in e.g. app-config.production.yaml"
backend:
auth:
externalAccess:
- type: custom
options:
customOptions: additional-value
accessRestrictions:
- plugin: events
- type: custom
options:
customOptions: another-value
accessRestrictions:
- plugin: events
```
And we can implement the custom token handler like this:
```ts
import {
ExternalTokenHandler,
externalTokenHandlersServiceRef,
createExternalTokenHandler,
} from '@backstage/backend-defaults/auth';
import { createServiceFactory } from '@backstage/backend-plugin-api';
const customExternalTokenHandlers = createServiceFactory({
service: externalTokenHandlersServiceRef,
deps: {},
async factory() {
return createExternalTokenHandler({
type: 'custom',
initialize({ options }) {
// Initialize your handler context from config
const customOptions = options.getString('customOptions');
return { customOptions };
},
async verifyToken(token, context) {
// Your custom token validation logic here
// Return undefined if token is invalid
// Return { subject: 'your-subject' } if token is valid
if (token === 'valid-token') {
return { subject: `custom:${context.customOptions}` };
}
return undefined;
},
});
},
});
```
The `createExternalTokenHandler` helper simplifies creating external token handlers with the new API:
- **`type`**: A string identifier for your token handler type that matches the config
- **`initialize`**: Called once for each config entry of this type, receives the config options and returns a context object that will be passed to `verifyToken`
- **`verifyToken`**: Called for each token verification with the token and context, returns the subject if valid or `undefined` if not
```ts
// Example of a more complex handler with external API call
const apiTokenHandler = createExternalTokenHandler({
type: 'api-validation',
initialize({ options }) {
const apiBaseUrl = options.getString('apiBaseUrl');
const apiKey = options.getString('apiKey');
return { apiBaseUrl, apiKey };
},
async verifyToken(token, { apiBaseUrl, apiKey }) {
try {
const response = await fetch(`${apiBaseUrl}/validate-token`, {
method: 'POST',
headers: {
Authorization: `Bearer ${apiKey}`,
'Content-Type': 'application/json',
},
body: JSON.stringify({ token }),
});
if (response.ok) {
const { userId } = await response.json();
return { subject: `api:${userId}` };
}
} catch (error) {
// Log error but don't throw - return undefined for invalid tokens
}
return undefined;
},
});
```
@@ -223,6 +223,35 @@ export const customFooServiceFactory = createServiceFactory({
This allows you to provide more advanced options for the service implementation that couldn't be expressed through static configuration. It also gives users of the service implementation access to other services through dependency injection, which can be useful for their customizations.
## Multiton
By default the service reference will point to a singleton instance of the service. This mean if a new service factory uses this reference it will override the previous one. This is the most common use-case, but in some cases you may want to have multiple instances of the same service.
For some services, it is desirable to extend the functionality instead of overriding it. For example, some services could have many handlers to address specific events, and you may want to add a new handler instead of overriding the previous one. In this case, you can use the `multiton` option when creating the service reference:
```ts
// example-service-ref.ts
import { createServiceRef } from '@backstage/backend-plugin-api';
export interface FooService {
foo(options: FooOptions): Promise<FooResult>;
}
export const fooServiceRef = createServiceRef<FooService>({
id: 'example.foo',
multiton: true, // this service ref will be an array of instances
});
```
When adding this `serviceRef` as a dependency to a factory, the factory will receive an array of instances instead of a single instance:
```ts
deps: {fooServices: fooServiceRef},
factory(fooServices) {
// fooServices is an array of instances
return new Bar(fooServices);
},
```
## Service Factory Options Pattern
:::note Note
@@ -211,7 +211,7 @@ argument of `createBackend`.
## Removing `@backstage/backend-common`
The `@backstage/backend-common` package has been deprecated as part of moving to the new backend system, an you will need to replace existing usage of it. All exports from the package have been marked as deprecated in the last few releases of the package, and each export has its own deprecation message that explains how to replace that particular export.
The `@backstage/backend-common` package has been deprecated as part of moving to the new backend system, and you will need to replace existing usage of it. All exports from the package have been marked as deprecated in the last few releases of the package, and each export has its own deprecation message that explains how to replace that particular export.
These are the deprecation messages for the most common replacements:
@@ -134,7 +134,13 @@ import {
createAuthIntegrationRouter,
createRateLimitMiddleware,
} from '@backstage/backend-defaults/httpRouter';
import { createServiceFactory } from '@backstage/backend-plugin-api';
import PromiseRouter from 'express-promise-router';
import { Handler } from 'express';
import {
createServiceFactory,
coreServices,
HttpRouterServiceAuthPolicy,
} from '@backstage/backend-plugin-api';
const backend = createBackend();
@@ -65,6 +65,20 @@ backend:
# - A standard ISO formatted duration string, e.g. 'P2DT6H' or 'PT1M'.
# - An object with individual units (in plural) as keys, e.g. `{ days: 2, hours: 6 }`.
serverShutdownDelay: { seconds: 20 }
server:
# (Optional) HTTP server configuration, Node.js defaults apply otherwise
# Timeout values support multiple formats:
# - Numbers (milliseconds): 30000
# - Duration strings: '30s', '1 minute', '2 hours'
# - ISO duration strings: 'PT30S', 'PT1M', 'PT2H'
# - Duration objects: { seconds: 30 }, { minutes: 1 }, { hours: 2 }
headersTimeout: 60000
requestTimeout: '30s'
keepAliveTimeout: { seconds: 5 }
timeout: 'PT30S'
# Numeric-only settings
maxHeadersCount: 2000
maxRequestsPerSocket: 100
```
### Via Code
@@ -90,6 +90,35 @@ also write a _custom processor_ to convert between the existing system and
Backstage's descriptor format. This is documented in
[External Integrations](external-integrations.md).
### Processor configuration
You can configure processors under the `catalog.processorOptions` key. You can define
options for each processor by its name. With the processor options you can disable
a processor or set its priority.
```yaml
catalog:
processorOptions:
processorName:
disabled: false # Defaults to false
priority: 100
```
The priority is a number defining the order in which processors are executed. The lower the number,
the higher the priority. The default priority is `20`.
## Provider configuration
It's possible to also disable entity providers using the config. You can configure providers
under the `catalog.providerOptions` key. The key is the provider name.
```yaml
catalog:
providerOptions:
providerName:
disabled: true
```
## Catalog Rules
By default, the catalog will only allow the ingestion of entities with the kind
+2 -2
View File
@@ -1,11 +1,11 @@
---
id: addons
id: addons--new
title: TechDocs Addons
description: How to find, use, or create TechDocs Addons.
---
:::info
This documentation is written for [the new frontend system](../../frontend-system/index.md) which is still in alpha and is only supported by a small number of plugins.
This documentation is written for [the new frontend system](../../frontend-system/index.md) which is still in alpha and is only supported by a small number of plugins. If you are on the [old frontend system](./getting-started.md#adding-techdocs-frontend-plugin) you may want to read [its own article](./addons.md) instead.
:::
## Concepts
+2 -2
View File
@@ -27,7 +27,7 @@ yarn --cwd packages/backend add @backstage/plugin-catalog-backend-module-gitlab
Then add the following to your backend initialization:
```ts title="packages/backend/src/index.ts
```ts title="packages/backend/src/index.ts"
// optional if you want HTTP endpoints to receive external events
// backend.add(import('@backstage/plugin-events-backend'));
// optional if you want to use AWS SQS instead of HTTP endpoints to receive external events
@@ -49,7 +49,7 @@ Further documentation:
- [Events Plugin](https://github.com/backstage/backstage/tree/master/plugins/events-backend/README.md)
- [GitLab Module for the Events Plugin](https://github.com/backstage/backstage/blob/master/plugins/events-backend-module-gitlab/README.md)
### Installation with Legacy Backend System
### Installation with Legacy Backend System (skip if you are using Backstage v1.31.0 or later)
#### Installation without Events Support
+1
View File
@@ -148,6 +148,7 @@ notifications:
- token: xoxb-XXXXXXXXX
broadcastChannels: # Optional, if you wish to support broadcast notifications.
- C12345678
username: 'Backstage Bot' # Optional, defaults to the name of the Slack App.
```
Multiple instances can be added in the `slack` array, allowing you to have multiple configurations if you need to send
+142 -222
View File
@@ -10,285 +10,232 @@ Backstage is organized into three main components, each catering to different gr
- Core - This includes the base functionality developed by core developers within the open-source project.
- App - The app represents a deployed instance of a Backstage application, customized and maintained by app developers, typically a productivity team within an organization. It integrates core functionalities with additional plugins.
- Plugins - These provide additional functionalities to enhance the usefulness of your Backstage app. Plugins can be company-specific or open-sourced and reusable. At Spotify, we have over 100 plugins created by more than 50 different teams, significantly enriching the unified developer experience by incorporating contributions from various infrastructure teams.
- Plugins - These provide additional functionalities to enhance the usefulness of your Backstage app. Plugins can be company-specific or open-sourced and reusable.
## Overview
The following diagram shows how Backstage might look when deployed inside a
company which uses the Tech Radar plugin, the Lighthouse plugin, the CircleCI
plugin and the software catalog.
The following diagram shows a high level view of the overall architecture of Backstage. Running this architecture in a real environment typically involves
containerizing the components. Various commands are provided for accomplishing this.
There are 3 main components in this architecture:
1. The core Backstage UI
2. The UI plugins and their backing services
3. Databases
- The [frontend](#frontend-building-blocks) includes the core Backstage [UI](#user-interface) which is an [extension](#extensions) that interacts directly with the user to present the information from the integrated core feature plugins, and other plugins added by a user.
- The [backend](#backend-building-blocks) includes the backend plugins, [core services](https://backstage.io/docs/backend-system/core-services/index), and other services. This is the server-side part of Backstage that is responsible for wiring things together. You can deploy more than one backend, and more than one backend container, depending on your need to scale and isolate individual features.
- Databases host your Backstage data.
Running this architecture in a real environment typically involves
containerizing the components. Various commands are provided for accomplishing
this.
![The architecture of a basic Backstage application](../assets/architecture-overview/backstage-front-back-arch.jpeg)
![The architecture of a basic Backstage application](../assets/architecture-overview/backstage-typical-architecture.png)
## Frontend building blocks
## User Interface
The architectural diagram provides an overview of the different building blocks and the other blocks that each of them interacts with.
The UI is a thin, client-side wrapper around a set of plugins. It provides some
core UI components and libraries for shared activities such as config
management. [[live demo](https://demo.backstage.io/catalog)]
### App
This is the app instance itself that you create and use as the root of your Backstage frontend application. It does not have any direct functionality in and of itself, but is simply responsible for wiring things together.
### Extensions
[Extensions](../frontend-system/architecture/20-extensions.md) are the building blocks that build out both the visual and non-visual structure of the application. There are both built-in extensions provided by the app itself as well as extensions provided by plugins. Each extension is attached to a parent with which it shares data and can have any number of children of its own. It is up to the app to wire together all extensions into a single tree known as the app extension tree. It is from this structure that the entire app can then be instantiated and rendered.
#### User Interface
The UI is one of the extensions in the frontend. It is a thin, client-side wrapper around a set of plugins. It provides some core UI components and libraries for shared activities such as config management. [[live demo](https://demo.backstage.io/catalog)]
![UI with different components highlighted](../assets/architecture-overview/core-vs-plugin-components-highlighted.png)
Each plugin typically makes itself available in the UI on a dedicated URL. For
example, the Lighthouse plugin is registered with the UI on `/lighthouse`.
[[learn more](https://backstage.io/blog/2020/04/06/lighthouse-plugin)]
Each plugin typically makes itself available in the UI on a dedicated URL. For example, the Service Catalog plugin is registered with the UI on `/catalog`.
![The lighthouse plugin UI](../assets/architecture-overview/lighthouse-plugin.png)
### Frontend plugins
The CircleCI plugin is available on `/circleci`.
Plugins provide the actual features inside an app. The size of a plugin can range from a tiny component to an entire new system in which other plugins can be composed and integrated. Plugins can be completely standalone or built on top of each other to extend existing plugins and augment their features. Plugins can communicate with each other by composing their extensions or by sharing Utility APIs and routes.
![CircleCI Plugin UI](../assets/architecture-overview/circle-ci.png)
Backstage includes the following set of core plugins:
## Plugins and plugin backends
- [Software Catalog](../features/software-catalog/index.md) - A centralized system that contains metadata for all your software, such as services, websites, libraries, ML models, data pipelines, and so on. It can also contain metadata for the physical or virtual infrastructure needed to operate a piece of software. The software catalog can be viewed and searched through a UI.
- [Software Templates](../features/software-templates/index.md) - A tool to help you create components inside Backstage. A template can load skeletons of code, include some variables, and then publish the template to a location, such as GitHub.
- [TechDocs](https://backstage.io/docs/features/techdocs/) - A docs-like-code solution built into Backstage. Documentation is written in Markdown files which lives together with the code.
- [Kubernetes](../features/kubernetes/index.md) - A tool that allows developers to check the health of their services whether it is on a local host or in production.
- [Search](https://backstage.io/docs/features/search/) - Search for information in the Backstage ecosystem. You can customize the look and feel of each search result and use your own search engine.
Each plugin is a client side application which mounts itself on the UI. Plugins
are written in TypeScript or JavaScript. They each live in their own directory
in the `plugins` folder. For example, the source code for the catalog plugin
is available at
[plugins/catalog](https://github.com/backstage/backstage/tree/master/plugins/catalog).
[Plugin architecture](#plugin-architecture) provides greater detail about the architecture of the plugins themselves.
### Installing plugins
### Extension Overrides
Plugins are typically installed as React components in your Backstage
application. For example,
[here](https://github.com/backstage/backstage/blob/master/packages/app/src/App.tsx)
is a file that imports many full-page plugins in the Backstage sample app.
In addition to the built-in extensions and extensions provided by plugins, it is also possible to install [extension overrides](../frontend-system/architecture/25-extension-overrides.md). This is a collection of extensions with high priority that can replace existing extensions. They can for example be used to override an individual extension provided by a plugin, or install a completely new extension, such as a new app theme.
An example of one of these plugin components is the `CatalogIndexPage`, which is
a full-page view that allows you to browse entities in the Backstage catalog. It
is installed in the app by importing it and adding it as an element like this:
### Utility APIs
```tsx
import { CatalogIndexPage } from '@backstage/plugin-catalog';
[Utility APIs](../api/utility-apis.md) provide functionality that makes it easier to build plugins, make it possible for plugins to share functionality with other plugins, as well as serve as a customization point for integrators to change the behaviour of the app. Each Utility API is defined by a TypeScript interface as well as a reference used to access the implementations. The implementations of Utility APIs are defined by extensions that are provided and can be overridden the same as any other extension.
...
### Routes
const routes = (
<FlatRoutes>
...
<Route path="/catalog" element={<CatalogIndexPage />} />
...
</FlatRoutes>
);
```
The [Backstage routing system](../frontend-system/architecture/36-routes.md) adds a layer of indirection that makes it possible for plugins to route to each other's extensions without explicit knowledge of what URL paths the extensions are rendered at or if they even exist at all. It makes it possible for plugins to share routes with each other and dynamically generate concrete links at runtime. It is the responsibility of the app to resolve these links to actual URLs, but it is also possible for integrators to define their own route bindings that decide how the links should be resolved. The routing system also lets plugins define internal routes, aiding in the linking to different content in the same plugin.
Note that we use `"/catalog"` as our path to this plugin page, but we can choose
any route we want for the page, as long as it doesn't collide with the routes
that we choose for the other plugins in the app.
## Backend building blocks
These components that are exported from plugins are referred to as "Plugin
Extension Components", or "Extension Components". They are regular React
components, but in addition to being able to be rendered by React, they also
contain various pieces of metadata that is used to wire together the entire app.
Extension components are created using `create*Extension` methods, which you can
read more about in the
[composability documentation](../plugins/composability.md).
The architectural diagram provides an overview of the different building blocks, and the other blocks that each of them interact with.
As of this moment, there is no config based install procedure for plugins. Some
code changes are required.
### Backend
### Plugin architecture
This is the [backend instance](../backend-system/architecture/02-backends.md) itself, which you can think of as the unit of deployment. It does not have any functionality in and of itself, but is simply responsible for wiring things together.
It is up to you to decide how many different backends you want to deploy. You can have all features in a single one, or split things out into multiple smaller deployments, depending on your need to scale and isolate individual features.
### Backend plugins
[Plugins](../backend-system/architecture/04-plugins.md) provide the actual features. They operate completely independently of each other. If plugins want to communicate with each other, they must do so over the wire. There can be no direct communication between plugins through code. Because of this constraint, each plugin can be considered to be its own microservice.
[Plugin architecture](#plugin-architecture) provides greater detail about the architecture of the plugins themselves.
### Services
[Services](../backend-system/architecture/03-services.md) provide utilities to help make it simpler to implement plugins, so that each plugin doesn't need to implement everything from scratch. There are many built-in core services, such as the ones for logging, database access, and reading configuration, but you can also import third-party services, or create your own.
Services are also a customization point for individual backend installations. You can override services with your own implementations, as well as make smaller customizations to existing services.
### Extension Points
Many plugins have ways in which you can extend them, for example entity providers for the Catalog, or custom actions for the Scaffolder. These extension patterns are now encoded into Extension Points.
[Extension Points](../backend-system/architecture/05-extension-points.md) look a little bit like services, since you depend on them just like you would a service. A key difference is that extension points are registered and provided by plugins or modules themselves, based on what customizations each of them want to expose.
Extension Points are exported separately from the plugin or module instance itself, and it is possible to expose multiple different extension points at once. This makes it easier to evolve and deprecate individual Extension Points over time, rather than dealing with a single large API surface.
### Modules
[Modules](../backend-system/architecture/06-modules.md) use Extension Points to add new features to other plugins or modules. They might for example add an individual Catalog Entity Provider, or one or more Scaffolder Actions.
Each module may only use Extension Points that belong to a single plugin, and the module must be deployed together with that plugin in the same backend instance. Modules may only communicate with their plugin or other modules through the registered extension points.
Just like plugins, modules also have access to services and can depend on their own service implementations. They will however share services with the plugin that they extend - there are no module-specific service implementations.
## Databases
The databases host your Backstage data. The Backstage backend and its built-in plugins are based on the [Knex](http://knexjs.org/) library, and set up a separate logical database per plugin. This gives great isolation and lets them perform migrations and evolve separately from each other.
The Knex library supports a multitude of databases, but Backstage at this time of writing is tested primarily against two of them:
- SQLite, which is mainly used as an in-memory mock/test database
- PostgreSQL, which is the preferred production database.
Other databases such as the MySQL variants are reported to work but [aren't fully tested](https://github.com/backstage/backstage/issues/2460) yet.
You can find instructions on setting up a PostgreSQL for your Backstage instance in [Database](../getting-started/config/database.md). [Configuring Plugin Databases](../tutorials/configuring-plugin-databases.md) provides information on how to configure a database for a plugin.
## Plugin architecture
Architecturally, plugins can take three forms:
1. Standalone
2. Service backed
3. Third-party backed
- [Standalone](#standalone-plugins)
- [Service backend](#service-backend-plugins)
- [Third-party backend](#third-party-backend-plugins)
#### Standalone plugins
### Standalone plugins
Standalone plugins run entirely in the browser.
[The Tech Radar plugin](https://demo.backstage.io/tech-radar), for example,
simply renders hard-coded information. It doesn't make any API requests to other
services.
Standalone plugins run entirely in the browser. [The Tech Radar plugin](https://demo.backstage.io/tech-radar), for example, simply renders hard-coded information. It doesn't make any API requests to other services.
The architecture of the Tech Radar installed into a Backstage app is very simple. You just need to add Tech Radar as a frontend plugin into your app, as shown in the following diagram.
> **NOTE:**
> The following diagram does not show the detailed contents of the frontend and backend containers in order to highlight the changes that pertain to the addition of the specified plugin.
![ui and tech radar plugin connected together](../assets/architecture-overview/simplified-standalone-plugin-architecture.jpeg)
Once the plugin has been added, then you can view the Tech Radar information in the Backstage UI.
![tech radar plugin ui](../assets/architecture-overview/tech-radar-plugin.png)
The architecture of the Tech Radar installed into a Backstage app is very
simple.
### Service backend plugins
![ui and tech radar plugin connected together](../assets/architecture-overview/tech-radar-plugin-architecture.png)
Service backend plugins make API requests to a service which is within the purview of the organization running Backstage.
#### Service backed plugins
The Lighthouse plugin, for example, makes requests to the [lighthouse-audit-service](https://github.com/spotify/lighthouse-audit-service). The `lighthouse-audit-service` is a microservice which runs a copy of Google's [Lighthouse library](https://github.com/GoogleChrome/lighthouse/) and stores the results in a PostgreSQL database.
Service backed plugins make API requests to a service which is within the
purview of the organisation running Backstage.
The Lighthouse plugin is added to the frontend. The lighthouse-audit-service container is already publicly available in Docker Hub and can be downloaded and run with
The Lighthouse plugin, for example, makes requests to the
[lighthouse-audit-service](https://github.com/spotify/lighthouse-audit-service).
The `lighthouse-audit-service` is a microservice which runs a copy of Google's
[Lighthouse library](https://github.com/GoogleChrome/lighthouse/) and stores the
results in a PostgreSQL database.
```bash
docker run spotify/lighthouse-audit-service:latest
```
Its architecture looks like this:
> **NOTE:**
> The following diagram does not show the detailed contents of the frontend and backend, in order to highlight the changes that pertain to the addition of the specified plugin.
![lighthouse plugin backed to microservice and database](../assets/architecture-overview/lighthouse-plugin-architecture.png)
![lighthouse plugin backend to microservice and database](../assets/architecture-overview/simplified-service-based-plugin-architecture.jpeg)
The software catalog in Backstage is another example of a service backed plugin.
It retrieves a list of services, or "entities", from the Backstage Backend
service and renders them in a table for the user.
The software catalog in Backstage is another example of a service backend plugin. It retrieves a list of services, or "entities", from the Backstage Backend service and renders them in a table for the user.
### Third-party backed plugins
### Third-party backend plugins
Third-party backed plugins are similar to service backed plugins. The main
difference is that the service which backs the plugin is hosted outside of the
ecosystem of the company hosting Backstage.
Third-party backend plugins are similar to service backend plugins. The main difference is that the service which backs the plugin is hosted outside of the ecosystem of the company hosting Backstage.
The CircleCI plugin is an example of a third-party backed plugin. CircleCI is a
SaaS service which can be used without any knowledge of Backstage. It has an API
which a Backstage plugin consumes to display content.
The CircleCI plugin is an example of a third-party backend plugin. CircleCI is a SaaS service which can be used without any knowledge of Backstage. It has an API which a Backstage plugin consumes to display content.
Requests going to CircleCI from the user's browser are passed through a proxy
service that Backstage provides. Without this, the requests would be blocked by
Cross Origin Resource Sharing policies which prevent a browser page served at
[https://example.com](https://example.com) from serving resources hosted at
https://circleci.com.
Requests going to CircleCI from the user's browser are passed through a proxy service that Backstage provides. Without this, the requests would be blocked by Cross Origin Resource Sharing policies which prevent a browser page served at [https://example.com](https://example.com) from serving resources hosted at https://circleci.com.
![CircleCI plugin talking to proxy talking to SaaS Circle CI](../assets/architecture-overview/circle-ci-plugin-architecture.png)
> **NOTE:**
> The following diagram does not show the detailed contents of the frontend and backend, in order to highlight the changes that pertain to the addition of the specified plugin.
![CircleCI plugin talking to proxy talking to SaaS Circle CI](../assets/architecture-overview/simplified-third-party-plugin-architecture.jpeg)
## Package Architecture
Backstage relies heavily on NPM packages, both for distribution of libraries,
and structuring of code within projects. While the way you structure your
Backstage project is up to you, there is a set of established patterns that we
encourage you to follow. These patterns can help set up a sound project
structure as well as provide familiarity between different Backstage projects.
Backstage relies heavily on NPM packages, both for distribution of libraries, and structuring of code within projects. While the way you structure your Backstage project is up to you, there is a set of established patterns that we encourage you to follow. These patterns can help set up a sound project structure as well as provide familiarity between different Backstage projects.
The following diagram shows an overview of the package architecture of
Backstage. It takes the point of view of an individual plugin and all of the
packages that it may contain, indicated by the thicker border and italic text.
Surrounding the plugin are different package groups which are the different
possible interface points of the plugin. Note that not all library package lists
are complete as packages have been omitted for brevity.
The following diagram shows an overview of the package architecture of Backstage. It takes the point of view of an individual plugin and all of the packages that it may contain, indicated by the thicker border and italic text. Surrounding the plugin are different package groups which are the different possible interface points of the plugin. Note that not all library package lists are complete as packages have been omitted for brevity.
![Package architecture](../assets/architecture-overview/package-architecture.drawio.svg)
### Overview
The arrows in the diagram above indicate a runtime dependency on the code of the
target package. This strict dependency graph only applies to runtime
`dependencies`, and there may be `devDependencies` that break the rules of this
table for the purpose of testing. While there are some arrows that show a
dependency on a collection of frontend, backend and isomorphic packages, those
still have to abide by important compatibility rules shown in the bottom left.
The arrows in the diagram above indicate a runtime dependency on the code of the target package. This strict dependency graph only applies to runtime
`dependencies`, and there may be `devDependencies` that break the rules of this table for the purpose of testing. While there are some arrows that show a dependency on a collection of frontend, backend and isomorphic packages, those still have to abide by important compatibility rules shown in the bottom left.
The `app` and `backend` packages are the entry points of a Backstage project.
The `app` package is the frontend application that brings together a collection
of frontend plugins and customizes them to fit an organization, while the
`backend` package is the backend service that powers the Backstage application.
Worth noting is that there can be more than one instance of each of these
packages within a project. Particularly the `backend` packages can benefit from
being split up into smaller deployment units that each serve their own purpose
with a smaller collection of plugins.
The `app` and `backend` packages are the entry points of a Backstage project. The `app` package is the frontend application that brings together a collection of frontend plugins and customizes them to fit an organization, while the `backend` package is the backend service that powers the Backstage application. Worth noting is that there can be more than one instance of each of these packages within a project. Particularly the `backend` packages can benefit from being split up into smaller deployment units that each serve their own purpose with a smaller collection of plugins.
### Plugin Packages
A typical plugin consists of up to five packages, two frontend ones, two
backend, and one isomorphic package. All packages within the plugin must share a
common prefix, typically of the form `@<scope>/plugin-<plugin-id>`, but
alternatives like `backstage-plugin-<plugin-id>` or
`@<scope>/backstage-plugin-<plugin-id>` are also valid. Along with this prefix,
each of the packages have their own unique suffix that denotes their role. In
addition to these five plugin packages it's also possible for a plugin to have
additional frontend and backend modules that can be installed to enable optional
features. For a full list of suffixes and their roles, see the
[Plugin Package Structure ADR](../architecture-decisions/adr011-plugin-package-structure.md).
A typical plugin consists of up to five packages, two frontend ones, two backend, and one isomorphic package. All packages within the plugin must share a common prefix, typically of the form `@<scope>/plugin-<plugin-id>`, but alternatives like `backstage-plugin-<plugin-id>` or `@<scope>/backstage-plugin-<plugin-id>` are also valid. Along with this prefix, each of the packages have their own unique suffix that denotes their role. In addition to these five plugin packages it's also possible for a plugin to have
additional frontend and backend modules that can be installed to enable optional features. For a full list of suffixes and their roles, see the [Plugin Package Structure ADR](../architecture-decisions/adr011-plugin-package-structure.md).
The `-react`, `-common`, and `-node` plugin packages together form the external
library of a plugin. The plugin library enables other plugins to build on top of
and extend a plugin, and likewise allows the plugin to depend on and extend
other plugins. Because of this, it is preferable that plugin library packages
allow duplicate installations of themselves, as you may end up with a mix of
versions being installed as dependencies of various plugins. It is also
forbidden for plugins to directly import non-library packages from other
plugins, all communication between plugins must be handled through libraries and
the application itself.
The `-react`, `-common`, and `-node` plugin packages together form the external library of a plugin. The plugin library enables other plugins to build on top of and extend a plugin, and likewise allows the plugin to depend on and extend other plugins. Because of this, it is preferable that plugin library packages allow duplicate installations of themselves, as you may end up with a mix of versions being installed as dependencies of various plugins. It is also forbidden for plugins to directly import non-library packages from other plugins, all communication between plugins must be handled through libraries and the application itself.
### Frontend Packages
The frontend packages are grouped into two main groups. The first one is
"Frontend App Core", which is the set of packages that are only used by the
`app` package itself. These packages help build up the core structure of the app
as well as provide a foundation for the plugin libraries to rely upon.
The frontend packages are grouped into two main groups. The first one is "Frontend App Core", which is the set of packages that are only used by the `app` package itself. These packages help build up the core structure of the app as well as provide a foundation for the plugin libraries to rely upon.
The second group is the rest of the shared packages, further divided into
"Frontend Plugin Core" and "Frontend Libraries". The core packages are
considered particularly stable and form the core of the frontend framework.
Their most important role is to form the boundary around each plugin and provide
a set of tools that helps you combine a collection of plugins into a running
application. The rest of the frontend packages are more traditional libraries
that serve as building blocks to create plugins.
The second group is the rest of the shared packages, further divided into "Frontend Plugin Core" and "Frontend Libraries". The core packages are considered particularly stable and form the core of the frontend framework. Their most important role is to form the boundary around each plugin and provide a set of tools that helps you combine a collection of plugins into a running application. The rest of the frontend packages are more traditional libraries that serve as building blocks to create plugins.
### Backend Packages
The backend library packages do not currently share a similar plugin
architecture as the frontend packages. They are instead simply a collection of
building blocks and patterns that help you build backend services. This is
however likely to change in the future.
The backend library packages do not currently share a similar plugin architecture as the frontend packages. They are instead simply a collection of building blocks and patterns that help you build backend services. This is however likely to change in the future.
### Common Packages
The common packages are the packages effectively depended on by all other pages.
This is a much smaller set of packages but they are also very pervasive. Because
the common packages are isomorphic and must execute both in the frontend and
backend, they are never allowed to depend on any of the frontend or backend
packages.
The common packages are the packages effectively depended on by all other pages. This is a much smaller set of packages but they are also very pervasive. Because the common packages are isomorphic and must execute both in the frontend and backend, they are never allowed to depend on any of the frontend or backend packages.
The Backstage CLI is in a category of its own and is depended on by virtually
all other packages. It's not a library in itself though, and must always be a
development dependency only.
The Backstage CLI is in a category of its own and is depended on by virtually all other packages. It's not a library in itself though, and must always be a development dependency only.
### Deciding where you place your code
It can sometimes be difficult to decide where to place your plugin code. For example
should it go directly in the `-backend` plugin package or in the `-node` package?
As a general guideline you should try to keep the exposure of your code as low
as possible. If it doesn't need to be public API, it's best to avoid. If you don't
need it to be used by other plugins, then keep it directly in the plugin packages.
It can sometimes be difficult to decide where to place your plugin code. For example, should it go directly in the `-backend` plugin package or in the `-node` package? As a general guideline you should try to keep the exposure of your code as low as possible. If it doesn't need to be public API, it's best to avoid. If you don't need it to be used by other plugins, then keep it directly in the plugin packages.
Below is a chart to help you decide where to place your code.
![Package decision](../assets/architecture-overview/package-decision.drawio.svg)
## Databases
As we have seen, both the `lighthouse-audit-service` and `catalog-backend`
require a database to work with.
The Backstage backend and its built-in plugins are based on the
[Knex](http://knexjs.org/) library, and set up a separate logical database per
plugin. This gives great isolation and lets them perform migrations and evolve
separately from each other.
The Knex library supports a multitude of databases, but Backstage at this time
of writing is tested primarily against two of them: SQLite, which is mainly used as
an in-memory mock/test database, and PostgreSQL, which is the preferred
production database. Other databases such as the MySQL variants are reported to
work but
[aren't fully tested](https://github.com/backstage/backstage/issues/2460)
yet.
## Cache
The Backstage backend and its built-in plugins are also able to leverage cache
stores as a means of improving performance or reliability. Similar to how
databases are supported, plugins receive logically separated cache connections,
which are powered by [Keyv](https://github.com/lukechilds/keyv) under the hood.
The Backstage backend and its built-in plugins are also able to leverage cache stores as a means of improving performance or reliability. Similar to how databases are supported, plugins receive logically separated cache connections, which are powered by [Keyv](https://github.com/lukechilds/keyv) under the hood.
At this time of writing, Backstage can be configured to use one of five cache
stores: memory, which is mainly used for local testing, memcache, redis, valkey or infinispan,
which are cache stores better suited for production deployment. The right cache
store for your Backstage instance will depend on your own run-time constraints
and those required of the plugins you're running.
At this time of writing, Backstage can be configured to use one of five cache stores:
- `memory`
- `memcache`
- `redis`
- `valkey`
- `infinispan`
`memory` is primarily used for local development, for production deployments, we recommend using one of the other cache stores. The right cache store for your Backstage instance will depend on your own run-time constraints and those required of the plugins you're running.
### Use memory for cache
@@ -351,30 +298,3 @@ backend:
```
Contributions supporting other cache stores are welcome!
## Containerization
The example Backstage architecture shown above would Dockerize into three
separate Docker images.
1. The frontend container
2. The backend container
3. The Lighthouse audit service container
![Boxes around the architecture to indicate how it is containerised](../assets/architecture-overview/containerised.png)
The backend container can be built by running the following command:
```bash
yarn run build
yarn run build-image
```
This will create a container called `example-backend`.
The lighthouse-audit-service container is already publicly available in Docker
Hub and can be downloaded and run with
```bash
docker run spotify/lighthouse-audit-service:latest
```
+88
View File
@@ -0,0 +1,88 @@
---
id: technical-overview
title: Technical overview
description: Technical overview of Backstage
---
## Purpose
Backstage is an open source framework for building developer portals that was created at Spotify to simplify end-to-end software development. As Spotify grew, their infrastructure became more fragmented and teams couldn't find the APIs they were supposed to use, or who owned a service, or documentation on anything.
Backstage is powered by a centralized [software catalog](#software-catalog-system-model) and utilizes an abstraction layer that sits on top of all of your infrastructure and developer tooling, allowing you to manage all of your software, services, tooling, and testing in one place.
Backstage uses a [plugin-architecture](#plugin-architecture-overview) which allows you customize the functionality of your Backstage application using a wide variety of available plugins or you can write your own. It also includes automated templates that your teams can use to create new microservices, helping to ensure consistency and adherence to your best practices. Backstage also provides the ability to create, maintain, and find the documentation for all of your software.
Backstage is now a [CNCF incubation project](https://backstage.io/blog/2022/03/16/backstage-turns-two#out-of-the-sandbox-and-into-incubation).
## Benefits
- For _engineering managers_, it allows you to maintain standards and best practices across the organization, and can help you manage your whole tech ecosystem, from migrations to test certification.
- For _end users_ (developers), it makes it fast and simple to build software components in a standardized way, and it provides a central place to manage all projects and documentation.
- For _platform engineers_, it enables extensibility and scalability by letting you easily integrate new tools and services (via plugins), as well as extending the functionality of existing ones.
- For _everyone_, it is a single, consistent experience that ties all of your infrastructure tooling, resources, standards, owners, contributors, and administrators together in one place.
If you have question or want support, please join our [Discord server](https://discord.gg/backstage-687207715902193673).
## Core Features
Backstage includes the following set of core features:
- [Authentication and Identity](../auth/index.md) - Sign-in and identification of users, and delegating access to third-party resources, using built-in authentication providers.
- [Kubernetes](../features/kubernetes/index.md) - A tool that allows developers to check the health of their services whether it is on a local host or in production.
- [Notifications](../notifications/index.md) - Provides a means for plugins and external services to send messages to either individual users or groups.
- [Permissions](../permissions/overview.md) - Ability to enforce rules concerning the type of access a user is given to specific data, APIs, or interface actions.
- [Search](https://backstage.io/docs/features/search/) - Search for information in the Backstage ecosystem. You can customize the look and feel of each search result and use your own search engine.
- [Software Catalog](../features/software-catalog/index.md) - A centralized system that contains metadata for all your software, such as services, websites, libraries, ML models, data pipelines, and so on. It can also contain metadata for the physical or virtual infrastructure needed to operate a piece of software. The software catalog can be viewed and searched through a UI.
- [Software Templates](../features/software-templates/index.md) - A tool to help you create components inside Backstage. A template can load skeletons of code, include some variables, and then publish the template to a location, such as GitHub.
- [TechDocs](https://backstage.io/docs/features/techdocs/) - A docs-like-code solution built into Backstage. Documentation is written in Markdown files which lives together with the code.
## Plugin Architecture Overview
Plugins are client side applications which mount themselves on the Backstage UI. They allow you to incorporate a wide variety of infrastructure and software development tools into your Backstage application. Backstage uses a [plugin-architecture](../overview/architecture-overview.md#plugin-architecture) to provide a consistent user experience, in a single UI, around all of your plugins.
The Backstage architecture supports three types of plugins:
- Standalone - runs entirely in a browser and it does not make any API requests to other services.
- Service backed - makes API requests to a service within the ecosystem of the organization running Backstage.
- Third-party backed - similar to service-backed, but the service backing the plugin is hosted outside of the ecosystem of the company hosting Backstage.
Many of the features available in Backstage are provided by plugins. For example, the Software Catalog is a service backed plugin. When you view the catalog, it retrieves a set of services ("[entities](#software-catalog-system-model)") from the Backstage Backend service and renders them in a table in the UI for you.
## Software Catalog System Model
The system model behind the software catalog is based on [_entities_](../references/glossary.md#entity) and it models two main types:
- Core Entities
- Organizational Entities
`Core Entities` include:
- `Components` - Individual pieces of software that can be tracked in source control and can implement APIs for other components to consume.
- `APIs` - Implemented by components and form the boundaries between different components. The API can be either public, restricted, or private.
- `Resources` - The physical or virtual infrastructure needed to operate a component.
![core entity relationships in the software model](../assets/software-catalog/software-model-core-entities.drawio.svg)
`Organizational Entities` include:
- `User` - A person, such as an employee, contractor, or similar.
- `Group` - An organizational entity, such as a team, business unit, and so on.
When you have a large catalogue of components, APIs, and resources, it can be difficult to understand how they work together. Ecosystem modeling allows you to organize a large catalog of core entities into:
- Systems - A collection of resources and components that cooperate to perform a function by exposing one or several public APIs. It hides the resources and private APIs between the components from the consumer.
- Domains - A collection of systems that share terminology, domain models, metrics, KPIs, business purpose, or documentation.
There are three additional items that can be part of the system model:
- `Location` - A marker that references other places to look for catalog data.
- `Type` - It has no set meaning. You can assign your own types and use them as desired.
- `Template` - Describes both the parameters that are rendered in the frontend part of the scaffolding wizard, and the steps that are executed when scaffolding that component.
The following diagram illustrates an example of ecosystem modeling, and provides sample relationships between a domain, system, core entities, and organization entities.
![ecosystem modeling example](../assets/software-catalog/software-model-entities.drawio.svg)
The following shows an example of viewing all of the components, APIs, and resources that are managed by your group after setting up the relationships to create a group organizational entity.
![sample ui showing group ownership](../assets/technical-overview/backstage-ui-group-ownership.png)
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
+6 -5
View File
@@ -177,11 +177,12 @@ Usage: backstage-cli package start [options]
Start a package for local development
Options:
--config <path> Config files to load instead of app-config.yaml (default: [])
--role <name> Run the command with an explicit package role
--check Enable type checking and linting if available
--inspect Enable debugger in Node.js environments
--inspect-brk Enable debugger in Node.js environments, breaking before code starts
--config <path> Config files to load instead of app-config.yaml (default: [])
--role <name> Run the command with an explicit package role
--check Enable type checking and linting if available
--inspect Enable debugger in Node.js environments
--inspect-brk Enable debugger in Node.js environments, breaking before code starts
--entrypoint <path> Entry directory path (uses index file) or entry file path (without extension). Defaults to "dev"
```
## package build
+10
View File
@@ -147,3 +147,13 @@ The `role` property in the template yaml file is used to determine what input wi
| `plugin-web-library` | `pluginId` | `plugins` | none |
| `plugin-node-library` | `pluginId` | `plugins` | none |
| `plugin-common-library` | `pluginId` | `plugins` | none |
## Dependency Versioning
The `yarn new` command automatically detects if the [Backstage Yarn plugin](https://github.com/backstage/backstage/tree/master/packages/yarn-plugin) is installed in your repository and adjusts dependency versioning accordingly.
When the Backstage Yarn plugin is installed (detected via `.yarnrc.yml`), `yarn new` will generate `backstage:^` ranges for all `@backstage/*` dependencies. This ensures that new packages use the same Backstage version as defined in your `backstage.json` file.
When the plugin is not installed, `yarn new` uses the standard npm version ranges (e.g., `^1.0.0`) for all dependencies, maintaining backward compatibility.
Regardless of plugin installation, `workspace:` ranges found in your `yarn.lock` file will always take precedence over both `backstage:^` and npm ranges. This ensures that packages within monorepos continue to use workspace linking when available.
+26
View File
@@ -96,6 +96,32 @@ This field can be generated by the `backstage-cli repo fix --publish` command. T
The presence of this field is checked by the `backstage-cli package prepack` command, which is used to prepare a package for publishing. You can read more about this requirement in the section on [metadata for published packages](#metadata-for-published-packages).
### `backstage.features`
This field declares where to find Backstage features exported from the package. It is a map of features export paths to their feature type, similar to the `exports` field.
```js title="Example usage of the backstage.features field"
{
"name": "@backstage/plugin-catalog",
"backstage": {
"features": {
"./alpha": "@backstage/FrontendPlugin"
}
}
}
```
This field is automatically generated by the `backstage-cli package prepack` command when publishing a package and therefore does not need to be committed to the repository.
If you are using your own tooling to publish a package, you need to populate this field manually, using the following feature types:
- `@backstage/BackendFeature`
- `@backstage/FrontendPlugin`
- `@backstage/FrontendModule`
- `@backstage/FrontendFeatureLoader`
You can read more about the feature types in the [backend system](../backend-system/architecture/01-index.md) and [frontend system](../frontend-system/architecture/00-index.md) documentation.
### `backstage.pluginPackages`
For any package that is part of a plugin, this field should be set to a list of all packages that are directly part of the same plugin. This includes frontend and backend plugin packages as well as related libraries, but not modules.
+4 -4
View File
@@ -23,7 +23,7 @@ You can interact with Knex running the commands below in the project root:
We want to check the migration status:
```sh
$ node_modules/.bin/knex migrate:status --connection "postgresql://$POSTGRES_USER:$POSTGRES_PASSWORD@$POSTGRES_HOST/backstage_plugin_app" --client pg --migrations-directory node_modules/@backstage/plugin-catalog-backend/migrations/
$ node_modules/.bin/knex migrate:status --connection "postgresql://$POSTGRES_USER:$POSTGRES_PASSWORD@$POSTGRES_HOST/backstage_plugin_catalog" --client pg --migrations-directory node_modules/@backstage/plugin-catalog-backend/migrations/
Using environment: production
Found 2 Completed Migration file/files.
20211229105307_init.js
@@ -34,7 +34,7 @@ No Pending Migration files Found.
Now lets rollback a specific migration called `20240113144027_assets-namespace.js`:
```sh
$ node_modules/.bin/knex migrate:down 20240113144027_assets-namespace.js --connection "postgresql://$POSTGRES_USER:$POSTGRES_PASSWORD@$POSTGRES_HOST/backstage_plugin_app" --client pg --migrations-directory node_modules/@backstage/plugin-catalog-backend/migrations/
$ node_modules/.bin/knex migrate:down 20240113144027_assets-namespace.js --connection "postgresql://$POSTGRES_USER:$POSTGRES_PASSWORD@$POSTGRES_HOST/backstage_plugin_catalog" --client pg --migrations-directory node_modules/@backstage/plugin-catalog-backend/migrations/
Using environment: production
Batch 2 rolled back the following migrations:
20240113144027_assets-namespace.js
@@ -43,7 +43,7 @@ Batch 2 rolled back the following migrations:
Now we can check the migration status again to confirm the rollback:
```sh
$ node_modules/.bin/knex migrate:status --connection "postgresql://$POSTGRES_USER:$POSTGRES_PASSWORD@$POSTGRES_HOST/backstage_plugin_app" --client pg --migrations-directory node_modules/@backstage/plugin-catalog-backend/migrations/
$ node_modules/.bin/knex migrate:status --connection "postgresql://$POSTGRES_USER:$POSTGRES_PASSWORD@$POSTGRES_HOST/backstage_plugin_catalog" --client pg --migrations-directory node_modules/@backstage/plugin-catalog-backend/migrations/
Using environment: production
Found 1 Completed Migration file/files.
20211229105307_init.js
@@ -54,7 +54,7 @@ Found 1 Pending Migration file/files.
Now lets use `migrate:currentVersion` which retrieves the current migration version. If there aren't any migrations run yet, it will return "none".
```sh
$ node_modules/.bin/knex migrate:currentVersion --connection "postgresql://$POSTGRES_USER:$POSTGRES_PASSWORD@$POSTGRES_HOST/backstage_plugin_app" --client pg
$ node_modules/.bin/knex migrate:currentVersion --connection "postgresql://$POSTGRES_USER:$POSTGRES_PASSWORD@$POSTGRES_HOST/backstage_plugin_catalog" --client pg
Using environment: production
Current Version: 20240113144027
```
+10
View File
@@ -0,0 +1,10 @@
---
title: KwirthLog for Backstage
author: Julio Fernandez
authorUrl: https://github.com/jfvilas
category: Monitoring
description: With KwirthLog you can view real-time log streams of Kubernetes objects linked to Backstage entities (source entities can be grouped and merged)
documentation: https://github.com/jfvilas/plugin-kwirth-log
iconUrl: https://raw.githubusercontent.com/jfvilas/plugin-kwirth-log/master/src/assets/kwirthlog-logo.png
npmPackageName: '@jfvilas/plugin-kwirth-log'
addedDate: '2025-09-18'
+1 -2
View File
@@ -22,9 +22,8 @@ export default {
docs: {
Overview: [
'overview/what-is-backstage',
'overview/technical-overview',
'overview/architecture-overview',
'overview/background',
'overview/vision',
'overview/roadmap',
'overview/threat-model',
'overview/versioning-policy',
+8 -8
View File
@@ -1,6 +1,6 @@
{
"name": "root",
"version": "1.43.0",
"version": "1.44.0-next.2",
"backstage": {
"cli": {
"new": {
@@ -102,7 +102,6 @@
"@changesets/assemble-release-plan@^6.0.0": "patch:@changesets/assemble-release-plan@npm%3A6.0.0#./.yarn/patches/@changesets-assemble-release-plan-npm-6.0.0-f7b3005037.patch",
"@material-ui/pickers@^3.2.10": "patch:@material-ui/pickers@npm%3A3.3.11#./.yarn/patches/@material-ui-pickers-npm-3.3.11-1c8f68ea20.patch",
"@material-ui/pickers@^3.3.10": "patch:@material-ui/pickers@npm%3A3.3.11#./.yarn/patches/@material-ui-pickers-npm-3.3.11-1c8f68ea20.patch",
"@storybook/react@npm:9.1.5": "patch:@storybook/react@npm%3A9.1.5#~/.yarn/patches/@storybook-react-npm-9.1.5-2331f18b6b.patch",
"@types/react": "^18.0.0",
"@types/react-dom": "^18.0.0",
"@yarnpkg/plugin-npm@npm:^3.1.0": "patch:@yarnpkg/plugin-npm@npm%3A3.1.0#~/.yarn/patches/@yarnpkg-plugin-npm-npm-3.1.0-6533d0f5a1.patch",
@@ -115,6 +114,7 @@
"csstype@npm:^3.1.2": "3.0.9",
"csstype@npm:^3.1.3": "3.0.9",
"jest-haste-map@^29.7.0": "patch:jest-haste-map@npm%3A29.7.0#./.yarn/patches/jest-haste-map-npm-29.7.0-e3be419eff.patch",
"GendocuPublicApis": "npm:gendocu-public-apis@^1.0.0",
"recast@npm:0.23.9>ast-types": "patch:ast-types@npm%3A0.16.1#./.yarn/patches/ast-types-npm-0.16.1-43c4ac4b0d.patch"
},
"dependencies": {
@@ -135,11 +135,11 @@
"@octokit/rest": "^19.0.3",
"@playwright/test": "^1.32.3",
"@spotify/eslint-plugin": "^15.0.0",
"@storybook/addon-a11y": "^9.1.5",
"@storybook/addon-docs": "^9.1.5",
"@storybook/addon-links": "^9.1.5",
"@storybook/addon-themes": "^9.1.5",
"@storybook/react-vite": "^9.1.5",
"@storybook/addon-a11y": "^9.1.7",
"@storybook/addon-docs": "^9.1.7",
"@storybook/addon-links": "^9.1.7",
"@storybook/addon-themes": "^9.1.7",
"@storybook/react-vite": "^9.1.7",
"@techdocs/cli": "workspace:*",
"@types/cacheable-request": "^8.3.6",
"@types/memjs": "^1.3.3",
@@ -164,7 +164,7 @@
"shx": "^0.4.0",
"sloc": "^0.3.1",
"sort-package-json": "^2.8.0",
"storybook": "^9.1.5",
"storybook": "^9.1.7",
"typedoc": "^0.28.0",
"typescript": "~5.7.0",
"vite": "^7.1.5"
+29
View File
@@ -1,5 +1,34 @@
# @backstage/app-defaults
## 1.7.1-next.2
### Patch Changes
- Updated dependencies
- @backstage/core-components@0.18.2-next.2
- @backstage/theme@0.6.9-next.0
## 1.7.1-next.1
### Patch Changes
- Updated dependencies
- @backstage/core-app-api@1.19.1-next.0
- @backstage/core-components@0.18.2-next.1
- @backstage/core-plugin-api@1.11.1-next.0
- @backstage/plugin-permission-react@0.4.37-next.0
## 1.7.1-next.0
### Patch Changes
- Updated dependencies
- @backstage/core-components@0.18.2-next.0
- @backstage/core-app-api@1.19.0
- @backstage/core-plugin-api@1.11.0
- @backstage/theme@0.6.8
- @backstage/plugin-permission-react@0.4.36
## 1.7.0
### Minor Changes
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "@backstage/app-defaults",
"version": "1.7.0",
"version": "1.7.1-next.2",
"description": "Provides the default wiring of a Backstage App",
"backstage": {
"role": "web-library"
@@ -1,5 +1,13 @@
# app-next-example-plugin
## 0.0.28-next.0
### Patch Changes
- Updated dependencies
- @backstage/core-components@0.18.2-next.0
- @backstage/frontend-plugin-api@0.12.1-next.0
## 0.0.27
### Patch Changes
@@ -1,6 +1,6 @@
{
"name": "app-next-example-plugin",
"version": "0.0.27",
"version": "0.0.28-next.0",
"description": "Backstage internal example plugin",
"backstage": {
"role": "frontend-plugin",
+114
View File
@@ -1,5 +1,119 @@
# example-app-next
## 0.0.28-next.2
### Patch Changes
- Updated dependencies
- @backstage/plugin-scaffolder-react@1.19.2-next.2
- @backstage/plugin-org@0.6.45-next.2
- @backstage/cli@0.34.4-next.2
- @backstage/ui@0.7.2-next.1
- @backstage/core-components@0.18.2-next.2
- @backstage/theme@0.6.9-next.0
- @backstage/plugin-scaffolder@1.34.2-next.2
- @backstage/app-defaults@1.7.1-next.2
- @backstage/plugin-app@0.3.1-next.2
- @backstage/plugin-auth@0.1.1-next.1
- @backstage/plugin-home@0.8.13-next.2
- @backstage/plugin-notifications@0.5.10-next.2
- @backstage/plugin-search-react@1.9.5-next.2
- @backstage/plugin-signals@0.0.24-next.2
- @backstage/plugin-techdocs@1.15.1-next.2
- @backstage/plugin-techdocs-react@1.3.4-next.1
- @backstage/plugin-user-settings@0.8.27-next.2
## 0.0.28-next.1
### Patch Changes
- Updated dependencies
- @backstage/config@1.3.4-next.0
- @backstage/cli@0.34.4-next.1
- @backstage/core-app-api@1.19.1-next.0
- @backstage/core-components@0.18.2-next.1
- @backstage/core-plugin-api@1.11.1-next.0
- @backstage/frontend-app-api@0.13.1-next.1
- @backstage/frontend-defaults@0.3.2-next.1
- @backstage/integration-react@1.2.11-next.1
- @backstage/plugin-catalog-import@0.13.6-next.1
- @backstage/plugin-home@0.8.13-next.1
- @backstage/plugin-permission-react@0.4.37-next.0
- @backstage/plugin-techdocs@1.15.1-next.1
- @backstage/plugin-techdocs-react@1.3.4-next.1
- @backstage/app-defaults@1.7.1-next.1
- @backstage/core-compat-api@0.5.3-next.1
- @backstage/plugin-api-docs@0.13.0-next.1
- @backstage/plugin-catalog@1.31.4-next.1
- @backstage/plugin-catalog-graph@0.5.2-next.1
- @backstage/plugin-catalog-react@1.21.2-next.1
- @backstage/plugin-notifications@0.5.10-next.1
- @backstage/plugin-org@0.6.45-next.1
- @backstage/plugin-scaffolder@1.34.2-next.1
- @backstage/plugin-scaffolder-react@1.19.2-next.1
- @backstage/plugin-search@1.4.31-next.1
- @backstage/plugin-search-react@1.9.5-next.1
- @backstage/plugin-signals@0.0.24-next.1
- @backstage/plugin-user-settings@0.8.27-next.1
- @backstage/frontend-plugin-api@0.12.1-next.1
- @backstage/plugin-app@0.3.1-next.1
- @backstage/plugin-app-visualizer@0.1.24-next.1
- @backstage/plugin-auth-react@0.1.20-next.1
- @backstage/plugin-catalog-unprocessed-entities@0.2.22-next.1
- @backstage/plugin-kubernetes@0.12.12-next.1
- @backstage/plugin-kubernetes-cluster@0.0.30-next.1
- @backstage/plugin-techdocs-module-addons-contrib@1.1.29-next.1
- @backstage/plugin-auth@0.1.1-next.0
- @backstage/plugin-catalog-common@1.1.6-next.0
- @backstage/plugin-search-common@1.2.20-next.0
## 0.0.28-next.0
### Patch Changes
- Updated dependencies
- @backstage/ui@0.7.2-next.0
- @backstage/plugin-catalog-graph@0.5.2-next.0
- @backstage/plugin-catalog-react@1.21.2-next.0
- @backstage/core-components@0.18.2-next.0
- @backstage/cli@0.34.4-next.0
- @backstage/plugin-scaffolder@1.34.2-next.0
- @backstage/plugin-api-docs@0.13.0-next.0
- @backstage/core-compat-api@0.5.3-next.0
- @backstage/plugin-catalog@1.31.4-next.0
- @backstage/plugin-catalog-import@0.13.6-next.0
- @backstage/plugin-home@0.8.13-next.0
- @backstage/plugin-kubernetes@0.12.12-next.0
- @backstage/plugin-kubernetes-cluster@0.0.30-next.0
- @backstage/plugin-org@0.6.45-next.0
- @backstage/plugin-scaffolder-react@1.19.2-next.0
- @backstage/plugin-search@1.4.31-next.0
- @backstage/plugin-techdocs@1.15.1-next.0
- @backstage/plugin-techdocs-module-addons-contrib@1.1.29-next.0
- @backstage/plugin-user-settings@0.8.27-next.0
- @backstage/app-defaults@1.7.1-next.0
- @backstage/frontend-defaults@0.3.2-next.0
- @backstage/frontend-plugin-api@0.12.1-next.0
- @backstage/integration-react@1.2.11-next.0
- @backstage/plugin-app@0.3.1-next.0
- @backstage/plugin-app-visualizer@0.1.24-next.0
- @backstage/plugin-auth@0.1.1-next.0
- @backstage/plugin-auth-react@0.1.20-next.0
- @backstage/plugin-catalog-unprocessed-entities@0.2.22-next.0
- @backstage/plugin-notifications@0.5.10-next.0
- @backstage/plugin-search-react@1.9.5-next.0
- @backstage/plugin-signals@0.0.24-next.0
- @backstage/plugin-techdocs-react@1.3.4-next.0
- @backstage/catalog-model@1.7.5
- @backstage/config@1.3.3
- @backstage/core-app-api@1.19.0
- @backstage/core-plugin-api@1.11.0
- @backstage/frontend-app-api@0.13.1-next.0
- @backstage/theme@0.6.8
- @backstage/plugin-catalog-common@1.1.5
- @backstage/plugin-permission-react@0.4.36
- @backstage/plugin-search-common@1.2.19
## 0.0.27
### Patch Changes
+5
View File
@@ -21,6 +21,11 @@ app:
ownerEntityRefs: [cubic-belugas]
extensions:
- entity-card:org/members-list:
config:
showAggregateMembersToggle: true
initialRelationAggregation: aggregated
# - apis.plugin.graphiql.browse.gitlab: true
# - graphiql-endpoint:graphiql/gitlab: true
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "example-app-next",
"version": "0.0.27",
"version": "0.0.28-next.2",
"backstage": {
"role": "frontend"
},
+103
View File
@@ -1,5 +1,108 @@
# example-app
## 0.2.114-next.2
### Patch Changes
- Updated dependencies
- @backstage/plugin-mui-to-bui@0.2.0-next.0
- @backstage/plugin-scaffolder-react@1.19.2-next.2
- @backstage/plugin-org@0.6.45-next.2
- @backstage/cli@0.34.4-next.2
- @backstage/ui@0.7.2-next.1
- @backstage/core-components@0.18.2-next.2
- @backstage/theme@0.6.9-next.0
- @backstage/plugin-scaffolder@1.34.2-next.2
- @backstage/app-defaults@1.7.1-next.2
- @backstage/plugin-home@0.8.13-next.2
- @backstage/plugin-notifications@0.5.10-next.2
- @backstage/plugin-search-react@1.9.5-next.2
- @backstage/plugin-signals@0.0.24-next.2
- @backstage/plugin-techdocs@1.15.1-next.2
- @backstage/plugin-techdocs-react@1.3.4-next.1
- @backstage/plugin-user-settings@0.8.27-next.2
## 0.2.114-next.1
### Patch Changes
- Updated dependencies
- @backstage/config@1.3.4-next.0
- @backstage/cli@0.34.4-next.1
- @backstage/core-app-api@1.19.1-next.0
- @backstage/core-components@0.18.2-next.1
- @backstage/core-plugin-api@1.11.1-next.0
- @backstage/frontend-app-api@0.13.1-next.1
- @backstage/integration-react@1.2.11-next.1
- @backstage/plugin-catalog-import@0.13.6-next.1
- @backstage/plugin-home@0.8.13-next.1
- @backstage/plugin-permission-react@0.4.37-next.0
- @backstage/plugin-techdocs@1.15.1-next.1
- @backstage/plugin-techdocs-react@1.3.4-next.1
- @backstage/app-defaults@1.7.1-next.1
- @backstage/plugin-api-docs@0.13.0-next.1
- @backstage/plugin-catalog@1.31.4-next.1
- @backstage/plugin-catalog-graph@0.5.2-next.1
- @backstage/plugin-catalog-react@1.21.2-next.1
- @backstage/plugin-notifications@0.5.10-next.1
- @backstage/plugin-org@0.6.45-next.1
- @backstage/plugin-scaffolder@1.34.2-next.1
- @backstage/plugin-scaffolder-react@1.19.2-next.1
- @backstage/plugin-search@1.4.31-next.1
- @backstage/plugin-search-react@1.9.5-next.1
- @backstage/plugin-signals@0.0.24-next.1
- @backstage/plugin-user-settings@0.8.27-next.1
- @backstage/plugin-auth-react@0.1.20-next.1
- @backstage/plugin-catalog-unprocessed-entities@0.2.22-next.1
- @backstage/plugin-devtools@0.1.32-next.1
- @backstage/plugin-kubernetes@0.12.12-next.1
- @backstage/plugin-kubernetes-cluster@0.0.30-next.1
- @backstage/plugin-techdocs-module-addons-contrib@1.1.29-next.1
- @backstage/plugin-catalog-common@1.1.6-next.0
- @backstage/plugin-search-common@1.2.20-next.0
## 0.2.114-next.0
### Patch Changes
- Updated dependencies
- @backstage/ui@0.7.2-next.0
- @backstage/plugin-catalog-graph@0.5.2-next.0
- @backstage/plugin-catalog-react@1.21.2-next.0
- @backstage/core-components@0.18.2-next.0
- @backstage/cli@0.34.4-next.0
- @backstage/plugin-scaffolder@1.34.2-next.0
- @backstage/plugin-api-docs@0.13.0-next.0
- @backstage/plugin-catalog@1.31.4-next.0
- @backstage/plugin-catalog-import@0.13.6-next.0
- @backstage/plugin-home@0.8.13-next.0
- @backstage/plugin-kubernetes@0.12.12-next.0
- @backstage/plugin-kubernetes-cluster@0.0.30-next.0
- @backstage/plugin-org@0.6.45-next.0
- @backstage/plugin-scaffolder-react@1.19.2-next.0
- @backstage/plugin-search@1.4.31-next.0
- @backstage/plugin-techdocs@1.15.1-next.0
- @backstage/plugin-techdocs-module-addons-contrib@1.1.29-next.0
- @backstage/plugin-user-settings@0.8.27-next.0
- @backstage/app-defaults@1.7.1-next.0
- @backstage/integration-react@1.2.11-next.0
- @backstage/plugin-auth-react@0.1.20-next.0
- @backstage/plugin-catalog-unprocessed-entities@0.2.22-next.0
- @backstage/plugin-devtools@0.1.32-next.0
- @backstage/plugin-notifications@0.5.10-next.0
- @backstage/plugin-search-react@1.9.5-next.0
- @backstage/plugin-signals@0.0.24-next.0
- @backstage/plugin-techdocs-react@1.3.4-next.0
- @backstage/catalog-model@1.7.5
- @backstage/config@1.3.3
- @backstage/core-app-api@1.19.0
- @backstage/core-plugin-api@1.11.0
- @backstage/frontend-app-api@0.13.1-next.0
- @backstage/theme@0.6.8
- @backstage/plugin-catalog-common@1.1.5
- @backstage/plugin-permission-react@0.4.36
- @backstage/plugin-search-common@1.2.19
## 0.2.113
### Patch Changes
+2 -1
View File
@@ -1,6 +1,6 @@
{
"name": "example-app",
"version": "0.2.113",
"version": "0.2.114-next.2",
"backstage": {
"role": "frontend"
},
@@ -56,6 +56,7 @@
"@backstage/plugin-home": "workspace:^",
"@backstage/plugin-kubernetes": "workspace:^",
"@backstage/plugin-kubernetes-cluster": "workspace:^",
"@backstage/plugin-mui-to-bui": "workspace:^",
"@backstage/plugin-notifications": "workspace:^",
"@backstage/plugin-org": "workspace:^",
"@backstage/plugin-permission-react": "workspace:^",
+2
View File
@@ -73,6 +73,7 @@ import {
} from '@backstage/plugin-notifications';
import { CustomizableHomePage } from './components/home/CustomizableHomePage';
import { HomePage } from './components/home/HomePage';
import { BuiThemerPage } from '@backstage/plugin-mui-to-bui';
const app = createApp({
apis,
@@ -208,6 +209,7 @@ const routes = (
{customDevToolsPage}
</Route>
<Route path="/notifications" element={<NotificationsPage />} />
<Route path="/mui-to-bui" element={<BuiThemerPage />} />
</FlatRoutes>
);
+8
View File
@@ -1,5 +1,13 @@
# @backstage/backend-app-api
## 1.2.8-next.0
### Patch Changes
- Updated dependencies
- @backstage/config@1.3.4-next.0
- @backstage/backend-plugin-api@1.4.4-next.0
## 1.2.7
### Patch Changes
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "@backstage/backend-app-api",
"version": "1.2.7",
"version": "1.2.8-next.0",
"description": "Core API used by Backstage backend apps",
"backstage": {
"role": "node-library"
+52
View File
@@ -1,5 +1,57 @@
# @backstage/backend-defaults
## 0.13.0-next.2
### Minor Changes
- 8495b18: Add a new `externalTokenHandlersServiceRef` to allow custom external token validations
## 0.13.0-next.1
### Patch Changes
- Updated dependencies
- @backstage/config-loader@1.10.4-next.0
- @backstage/config@1.3.4-next.0
- @backstage/integration@1.18.1-next.1
- @backstage/integration-aws-node@0.1.18-next.0
- @backstage/backend-app-api@1.2.8-next.0
- @backstage/backend-plugin-api@1.4.4-next.0
- @backstage/plugin-auth-node@0.6.8-next.0
- @backstage/plugin-permission-node@0.10.5-next.0
- @backstage/plugin-events-node@0.4.16-next.0
- @backstage/cli-node@0.2.14
## 0.13.0-next.0
### Minor Changes
- 2d3e2b2: implement support for direct url for AzureBlobStorageUrlReader search function
- 8b91238: Adds support for configuring server-level HTTP options through the
`app-config.yaml` file under the `backend.server` key. Supported options
include `headersTimeout`, `keepAliveTimeout`, `requestTimeout`, `timeout`,
`maxHeadersCount`, and `maxRequestsPerSocket`.
These are passed directly to the underlying Node.js HTTP server.
If omitted, Node.js defaults are used.
### Patch Changes
- Updated dependencies
- @backstage/integration@1.18.1-next.0
- @backstage/backend-app-api@1.2.7
- @backstage/plugin-auth-node@0.6.7
- @backstage/plugin-permission-node@0.10.4
- @backstage/backend-dev-utils@0.1.5
- @backstage/backend-plugin-api@1.4.3
- @backstage/cli-node@0.2.14
- @backstage/config@1.3.3
- @backstage/config-loader@1.10.3
- @backstage/errors@1.2.7
- @backstage/integration-aws-node@0.1.17
- @backstage/types@1.2.2
- @backstage/plugin-events-node@0.4.15
## 0.12.1
### Patch Changes
+25
View File
@@ -95,6 +95,31 @@ export interface Config {
};
};
/**
* Server-level HTTP options configuration for the backend.
* These options are passed directly to the underlying Node.js HTTP server.
*
* Timeout values support multiple formats:
* - A number in milliseconds
* - A string in the format of '1d', '2 seconds' etc. as supported by the `ms` library
* - A standard ISO formatted duration string, e.g. 'P2DT6H' or 'PT1M'
* - An object with individual units (in plural) as keys, e.g. `{ days: 2, hours: 6 }`
*/
server?: {
/** Sets the timeout value for receiving the complete HTTP headers from the client. */
headersTimeout?: number | string | HumanDuration;
/** Sets the timeout value for receiving the entire request (headers and body) from the client. */
requestTimeout?: number | string | HumanDuration;
/** Sets the timeout value for inactivity on a socket during keep-alive. */
keepAliveTimeout?: number | string | HumanDuration;
/** Sets the timeout value for sockets. */
timeout?: number | string | HumanDuration;
/** Limits maximum incoming headers count. */
maxHeadersCount?: number;
/** Sets the maximum number of requests socket can handle before closing keep alive connection. */
maxRequestsPerSocket?: number;
};
/**
* Options used by the default auditor service.
*/
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "@backstage/backend-defaults",
"version": "0.12.1",
"version": "0.13.0-next.2",
"description": "Backend defaults used by Backstage backend apps",
"backstage": {
"role": "node-library"
@@ -4,6 +4,7 @@
```ts
import { AuthService } from '@backstage/backend-plugin-api';
import type { Config } from '@backstage/config';
import { ServiceFactory } from '@backstage/backend-plugin-api';
import { ServiceRef } from '@backstage/backend-plugin-api';
@@ -14,6 +15,36 @@ export const authServiceFactory: ServiceFactory<
'singleton'
>;
// @public
export function createExternalTokenHandler<TContext>(
handler: ExternalTokenHandler<TContext>,
): ExternalTokenHandler<TContext>;
// @public
export interface ExternalTokenHandler<TContext> {
// (undocumented)
initialize(ctx: { options: Config }): TContext;
// (undocumented)
type: string;
// (undocumented)
verifyToken(
token: string,
ctx: TContext,
): Promise<
| {
subject: string;
}
| undefined
>;
}
// @public
export const externalTokenHandlersServiceRef: ServiceRef<
ExternalTokenHandler<unknown>,
'plugin',
'multiton'
>;
// @public
export interface PluginTokenHandler {
// (undocumented)
@@ -87,7 +87,10 @@ export class AzureBlobStorageUrlReader implements UrlReaderService {
options?: UrlReaderServiceReadUrlOptions,
): Promise<UrlReaderServiceReadUrlResponse>;
// (undocumented)
search(): Promise<UrlReaderServiceSearchResponse>;
search(
url: string,
options?: UrlReaderServiceSearchOptions,
): Promise<UrlReaderServiceSearchResponse>;
// (undocumented)
toString(): string;
}
@@ -25,7 +25,7 @@ import {
import { AuthenticationError } from '@backstage/errors';
import { JsonObject } from '@backstage/types';
import { decodeJwt } from 'jose';
import { ExternalTokenHandler } from './external/ExternalTokenHandler';
import { ExternalAuthTokenHandler } from './external/ExternalAuthTokenHandler';
import {
createCredentialsWithNonePrincipal,
createCredentialsWithServicePrincipal,
@@ -41,7 +41,7 @@ export class DefaultAuthService implements AuthService {
constructor(
private readonly userTokenHandler: UserTokenHandler,
private readonly pluginTokenHandler: PluginTokenHandler,
private readonly externalTokenHandler: ExternalTokenHandler,
private readonly externalTokenHandler: ExternalAuthTokenHandler,
private readonly pluginId: string,
private readonly disableDefaultAuthPolicy: boolean,
private readonly pluginKeySource: PluginKeySource,
@@ -31,6 +31,9 @@ import { toInternalBackstageCredentials } from './helpers';
import { PluginTokenHandler } from './plugin/PluginTokenHandler';
import { createServiceFactory } from '@backstage/backend-plugin-api';
import { externalTokenHandlersServiceRef } from './external/ExternalAuthTokenHandler';
import { createExternalTokenHandler } from './external/helpers';
const server = setupServer();
// TODO: Ship discovery mock service in the service factory tester
@@ -450,8 +453,88 @@ describe('authServiceFactory', () => {
dependencies: [...mockDeps, customPluginTokenHandler],
});
const searchAuth = await tester.getSubject('search');
searchAuth.authenticate('unlimited-static-token');
await searchAuth.authenticate('unlimited-static-token');
expect(customLogic).toHaveBeenCalledWith('unlimited-static-token');
});
});
describe('add custom ExternalTokenHandler', () => {
it('should allow custom logic to be injected into the plugin token handler', async () => {
const customLogic = jest.fn();
const customConfig = jest.fn();
const deps = [
discoveryServiceFactory,
mockServices.rootConfig.factory({
data: {
backend: {
baseUrl: 'http://localhost',
auth: {
keys: [{ secret: 'abc' }],
externalAccess: [
{
type: 'static',
options: {
token: 'limited-static-token',
subject: 'limited-static-subject',
},
accessRestrictions: [
{ plugin: 'catalog', permission: 'do.it' },
],
},
{
type: 'static',
options: {
token: 'unlimited-static-token',
subject: 'unlimited-static-subject',
},
},
{
type: 'custom',
options: {
[`custom-config`]: 'custom-config',
foo: 'bar',
},
},
],
},
},
},
}),
];
const customExternalTokenHandler = createExternalTokenHandler<{
[`custom-config`]: string;
foo: string;
}>({
type: 'custom',
initialize({ options }) {
const customConfigValue = options.getString('custom-config');
const foo = options.getString('foo');
customConfig(customConfigValue);
return { [`custom-config`]: customConfigValue, foo };
},
async verifyToken(token, ctx) {
customLogic(token);
return {
subject: ctx.foo,
};
},
});
const customPluginTokenHandler = createServiceFactory({
service: externalTokenHandlersServiceRef,
deps: {},
async factory() {
return customExternalTokenHandler;
},
});
const tester = ServiceFactoryTester.from(authServiceFactory, {
dependencies: [...deps, customPluginTokenHandler],
});
const searchAuth = await tester.getSubject('search');
await searchAuth.authenticate('custom-token');
expect(customLogic).toHaveBeenCalledWith('custom-token');
expect(customConfig).toHaveBeenCalledWith('custom-config');
});
});
});
@@ -20,7 +20,10 @@ import {
createServiceRef,
} from '@backstage/backend-plugin-api';
import { DefaultAuthService } from './DefaultAuthService';
import { ExternalTokenHandler } from './external/ExternalTokenHandler';
import {
ExternalAuthTokenHandler,
externalTokenHandlersServiceRef,
} from './external/ExternalAuthTokenHandler';
import {
DefaultPluginTokenHandler,
PluginTokenHandler,
@@ -64,6 +67,7 @@ export const authServiceFactory = createServiceFactory({
plugin: coreServices.pluginMetadata,
database: coreServices.database,
pluginTokenHandlerDecorator: pluginTokenHandlerDecoratorServiceRef,
externalTokenHandlers: externalTokenHandlersServiceRef,
},
async factory({
config,
@@ -72,6 +76,7 @@ export const authServiceFactory = createServiceFactory({
logger,
database,
pluginTokenHandlerDecorator,
externalTokenHandlers,
}) {
const disableDefaultAuthPolicy =
config.getOptionalBoolean(
@@ -102,10 +107,11 @@ export const authServiceFactory = createServiceFactory({
}),
);
const externalTokens = ExternalTokenHandler.create({
const externalTokens = ExternalAuthTokenHandler.create({
ownPluginId: plugin.getId(),
config,
logger,
externalTokenHandlers,
});
return new DefaultAuthService(

Some files were not shown because too many files have changed in this diff Show More