backend-common: remove isSecure property in favour of a property on the NoopServerTokenManager

Signed-off-by: MT Lewis <mtlewis@users.noreply.github.com>
This commit is contained in:
MT Lewis
2021-12-21 09:50:54 +00:00
parent 20d10b57d6
commit bc9a205b86
6 changed files with 5 additions and 15 deletions
@@ -51,7 +51,10 @@ export class ServerPermissionClient implements PermissionAuthorizer {
const permissionEnabled =
config.getOptionalBoolean('permission.enabled') ?? false;
if (permissionEnabled && !tokenManager.isSecure) {
if (
permissionEnabled &&
(tokenManager as any).isInsecureServerTokenManager
) {
throw new Error(
'You must configure at least one key in backend.auth.keys if permissions are enabled.',
);