Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

store username in the audit table #211

Open
hongsudt opened this issue Feb 22, 2012 · 4 comments
Open

store username in the audit table #211

hongsudt opened this issue Feb 22, 2012 · 4 comments
Milestone

Comments

@hongsudt
Copy link
Member

This will allow us to retrieve activities based on a username.

@ghost ghost assigned jojenki Feb 22, 2012
@stevenolen
Copy link
Member

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.

@stevenolen
Copy link
Member

@joshuaselsky it looks like mobility/read is still neglecting to store/return the username field. I don't see a similar auditInfo variable 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#L341

@stevenolen stevenolen reopened this Mar 31, 2014
@jojenki
Copy link
Contributor

jojenki commented Mar 31, 2014

mobility/read spawns 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.

https://github.com/ohmage/server/blob/master/src/org/ohmage/request/mobility/MobilityReadRequest.java#L130-131

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 call super.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.

@stevenolen
Copy link
Member

@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?

@stevenolen stevenolen modified the milestones: ohmage 2.10, 2.17.1 Oct 23, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants