createServerAcl -> compileServerAcl

This commit is contained in:
gnuxie 2022-10-17 13:58:11 +01:00
parent 54ef50515d
commit fc7ddae580
3 changed files with 3 additions and 3 deletions

View File

@ -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) {

View File

@ -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).

View File

@ -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);
})