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:
@@ -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',
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user