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:
@@ -3,11 +3,19 @@ package acl
|
||||
import (
|
||||
"git.mleku.dev/mleku/nostr/encoders/event"
|
||||
acliface "next.orly.dev/pkg/interfaces/acl"
|
||||
"next.orly.dev/pkg/mode"
|
||||
"next.orly.dev/pkg/utils/atomic"
|
||||
)
|
||||
|
||||
var Registry = &S{}
|
||||
|
||||
// SetMode sets the active ACL mode and syncs it to the mode package for
|
||||
// packages that need to check the mode without importing acl (to avoid cycles).
|
||||
func (s *S) SetMode(m string) {
|
||||
s.Active.Store(m)
|
||||
mode.ACLMode.Store(m)
|
||||
}
|
||||
|
||||
type S struct {
|
||||
ACL []acliface.I
|
||||
Active atomic.String
|
||||
|
||||
Reference in New Issue
Block a user