Consent notes while testing

Cantor, Scott cantor.2 at osu.edu
Mon Nov 17 18:59:47 EST 2014


On 11/17/14, 10:24 PM, "Tom Zeller" <tzeller at dragonacea.biz> wrote:


>
>I took some notes on what uApprove, uApprove-JP, and PrivacyLens were
>auditing, because the latter forks made some changes, but I don't
>recall details at the moment. I suggest that I do that work since I
>have made some progress on it.

That's fine.

> If you want to setup some auditing
>infrastructure for consent, that's fine with me and would be helpful.

The main thing is, do we add fields to the existing records, or do we log 
separate records? When I responded earlier I was thinking add fields. 
After the drive home, I'm thinking maybe we just make it separate, which 
means just duplicating more or less the approach I used but hanging the 
AuditContext for this off the ConsentContext probably instead of using the 
one at the top, which will be "in use" for the existing audit record.

Basically what I did for auditing:

The AuditContext just contains a multimap of field tokens to data. The 
auditing layer doesn't care what any fields mean, it just tracks the data 
as things go along, and then the flow calls an action to actually write 
out the record at some point.

There's a map of category strings to format strings in audit.xml, and the 
audit bean just applies the formatting to the field multumap to generate 
the record, and sends it to the logging category.


The "fancy" part was that I created an action to populate audit fields 
that takes a map of field labels to functions, and it calls the functions 
to populate the fields. So you extend the thing by adding your own 
functions into maps that are injected into the populate actions, rather 
than having to write entire Spring actions to add new fields.

I don't know that anything that extensive is needed here. If we just did 
"separate" audit records, you would have an action that populates the 
AuditContext and one that writes it, and the format string would probably 
be custom for that particular intercept flow (or maybe both the "consent" 
flows share something because they're similar).

The category would likely be custom also, so we'd send it to a separate 
log file by default.

-- Scott



More information about the dev mailing list