Merge pull request #11659 from backjo/fix/AlbThis

(fix): bind 'this' properly for getKey function in ALB auth provider
This commit is contained in:
Patrik Oldsberg
2022-05-30 11:28:32 +02:00
committed by GitHub
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;
}
};
}
/**