mirror of
https://github.com/netbirdio/netbird.git
synced 2026-04-18 08:16:39 +00:00
clear userID from access logs if not oidc
This commit is contained in:
@@ -9,6 +9,7 @@ import (
|
|||||||
"google.golang.org/grpc"
|
"google.golang.org/grpc"
|
||||||
"google.golang.org/protobuf/types/known/timestamppb"
|
"google.golang.org/protobuf/types/known/timestamppb"
|
||||||
|
|
||||||
|
"github.com/netbirdio/netbird/proxy/auth"
|
||||||
"github.com/netbirdio/netbird/shared/management/proto"
|
"github.com/netbirdio/netbird/shared/management/proto"
|
||||||
)
|
)
|
||||||
|
|
||||||
@@ -65,6 +66,9 @@ func (l *Logger) log(ctx context.Context, entry logEntry) {
|
|||||||
go func() {
|
go func() {
|
||||||
logCtx, cancel := context.WithTimeout(context.Background(), 10*time.Second)
|
logCtx, cancel := context.WithTimeout(context.Background(), 10*time.Second)
|
||||||
defer cancel()
|
defer cancel()
|
||||||
|
if entry.AuthMechanism != auth.MethodOIDC.String() {
|
||||||
|
entry.UserId = ""
|
||||||
|
}
|
||||||
if _, err := l.client.SendAccessLog(logCtx, &proto.SendAccessLogRequest{
|
if _, err := l.client.SendAccessLog(logCtx, &proto.SendAccessLogRequest{
|
||||||
Log: &proto.AccessLog{
|
Log: &proto.AccessLog{
|
||||||
LogId: entry.ID,
|
LogId: entry.ID,
|
||||||
|
|||||||
Reference in New Issue
Block a user