@@ -126,6 +126,11 @@ class StreamActor(
126
126
eventSrv.unsubscribe(self)
127
127
}
128
128
129
+ private def normalizeOperation (operation : AuditOperation ) = {
130
+ operation.entity.model match {
131
+ case am : AuditedModel ⇒ operation.copy(details = am.selectAuditedAttributes(operation.details))
132
+ }
133
+ }
129
134
private def receiveWithState (waitingRequest : Option [WaitingRequest ], currentMessages : Map [String , Option [StreamMessageGroup [_]]]): Receive = {
130
135
/* End of HTTP request, mark received messages to ready*/
131
136
case Commit (requestId) ⇒
@@ -149,17 +154,18 @@ class StreamActor(
149
154
/* */
150
155
case operation : AuditOperation if operation.entity.model.isInstanceOf [AuditedModel ] ⇒
151
156
val requestId = operation.authContext.requestId
152
- logger.debug(s " Receiving audit operation : $operation" )
157
+ val normalizedOperation = normalizeOperation(operation)
158
+ logger.debug(s " Receiving audit operation : $operation => $normalizedOperation" )
153
159
val updatedOperationGroup = currentMessages.get(requestId) match {
154
160
case None ⇒
155
161
logger.debug(" Operation that comes after the end of request, make operation ready to send" )
156
- AuditOperationGroup (auxSrv, operation ).makeReady // Operation that comes after the end of request
162
+ AuditOperationGroup (auxSrv, normalizedOperation ).makeReady // Operation that comes after the end of request
157
163
case Some (None ) ⇒
158
164
logger.debug(" First operation of the request, creating operation group" )
159
- AuditOperationGroup (auxSrv, operation ) // First operation related to the given request
165
+ AuditOperationGroup (auxSrv, normalizedOperation ) // First operation related to the given request
160
166
case Some (Some (aog : AuditOperationGroup )) ⇒
161
167
logger.debug(" Operation included in existing group" )
162
- aog :+ operation
168
+ aog :+ normalizedOperation
163
169
case _ ⇒
164
170
logger.debug(" Impossible" )
165
171
sys.error(" " )
0 commit comments