From 3361cb8a32a516d4f5922589b5f41a207aea743b Mon Sep 17 00:00:00 2001 From: Christopher Diaz Date: Tue, 16 May 2023 10:49:44 -0400 Subject: [PATCH] update changelog and docs Signed-off-by: Christopher Diaz --- .changeset/lovely-impalas-sell.md | 13 ++++++++++++- plugins/search-backend-module-explore/README.md | 15 +++++++++++++++ 2 files changed, 27 insertions(+), 1 deletion(-) diff --git a/.changeset/lovely-impalas-sell.md b/.changeset/lovely-impalas-sell.md index b52f11695c..fa3ae9d5c5 100644 --- a/.changeset/lovely-impalas-sell.md +++ b/.changeset/lovely-impalas-sell.md @@ -2,4 +2,15 @@ '@backstage/plugin-search-backend-module-explore': patch --- -Allows for an optional token manager to authenticate requests from the collator to the explore backend +Allows for an optional token manager to authenticate requests from the collator to the explore backend. For example: + +``` + indexBuilder.addCollator({ + schedule: every10MinutesSchedule, + factory: ToolDocumentCollatorFactory.fromConfig(env.config, { + discovery: env.discovery, + logger: env.logger, + tokenManager: env.tokenManager, + }), + }); +``` diff --git a/plugins/search-backend-module-explore/README.md b/plugins/search-backend-module-explore/README.md index a87f2d78f9..7d0f25b543 100644 --- a/plugins/search-backend-module-explore/README.md +++ b/plugins/search-backend-module-explore/README.md @@ -39,3 +39,18 @@ backend.add(searchPlugin()); backend.add(searchModuleExploreCollator({ schedule })); backend.start(); ``` + +### Using Auth Middleware + +If your Backstage instance uses service-to-service authentication you can pass an optional tokenManager to the collator factory. This will ensure that the collator makes authenticated requests to the explore backend. + +```tsx +indexBuilder.addCollator({ + schedule: every10MinutesSchedule, + factory: ToolDocumentCollatorFactory.fromConfig(env.config, { + discovery: env.discovery, + logger: env.logger, + tokenManager: env.tokenManager, + }), +}); +```