Repository navigation
store username in the audit table #211
Description
Activity
we discovered yesterday that there are a number of calls that don't provide this info. A number of requests don't obtain their audit information from a parent -- they just create it on their own. One example would be the root request:
https://github.com/ohmage/server/blob/master/src/org/ohmage/request/Request.java#L341
this line should be modified to:
Map<String, String[]> auditInfo = super.getAuditInformation();this happens for a number of requests, all of which should be changed.
- added a commit that references this issue
on Mar 27, 2014 @joshuaselsky it looks like
mobility/readis still neglecting to store/return the username field. I don't see a similarauditInfovariable in the file to look at though. Does the change need to be made in the root request, maybe?
https://github.com/ohmage/server/blob/master/src/org/ohmage/request/Request.java#L341mobility/readspawns two child requests, StreamReadRequests to be specific. Each of these will check the auth information, which is really the only difference between a Request and a UserRequest. Probably, when I designed this I changed MobilityReadRequest from a UserRequest into just a Request so that the auth information was only checked twice instead of three times.To fix this, you can override
getAuditInformation()in MobilityReadRequest that calls the two child requests, aggregates their entries, and returns that aggregation. (Don't forget to also callsuper.getAuditInformation()and aggregate that as well.) While there will be duplicate entries in the two requests' audit information maps, these can safely be overwritten. If you wanted to be extra safe, you can merge them in a way that would aggregate rather than overwrite, but then you will also want to make sure that you don't create duplicates.@hongsudt maybe you can do a quick sanity check while working on 2.17.1 to make sure all APIs are storing the user string in the audit log?
This will allow us to retrieve activities based on a username.