...
Audit service will be parsing all the persister configs so that it can process data received by the persister and create audit logs out of it.
Setup:
Step 1: Add the following metrics to the existing persister configs -
Code Block isAuditEnabled: true module: PGR objecIdJsonPath: $.id tenantIdJsonPath: $.tenantId transactionCodeJsonPath: $.transactionCode auditAttributeBasePath: $.service
*** Please note that auditAttributeBasePath has to be the same as the parent objects path. For example, in case of bulk objects, auditAttributeBasePath will be $.Licenses.*
and in case of single object payload, it will be $.service
.
*** Also, the other jsonPaths like objectIdJsonPath, tenantIdJsonPath, transactionCodeJsonPath are all written with respect to a single object i.e. it does not matter in case of these attributes whether the incoming payload contains objects in bulk or singular objects.
Step 2: If a custom implementation of
ConfigurableSignAndVerify
interface is present, provide the signing algorithm implementation name as a part ofaudit.log.signing.algorithm
property. For example, if the signing algorithm is HMAC, the property will be set as follows -Code Block audit.log.signing.algorithm=HMAC
Step 3: Set
egov.persist.yml.repo.path
this property to the location of persister configs.Step 4: Run the audit-service application along with persister service.
Definitions:
Config file - A YAML (xyz.yml) file which contains persister configuration for running audit service.
API - A REST endpoint to post audit logs data.
...