Update policy management and documentation
- Bumped the version of the `lol.mleku.dev` dependency from v1.0.3 to v1.0.4. - Removed redundant checks for disabled policy in event handling. - Introduced a `default_policy` field in the policy configuration, allowing for more flexible event handling based on default behaviors. - Enhanced documentation to clarify the default policy logic and its implications on event processing. - Updated tests to validate the new default policy behavior and ensure correct fallback mechanisms are in place.
This commit is contained in:
@@ -112,17 +112,6 @@ func (l *Listener) HandleEvent(msg []byte) (err error) {
|
||||
|
||||
// Check if policy is enabled and process event through it
|
||||
if l.policyManager != nil && l.policyManager.Manager != nil && l.policyManager.Manager.IsEnabled() {
|
||||
if l.policyManager.Manager.IsDisabled() {
|
||||
// Policy is disabled due to failure - reject all events
|
||||
log.W.F("policy is disabled, rejecting event %0x", env.E.ID)
|
||||
if err = Ok.Error(
|
||||
l, env,
|
||||
"policy disabled - events rejected until policy is restored",
|
||||
); chk.E(err) {
|
||||
return
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
// Check policy for write access
|
||||
allowed, policyErr := l.policyManager.CheckPolicy("write", env.E, l.authedPubkey.Load(), l.remote)
|
||||
|
||||
Reference in New Issue
Block a user