Skip to content

store username in the audit table #211

Description

@hongsudt

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

Activity

  1. ghost assigned on Feb 22, 2012
  2. stevenolen commented on Mar 27, 2014

    @stevenolen
    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.

  3. added a commit that references this issue on Mar 27, 2014
    e42a38a
  4. stevenolen commented on Mar 31, 2014

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

  5. jojenki commented on Mar 31, 2014

    @jojenki
    Contributor

    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.

  6. stevenolen commented on Oct 23, 2015

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

  7. modified the milestones: ohmage 2.10, on Oct 23, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions