(fix): bind 'this' properly for getKey function

Signed-off-by: Jonah Back <jonah@jonahback.com>
This commit is contained in:
Jonah Back
2022-05-24 14:40:18 -07:00
parent c1511c99a5
commit 467facc6ea
2 changed files with 7 additions and 2 deletions
+5
View File
@@ -0,0 +1,5 @@
---
'@backstage/plugin-auth-backend': patch
---
Fix improper binding of 'this' in ALB Auth provider
@@ -189,7 +189,7 @@ export class AwsAlbAuthProvider implements AuthProviderRouteHandlers {
};
}
async getKey(header: JWTHeaderParameters): Promise<KeyObject> {
getKey = async (header: JWTHeaderParameters): Promise<KeyObject> => {
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;
}
};
}
/**