Hi Robert, On 10.09.20, 19:01, "Robert Munteanu" <[email protected]> wrote: > I am trying to get commit origin information in an Editor ( well, > Validator actually ). The scenario is that I want to log writes to paths > that should belong to the immutable mount (/libs, /apps) in a composite > setup when preparing. The intercept is done simply to analyse who writes > to /libs and /apps and report unexpected writes. > > What I am doing right now is create a ValidatorProvider and record all > the childNodeXXX operations. In the 'leave' method of the root validator > I am doing the logging and walking up the current thread's stack trace > to eliminate 'permitted' callers, like repoinit and the FileVault > package installer. > > Is this approach sound at a high-level? Is there a better way of getting > the commit 'origin'?
It depends how you define 'origin'. Alternatively, if 'origin' is more about _who_ writes, then your validator could use CommitInfo passed to ValidatorProvider.getRootValidator(). E.g. the CommitInfo contains the userId of the session that performs the write operation. But I guess you are more interested in the code that invokes the write operation. Regards Marcel
