From 7da1b7c42af75757ebe7d9c3d9096c6b70284700 Mon Sep 17 00:00:00 2001 From: MT Lewis Date: Mon, 17 Jan 2022 18:22:34 +0000 Subject: [PATCH] search-backend: add optional latency budget for authorized search backend Signed-off-by: MT Lewis --- plugins/search-backend/config.d.ts | 39 ++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) create mode 100644 plugins/search-backend/config.d.ts diff --git a/plugins/search-backend/config.d.ts b/plugins/search-backend/config.d.ts new file mode 100644 index 0000000000..99f4d0ab2f --- /dev/null +++ b/plugins/search-backend/config.d.ts @@ -0,0 +1,39 @@ +/* + * Copyright 2021 The Backstage Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +export interface Config { + /** Configuration options for the search plugin */ + search?: { + /** + * Options related to the search integration with the Backstage permissions system + */ + permissions?: { + /** + * Limits the amount of time the search backend will spend retrieving and + * authorizing results from the search engine when permissions are + * enabled. When the latency of the query endpoint reaches this threshold, + * the results obtained up until that point will be returned, even if the + * page is incomplete. + * + * This limit is only expected to be hit for broad queries from users with + * extremely restrictive visibility, or for very high page offsets. + * + * @default 1000 + */ + queryLatencyBudgetMs?: number; + }; + }; +}