Adding DNS settings for accounts (#655)

Allow users to set groups in which the DNS management is disabled

Added API, activity store, and network map sync test
This commit is contained in:
Maycon Santos
2023-01-17 17:34:40 +01:00
committed by GitHub
parent 2bc3d88af3
commit 12ae2e93fc
14 changed files with 805 additions and 38 deletions

View File

@ -3,6 +3,8 @@ package server
import (
"fmt"
"github.com/netbirdio/netbird/management/server/activity"
log "github.com/sirupsen/logrus"
"time"
)
// GetEvents returns a list of activity events of an account
@ -31,3 +33,17 @@ func (am *DefaultAccountManager) GetEvents(accountID, userID string) ([]*activit
return filtered, nil
}
func (am *DefaultAccountManager) storeEvent(initiatorID, targetID, accountID string, activityID activity.Activity, meta map[string]any) {
_, err := am.eventStore.Save(&activity.Event{
Timestamp: time.Now(),
Activity: activityID,
InitiatorID: initiatorID,
TargetID: targetID,
AccountID: accountID,
Meta: meta,
})
if err != nil {
log.Errorf("received an error while storing an activity event, error: %s", err)
}
}