From b2f8bb99d3b385804a91f2d84c4d865747b37efe Mon Sep 17 00:00:00 2001 From: Mike Lewis Date: Mon, 21 Feb 2022 18:23:47 +0000 Subject: [PATCH] backend-common: make configuration objects optional in config schema The previous schema meant that if any other plugin introduced something under backend.auth, the keys property would be mandatory, which isn't correct. This commit relaxes the requirement so that backend.auth.keys is always optional, even if backend.auth is configured. Signed-off-by: Mike Lewis --- .changeset/brave-crews-move.md | 5 +++++ packages/backend-common/config.d.ts | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) create mode 100644 .changeset/brave-crews-move.md diff --git a/.changeset/brave-crews-move.md b/.changeset/brave-crews-move.md new file mode 100644 index 0000000000..a5d22361f4 --- /dev/null +++ b/.changeset/brave-crews-move.md @@ -0,0 +1,5 @@ +--- +'@backstage/backend-common': patch +--- + +Make backend.auth.keys optional in config schema. Previously backend.auth was optional but keys was not, which meant that if another plugin introduced additional properties under backend.auth, it would implicitly make backend.auth.keys mandatory. diff --git a/packages/backend-common/config.d.ts b/packages/backend-common/config.d.ts index 16ca1698f6..72995dde85 100644 --- a/packages/backend-common/config.d.ts +++ b/packages/backend-common/config.d.ts @@ -23,7 +23,7 @@ export interface Config { /** Backend configuration for when request authentication is enabled */ auth?: { /** Keys shared by all backends for signing and validating backend tokens. */ - keys: { + keys?: { /** * Secret for generating tokens. Should be a base64 string, recommended * length is 24 bytes.