feat(auth): add skip persistence context key for file watcher events

Introduce `WithSkipPersist` to disable persistence during Manager Update/Register calls, preventing write-back loops caused by redundant file writes. Add corresponding tests and integrate with existing file store and conductor logic.
This commit is contained in:
Luis Pater
2026-01-26 18:20:19 +08:00
parent 2af4a8dc12
commit 9c341f5aa5
5 changed files with 92 additions and 40 deletions

View File

@@ -1642,6 +1642,9 @@ func (m *Manager) persist(ctx context.Context, auth *Auth) error {
if m.store == nil || auth == nil {
return nil
}
if shouldSkipPersist(ctx) {
return nil
}
if auth.Attributes != nil {
if v := strings.ToLower(strings.TrimSpace(auth.Attributes["runtime_only"])); v == "true" {
return nil