Improve error message when permissions are enabled without backend-to-backend authentication

Signed-off-by: Joe Porpeglia <josephp@spotify.com>
This commit is contained in:
Joe Porpeglia
2022-02-18 15:33:51 -05:00
parent c323b2b6af
commit 0816f8237a
3 changed files with 7 additions and 2 deletions
+5
View File
@@ -0,0 +1,5 @@
---
'@backstage/plugin-permission-node': patch
---
Improved error message permissions are enabled without backend-to-backend authentication.
@@ -113,7 +113,7 @@ describe('ServerPermissionClient', () => {
tokenManager: ServerTokenManager.noop(),
}),
).toThrowError(
'You must configure at least one key in backend.auth.keys if permissions are enabled.',
'Backend-to-backend authentication must be configured before enabling permissions. Read more here https://backstage.io/docs/tutorials/backend-to-backend-auth',
);
});
});
@@ -56,7 +56,7 @@ export class ServerPermissionClient implements PermissionAuthorizer {
(tokenManager as any).isInsecureServerTokenManager
) {
throw new Error(
'You must configure at least one key in backend.auth.keys if permissions are enabled.',
'Backend-to-backend authentication must be configured before enabling permissions. Read more here https://backstage.io/docs/tutorials/backend-to-backend-auth',
);
}