Skip to content
Permalink
Branch: master
Commits on Apr 16, 2019
  1. Upgrade Sangria to 1.4.2 and slowlog to 0.1.8 (#268)

    cliu587 committed Apr 16, 2019
Commits on Feb 27, 2019
  1. Throw exceptions on failures during JSON deserialization (#267)

    dguo-coursera committed Feb 27, 2019
    * Revert "Log warning instead of throwing an exception if materialization fails during JSON deserialization"
    
    This reverts commit 8ee2594.
    
    * Version bump
Commits on Feb 21, 2019
  1. Register input type in schema for PATCH method (#266)

    amory-coursera committed Feb 21, 2019
    * Register input type schema for PATCH method
    
    * bump version
Commits on Dec 11, 2018
  1. add ability to create NaptimeActionExceptions with a cause (#265)

    fyi-coursera committed Dec 11, 2018
    * add ability to create NaptimeActionExceptions with a cause
Commits on Dec 7, 2018
  1. wrap thrown NaptimeActionExceptions in errorHandler and log RestError… (

    fyi-coursera committed Dec 7, 2018
    #264)
    
    * wrap thrown NaptimeActionExceptions in errorHandler and log RestErrors with code >=500
Commits on Oct 12, 2018
  1. Rename naptime.Fields to ResourceFields (#259)

    brandontram-coursera authored and yifan-coursera committed Oct 12, 2018
    * Rename naptime.Fields to ResourceFields
    
    * Rename naptime.Fields to ResourceFields
    
    * fix unit tests
    
    * fix unit tests
    
    * Rename naptime.Fields to ResourceFields
    
    * Rename naptime.Fields to ResourceFields
    
    * fix unit tests
    
    * fix unit tests
    
    * Update NestedMacroCourierTests.scala
Commits on Oct 9, 2018
  1. extract out runAuthAndBody so that it can be overridden by applicatio…

    fyi-coursera authored and yifan-coursera committed Oct 9, 2018
    …ns (#263)
Commits on Sep 26, 2018
  1. Fixing union field builder if member is a typeref. (#262)

    ptbarthelemy committed Sep 26, 2018
    * Fixing union field builder if member is a typeref or enum.
    * Version bump.
Commits on Sep 11, 2018
  1. Bumping up version to fix partial naptime release

    ptbarthelemy committed Sep 11, 2018
  2. Fixing field builder for passthrough exempt fields. (#261)

    ptbarthelemy committed Sep 11, 2018
    * Fixing field builder for passthrough exempt fields.
    * Version bump.
Commits on Aug 7, 2018
  1. Eradicate reverse relation nomenclature in Naptime (#260)

    cliu587 committed Aug 7, 2018
Commits on Jun 18, 2018
  1. Allow public access to typeref union CourierFormats methods (#258)

    dguo-coursera committed Jun 18, 2018
    * Expose typeref union CourierFormats methods
    
    * Version bump
Commits on Jun 14, 2018
  1. Allow public access to jsObjectToUnion and unionToJsObject (#257)

    dguo-coursera committed Jun 14, 2018
    * Allow public access to jsObjectToUnion and unionToJsObject
    
    * Version bump
Commits on May 24, 2018
  1. Bump version to 0.9.2-alpha14

    yifan-coursera committed May 24, 2018
  2. Don't throw exception if materialization fails during JSON deserializ…

    yifan-coursera committed May 24, 2018
    …ation (#256)
    
    * Log warning instead of throwing an exception if materialization fails during JSON deserialization
Commits on May 23, 2018
  1. Materialize model during JSON deserialization (#255)

    yifan-coursera committed May 23, 2018
    * Materialize JSON parsed bodies
Commits on May 22, 2018
  1. Rename fields that were previously of type CustomBodyType (#254)

    amory-coursera committed May 22, 2018
    * Rename fields that were previously of type CustomBodyType for backward compatibility
    
    * fix tests
Commits on May 21, 2018
  1. Add body-dependent authorization capability to Rest action handler (#252

    amory-coursera committed May 21, 2018
    )
    
    Coursera authorization rules are often context-dependent. For example, only university staff can create and modify courses for a particular university. When this context is present as a rest handler method argument (e.g. get(id: CourseId) = Rest ... or update(id: CourseId) = Rest ...), it's straightforward to define context-aware authorizers (e.g. Rest.auth(canManageCourse(id)...). Unfortunately, however, we frequently put necessary authorization context data into request bodies (e.g. create() = Rest.jsonBody[Course].create { ... }), and in these cases authorization logic must be implemented within handler bodies.
    
    In the Coursera code base there are 207 applications for runAndCheck (authorizers used outside of an auth block) and 307 instances of throw Errors.Forbidden (ad-hoc authorization application). These non-standard usages are problematic because they make it harder to know what a resource's behavior will be from outside, both as a developer and for automated tooling.
    
    This revision modifies RestAction to accept either a simple HeaderAccessControl[AuthType] authorizer, or a body-dependent BodyType => HeaderAccessControl[AuthType] authorization expressions. This should make it possible for us to standardize many of our non-standard auth applications.
    
    Note that, at least for Coursera, this change is not backward compatible, since our private code base has its own implementations of RestActionBuilder, which will need to be updated.
Commits on May 19, 2018
Commits on May 17, 2018
  1. Remove AkkaHttp from dependencies (#253)

    dguo-coursera committed May 17, 2018
    * Remove AkkaHttp from dependencies
    
    * Version Bump
Commits on May 9, 2018
  1. Fix up macros so that custom request and response types are visible i…

    amory-coursera committed May 9, 2018
    …n schemas (#247)
    
    * Fix up macros to define custom request and response types
    
    We're exploring code generation based on Naptime resource schema definitions. While attempting to write generators for clients, I found that some fields in the Handler schema were not being generated. This revision fixes TODOs in macro generators, adds an additional authType fields (which is important so that clients no about header preconditions), and unwraps / removes the un-used CustomBodyType.courier union, which seems to anticipate future features (e.g. arbitrary blob return types) that are unlikely to be built.
Commits on May 4, 2018
  1. Fix bad rebase, take 2 (#250)

    cliu587 committed May 4, 2018
    * Revert "Add scalafmt plugin and apply to project (#246)"
    
    This reverts commit fae3a22.
    
    * Add plugins and files for scalafmt
    
    * Bump up version
    
    * Scalafmt formats
Commits on May 3, 2018
  1. Introduce Related Resource Auth Override (#248)

    mbarackman-coursera committed May 3, 2018
    * Introduce Related Resource Auth Override
    
    - This change allows API developers to create related resources that are fetched with “internal” auths.
    
    - This is done by adding an authOverride value to the reverse relation definition on the primary resource.
    
    - The purpose of this is to give developers the option to do authentication in only one place, the entry/parent resource, and use internal auth for all the related/child resources. This allows the child resources to be a bit more re-usable in that they can be attached to multiple parent resources that may all have different auth schemes.
Commits on May 2, 2018
  1. Add scalafmt plugin and apply to project (#246)

    cliu587 committed May 2, 2018
    * Add scalafmt plugin and apply to project
    
    * Address comments
    
    * Address comments
Commits on Apr 12, 2018
  1. Fix interpolating into nested ids which requires the original DataMap…

    cliu587 committed Apr 12, 2018
    … to be kept using passthroughEnabled flag (#242)
Commits on Apr 10, 2018
  1. Remove throws from inside Errors.X helpers (#241)

    mkovacs-coursera committed Apr 10, 2018
    * remove throws from inside Errors.X helpers
    
    * bump version
  2. Bump version to 0.9.2-alpha6

    tanonev committed Apr 10, 2018
  3. allow public access to jsObjectToRecord (#240)

    tanonev committed Apr 10, 2018
    * allow public access to jsObjectToRecord
    
    * allow public access to recordToJsObject
Commits on Apr 6, 2018
  1. fix issue with Naptime serialization of DataMap not working with type…

    cliu587 committed Apr 6, 2018
    …d definition interpolations (#239)
    
    * fix issue with Naptime serialization of DataMap not working with typed definition interpolations
    
    * Get rid of extraneous logging statement
Commits on Apr 5, 2018
  1. Do not attempt to fetch GetAlls accidently by adding logic to not gra…

    cliu587 committed Apr 5, 2018
    …b results when no id value is given (#238)
    
    * Do not attempt to fetch GetAlls accidently by adding logic to not grab results when no id value is given
    
    * Don't have separate no id logic
    
    * Bump version
  2. Use Try to be safe to NPEs, and no-op when id interpolation did not f…

    cliu587 committed Apr 5, 2018
    …ind an id (#237)
    
    * Use Try to be safe to NPEs, and no-op when id interpolation did not find an id
    
    * Add some better logging and fixed logic
    
    * add logic and extra test for multiple interpolation
Commits on Apr 4, 2018
  1. GraphQL relation id interpolation to allow for ids as fields nested i…

    cliu587 authored and dguo-coursera committed Apr 4, 2018
    …n arrays of records (#232)
    
    * GraphQL relation id interpolation to allow for ids as fields nested in arrays of records
    
    * Fix additional test
    
    * Merge master and bump up version
    
    * address comments
Commits on Apr 3, 2018
  1. Fix Re-ordering of Related Resource Ids (#236)

    mbarackman-coursera committed Apr 3, 2018
    * Fix Re-ordering of Ids
    
    - After merging a recent fix that de-duplicated ids we found that related resource `elementIds` and `elements` arrays were being re-ordered in a non-deterministic way after every request.
    
    - In particular our moduleIds were being re-ordered and the order has actual meaning. It turns out that the previous de-duplication fix had introduced sets and hence this non-determinism.
    
    - I’ve replaced the Set introduced in parseIds with a Seq and this has corrected the problem.
    
    * add space
    
    * add comment
Commits on Mar 28, 2018
  1. Deduplicate MultiGet Ids (#235)

    mbarackman-coursera committed Mar 28, 2018
    * Reduplicate MultiGet Ids
    
    This solves a bug where the resolver fails to properly de-duplicate multiGet ids when combining multiGets from multiple child related elements.
    
    Instead of breaking multiGet ids strings into their constituent ids and de-duplicating the individual ids, it was de-duplicating the entire multiget ids strings for all requests.
    
    so for this request:
    
    [
      {teamId: 1, memberIds: [1,2,3]},
      {teamId: 2, memberIds: [1,2,3]},
      {teamId: 3, memberIds: [2,3,4]}
    ]
    
    it would have made these requests
    
    members.v1?ids=1,2,3
    members.v1?ids=1,2,3
    members.v1?ids=2,3,4
    
    but the resolver attempts to combine multiple multigets into a single multiget, which in this case produces the following (which is incorrect):
    
    members.v1?ids=1,2,2,3,3,4
    
    
    To it’s credit, the backend only return individual member elements, like:
    
    [{memberId: 1},{memberId: 2}, {memberId: 3}. {memberId: 4}]
    
    
    But the resolver then iterates over the previously combined id string 1,2,2,3,3,4 post-query to populate the child elements resulting in duplicates in the final response body:
    
    [
      {
        "teamId": 1,
        "memberIds": [1,2,3],
        "members": [
          {"memberId": 1},
          {"memberId": 2},
          {"memberId": 2},
          {"memberId": 3},
          {"memberId": 3}
        ]
      },
      {
        "teamId": 2,
        "memberIds": [1,2,3],
        "members": [
          {"memberId": 1},
          {"memberId": 2},
          {"memberId": 2},
          {"memberId": 3},
          {"memberId": 3}
        ]
      },
      {
        "teamId": 3,
        "memberIds": [2,3,4],
        "members": [
          {"memberId": 2},
          {"memberId": 2},
          {"memberId": 3},
          {"memberId": 3},
          {"memberId": 4}
        ]
      }
    ]
    
    This diff both de-dupes the ids before the request is made and de-dupes the ids again post-request to ensure that we end up with:  
    
    members.v1?ids=1,2,3,4
    
    
    [
      {
        "teamId": 1,
        "memberIds": [1,2,3],
        "members": [
          {"memberId": 1},
          {"memberId": 2},
          {"memberId": 3}
        ]
      },
      {
        "teamId": 2,
        "memberIds": [1,2,3],
        "members": [
          {"memberId": 1},
          {"memberId": 2},
          {"memberId": 3}
        ]
      },
      {
        "teamId": 3,
        "memberIds": [2,3,4],
        "members": [
          {"memberId": 2},
          {"memberId": 3},
          {"memberId": 4}
        ]
      }
    ]
    
    Note: It’s likely not necessary to do the de-duping twice, but it mirrored the original implementation and seemed like it wouldn’t hurt.
    
    * Tighten up Naptime Resolver Code Changes
    
    * Update Method Name
    
    * bump version
Commits on Mar 27, 2018
  1. Fix flaky naptime test by adding IntegrationPatience (#231)

    cliu587 committed Mar 27, 2018
Older
You can’t perform that action at this time.