Merge pull request #9673 from backstage/server-permission-client-error

[Permissions] Improve error message for backend-to-backend authn setup
This commit is contained in:
Fredrik Adelöw
2022-02-21 14:59:01 +01:00
committed by GitHub
3 changed files with 7 additions and 2 deletions
+5
View File
@@ -0,0 +1,5 @@
---
'@backstage/plugin-permission-node': patch
---
Improved error message shown when 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',
);
}