Merge pull request #8506 from backstage/authz-search-backend

search: filter unauthorized results
This commit is contained in:
MT Lewis
2022-01-27 11:01:51 +00:00
committed by GitHub
30 changed files with 1102 additions and 11 deletions
+5
View File
@@ -0,0 +1,5 @@
---
'@backstage/plugin-search-backend-node': patch
---
Track visibility permissions by document type in IndexBuilder
+5
View File
@@ -0,0 +1,5 @@
---
'@backstage/plugin-catalog-backend': patch
---
Add support for permissions to the DefaultCatalogCollator.
+25
View File
@@ -0,0 +1,25 @@
---
'@backstage/create-app': patch
---
Added three additional required properties to the search-backend `createRouter` function to support filtering search results based on permissions. To make this change to an existing app, add the required parameters to the `createRouter` call in `packages/backend/src/plugins/search.ts`:
```diff
export default async function createPlugin({
logger,
+ permissions,
discovery,
config,
tokenManager,
}: PluginEnvironment) {
/* ... */
return await createRouter({
engine: indexBuilder.getSearchEngine(),
+ types: indexBuilder.getDocumentTypes(),
+ permissions,
+ config,
logger,
});
}
```
+6
View File
@@ -0,0 +1,6 @@
---
'@backstage/search-common': patch
---
- Add optional visibilityPermission property to DocumentCollator type
- Add new DocumentTypeInfo type for housing information about the document types stored in a search engine.
+5
View File
@@ -0,0 +1,5 @@
---
'@backstage/search-common': patch
---
Add optional resourceRef field to the IndexableDocument type for use when authorizing access to documents.
+5
View File
@@ -0,0 +1,5 @@
---
'@backstage/search-common': patch
---
Add optional query request options containing authorization token to SearchEngine#query.
+25
View File
@@ -0,0 +1,25 @@
---
'@backstage/plugin-search-backend': minor
---
**BREAKING** Added three additional required properties to `createRouter` to support filtering search results based on permissions. To make this change to an existing app, add the required parameters to the `createRouter` call in `packages/backend/src/plugins/search.ts`:
```diff
export default async function createPlugin({
logger,
+ permissions,
discovery,
config,
tokenManager,
}: PluginEnvironment) {
/* ... */
return await createRouter({
engine: indexBuilder.getSearchEngine(),
+ types: indexBuilder.getDocumentTypes(),
+ permissions,
+ config,
logger,
});
}
```
+5
View File
@@ -0,0 +1,5 @@
---
'@backstage/plugin-techdocs-backend': patch
---
Add support for permissions to the DefaultTechDocsCollator.