diff --git a/eventstream.go b/eventstream.go index f5afb27..1eede60 100644 --- a/eventstream.go +++ b/eventstream.go @@ -35,8 +35,9 @@ const ( eventStreamStdout = "stdout" eventStreamKafka = "kafka" - actorTypeUser = "USER" - actorTypeClient = "CLIENT" + actorTypeUser = "USER" + actorTypeClient = "CLIENT" + actorTypeAnonymous = "ANONYMOUS" ) const ( @@ -541,6 +542,11 @@ func (auditLogBuilder *AuditLogBuilder) IsActorTypeUser(isActorTypeUser bool) *A return auditLogBuilder } +func (auditLogBuilder *AuditLogBuilder) WithAnonymousActorType() *AuditLogBuilder { + auditLogBuilder.actorType = actorTypeAnonymous + return auditLogBuilder +} + func (auditLogBuilder *AuditLogBuilder) ClientID(clientID string) *AuditLogBuilder { auditLogBuilder.clientID = clientID return auditLogBuilder diff --git a/v3/eventstream.go b/v3/eventstream.go index afc4e2e..9836158 100644 --- a/v3/eventstream.go +++ b/v3/eventstream.go @@ -35,8 +35,9 @@ const ( eventStreamStdout = "stdout" eventStreamKafka = "kafka" - actorTypeUser = "USER" - actorTypeClient = "CLIENT" + actorTypeUser = "USER" + actorTypeClient = "CLIENT" + actorTypeAnonymous = "ANONYMOUS" ) const ( @@ -77,7 +78,7 @@ type Event struct { TargetNamespace string `json:"target_namespace,omitempty"` Privacy bool `json:"privacy,omitempty"` Topic string `json:"topic,omitempty"` - SourceNamespace string `json:"sourceNamespace,omitempty"` + SourceNamespace string `json:"sourceNamespace,omitempty"` AdditionalFields map[string]interface{} `json:"additional_fields,omitempty"` Payload map[string]interface{} `json:"payload,omitempty"` @@ -500,6 +501,11 @@ func (auditLogBuilder *AuditLogBuilder) IsActorTypeUser(isActorTypeUser bool) *A return auditLogBuilder } +func (auditLogBuilder *AuditLogBuilder) WithAnonymousActorType() *AuditLogBuilder { + auditLogBuilder.actorType = actorTypeAnonymous + return auditLogBuilder +} + func (auditLogBuilder *AuditLogBuilder) ClientID(clientID string) *AuditLogBuilder { auditLogBuilder.clientID = clientID return auditLogBuilder