Merge pull request #24145 from backstage/fix/permission-obo

ServerPermissionClient: fix targetPluginId
This commit is contained in:
Fredrik Adelöw
2024-04-10 13:07:22 +02:00
committed by GitHub
6 changed files with 15 additions and 5 deletions
@@ -384,7 +384,7 @@ describe('authServiceFactory', () => {
targetPluginId: 'kubernetes',
}),
).rejects.toThrow(
"Unable to call 'kubernetes' plugin on behalf of user, because the target plugin does not support on-behalf-of tokens",
"Unable to call 'kubernetes' plugin on behalf of user, because the target plugin does not support on-behalf-of tokens or the plugin doesn't exist",
);
});
});
@@ -240,7 +240,7 @@ class DefaultAuthService implements AuthService {
if (this.userTokenHandler.isLimitedUserToken(token)) {
throw new AuthenticationError(
`Unable to call '${targetPluginId}' plugin on behalf of user, because the target plugin does not support on-behalf-of tokens`,
`Unable to call '${targetPluginId}' plugin on behalf of user, because the target plugin does not support on-behalf-of tokens or the plugin doesn't exist`,
);
}
return { token };