From fc7ddae58090d8b15a5f50584958c429031b8f87 Mon Sep 17 00:00:00 2001 From: gnuxie Date: Mon, 17 Oct 2022 13:58:11 +0100 Subject: [PATCH] createServerAcl -> compileServerAcl --- src/ProtectedRooms.ts | 2 +- src/models/AccessControlUnit.ts | 2 +- test/integration/banListTest.ts | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/ProtectedRooms.ts b/src/ProtectedRooms.ts index 11982c9..797baed 100644 --- a/src/ProtectedRooms.ts +++ b/src/ProtectedRooms.ts @@ -300,7 +300,7 @@ export class ProtectedRooms { const serverName: string = new UserID(await this.client.getUserId()).domain; // Construct a server ACL first - const acl = this.accessControlUnit.createServerAcl(serverName); + const acl = this.accessControlUnit.compileServerAcl(serverName); const finalAcl = acl.safeAclContent(); if (this.config.verboseLogging) { diff --git a/src/models/AccessControlUnit.ts b/src/models/AccessControlUnit.ts index de4292a..add6adc 100644 --- a/src/models/AccessControlUnit.ts +++ b/src/models/AccessControlUnit.ts @@ -284,7 +284,7 @@ export default class AccessControlUnit { * @param serverName The name of the server that you are operating from, used to ensure you cannot brick yourself. * @returns A new `ServerAcl` instance with deny and allow entries created from the rules in this unit. */ - public createServerAcl(serverName: string) { + public compileServerAcl(serverName: string): ServerAcl { const acl = new ServerAcl(serverName).denyIpAddresses(); const allowedServers = this.serverAllows.allRules; // Allowed servers (allow). diff --git a/test/integration/banListTest.ts b/test/integration/banListTest.ts index 6256a5d..89660a4 100644 --- a/test/integration/banListTest.ts +++ b/test/integration/banListTest.ts @@ -224,7 +224,7 @@ describe('Test: We will not be able to ban ourselves via ACL.', function() { assert.equal(acl.safeAclContent().deny.length, 1); assert.equal(acl.literalAclContent().deny.length, 3); - const aclUnitAcl = aclUnit.createServerAcl(serverName); + const aclUnitAcl = aclUnit.compileServerAcl(serverName); assert.equal(aclUnitAcl.literalAclContent().deny.length, 1); })