From 467facc6eac766e96aaf1e30b4b0da93a854a1b4 Mon Sep 17 00:00:00 2001 From: Jonah Back Date: Tue, 24 May 2022 14:40:18 -0700 Subject: [PATCH] (fix): bind 'this' properly for getKey function Signed-off-by: Jonah Back --- .changeset/tricky-hounds-cry.md | 5 +++++ plugins/auth-backend/src/providers/aws-alb/provider.ts | 4 ++-- 2 files changed, 7 insertions(+), 2 deletions(-) create mode 100644 .changeset/tricky-hounds-cry.md diff --git a/.changeset/tricky-hounds-cry.md b/.changeset/tricky-hounds-cry.md new file mode 100644 index 0000000000..d54d59fd30 --- /dev/null +++ b/.changeset/tricky-hounds-cry.md @@ -0,0 +1,5 @@ +--- +'@backstage/plugin-auth-backend': patch +--- + +Fix improper binding of 'this' in ALB Auth provider diff --git a/plugins/auth-backend/src/providers/aws-alb/provider.ts b/plugins/auth-backend/src/providers/aws-alb/provider.ts index 78bfb9f0ec..b8d43a11e6 100644 --- a/plugins/auth-backend/src/providers/aws-alb/provider.ts +++ b/plugins/auth-backend/src/providers/aws-alb/provider.ts @@ -189,7 +189,7 @@ export class AwsAlbAuthProvider implements AuthProviderRouteHandlers { }; } - async getKey(header: JWTHeaderParameters): Promise { + getKey = async (header: JWTHeaderParameters): Promise => { if (!header.kid) { throw new AuthenticationError('No key id was specified in header'); } @@ -208,7 +208,7 @@ export class AwsAlbAuthProvider implements AuthProviderRouteHandlers { keyValue.export({ format: 'pem', type: 'spki' }), ); return keyValue; - } + }; } /**