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

Add RESTful API endpoints for Groups customizations #570

Merged
merged 7 commits into from
Sep 28, 2022

Commits on Sep 20, 2022

  1. Upgrade @aws-sdk/client-cognito-identity-provider so we can import ex…

    …ception classes
    
    Otherwise we have to do string comparison on the exception names instead
    of cleaner instanceof checks.
    
    I was confused for a bit because the documentation says you can import
    these classes but that wasn't working in practice when I first tried it.
    Turns out we require 3.52.0 and the classes weren't exported until
    3.53.0, just one release later!
    tsibley authored and victorlin committed Sep 20, 2022
    Configuration menu
    Copy the full SHA
    6d88614 View commit details
    Browse the repository at this point in the history

Commits on Sep 21, 2022

  1. Update jest to version 27

    Jest version 26 does not play well with ESM circular dependencies (to be
    added in future commits) that work fine in production. Errors look like:
    
        RangeError: Maximum call stack size exceeded
        Exception in PromiseRejectCallback:
        internal/vm/module.js:321
                const module = await linker(identifier, this);
    
    These errors go away with the next major version (27).
    victorlin committed Sep 21, 2022
    Configuration menu
    Copy the full SHA
    6ef1ec2 View commit details
    Browse the repository at this point in the history
  2. Add Group objects to the authz system

    For actions on the group itself (e.g. membership management) rather than
    the group's Source of datasets and narratives.
    tsibley authored and victorlin committed Sep 21, 2022
    Configuration menu
    Copy the full SHA
    bf7eecf View commit details
    Browse the repository at this point in the history
  3. Establish /groups/:groupName/settings/… route namespace for endpoints

    The Group management API (members, roles, overview, logo, etc) will live
    under here.  Using a single namespace (…/settings/…) means we only add a
    single new forbidden prefix for user-chosen dataset names in the group
    (i.e. in addition to the existing …/narratives/… namespace).
    
    Routes under this namespace are only visible to users with Read access
    to the Group itself (not the GroupSource), i.e. access is limited to
    group members even for public groups.
    tsibley authored and victorlin committed Sep 21, 2022
    Configuration menu
    Copy the full SHA
    833ea30 View commit details
    Browse the repository at this point in the history
  4. Add Group.source property

    Previously, only GroupSource.group was available. Having the inverse,
    Group.source, allows for more direct access.
    
    However, maintaining both of these properties in the object constructors
    results in a bad cyclic dependency. Since GroupSource.group is already
    set in its constructor, adding Group.source as a computed property.
    
    Update existing code to use this new property as a shortcut to create
    new GroupSource instance.
    victorlin committed Sep 21, 2022
    Configuration menu
    Copy the full SHA
    c327545 View commit details
    Browse the repository at this point in the history

Commits on Sep 27, 2022

  1. Move code handling upstream URL requests to its own file

    This allows for reuse later with other endpoints.
    
    DELETE: Extract the logic of creating multiple DELETE requests in
    deleteResource to its own function.
    
    GET: Extract the call to proxyResponseBodyFromUpstream in
    sendSubresource to its own function.
    
    PUT: Extract the logic of creating a PUT request in receiveSubresource
    to its own function. This requires a new type, upstreamUrlExtractor, to
    be used since the URL for these requests are dependent on the method and
    headers, which are defined in the new function.
    victorlin committed Sep 27, 2022
    Configuration menu
    Copy the full SHA
    ccb98c3 View commit details
    Browse the repository at this point in the history
  2. Add RESTful API endpoints for customizing Groups

    Read-write access for group owners, read-only access for all other
    members of a group, and no access for non-members.
    victorlin committed Sep 27, 2022
    Configuration menu
    Copy the full SHA
    6b48bc9 View commit details
    Browse the repository at this point in the history