Adjust ACL behavior for "none" mode and make query cache optional
Some checks failed
Go / build-and-release (push) Has been cancelled
Some checks failed
Go / build-and-release (push) Has been cancelled
This commit allows skipping authentication, permission checks, and certain filters (e.g., deletions, expirations) when the ACL mode is set to "none" (open relay mode). It also introduces a configuration option to disable query caching to reduce memory usage. These changes improve operational flexibility for open relay setups and resource-constrained environments.
This commit is contained in:
@@ -54,7 +54,7 @@ func setupTestListener(t *testing.T) (*Listener, *database.D, func()) {
|
||||
}
|
||||
|
||||
// Configure ACL registry
|
||||
acl.Registry.Active.Store(cfg.ACLMode)
|
||||
acl.Registry.SetMode(cfg.ACLMode)
|
||||
if err = acl.Registry.Configure(cfg, db, ctx); err != nil {
|
||||
db.Close()
|
||||
os.RemoveAll(tempDir)
|
||||
@@ -378,7 +378,7 @@ func TestHandleNIP43InviteRequest_ValidRequest(t *testing.T) {
|
||||
// Add admin to config and reconfigure ACL
|
||||
adminHex := hex.Enc(adminPubkey)
|
||||
listener.Server.Config.Admins = []string{adminHex}
|
||||
acl.Registry.Active.Store("none")
|
||||
acl.Registry.SetMode("none")
|
||||
if err = acl.Registry.Configure(listener.Server.Config, listener.Server.DB, listener.ctx); err != nil {
|
||||
t.Fatalf("failed to reconfigure ACL: %v", err)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user