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 #547

Closed
tsibley opened this issue Jun 1, 2022 · 0 comments · Fixed by #570
Closed

Add RESTful API endpoints for Groups customizations #547

tsibley opened this issue Jun 1, 2022 · 0 comments · Fixed by #570
Assignees

Comments

@tsibley
Copy link
Member

tsibley commented Jun 1, 2022

The goal is to allow for Groups using the new multi-tenant backend storage to self-manage logo and overview customizations previously managed via the special-cased files group-logo.png and group-overview.md.

Proposal

As a starting proposal, consider two new routes (exact paths up for discussion) × three methods (GET, PUT, DELETE) for six new endpoints:

/groups/:groupName/logo

    GET                           → 200 OK (Content-Type: image/png)
    PUT (Content-Type: image/png) → 204 No Content
    DELETE                        → 204 No Content

/groups/:groupName/overview

    GET                               → 200 OK (Content-Type: text/markdown)
    PUT (Content-Type: text/markdown) → 204 No Content
    DELETE                            → 204 No Content

These are just the "happy paths". 401/403/404 should also be returned as appropriate.

Implementation considerations

  • If using the proposed routes, then they should come before more generic routes for datasets. Or, it might be preferable to change the routes instead to avoid conflict with user-provided paths, e.g. to /groups/:groupName/-/logo or similar. Settled on using the /groups/:groupName/settings namespace going forwards: Add RESTful API for managing Groups members #581 (comment)

  • I don't think we need custom media types here but this could be discussed.

  • Ok to accept just image/png for now. We can expand this in the future to more image/* types.

  • The storage of this data can remain objects like group-overview.md, but we should ensure it can't conflict with other group data, like narratives. For example, /groups/…/narratives/group-overview shouldn't be able to touch the content uploaded for the group overview customization.

    This can likely be accomplished several ways. The best might be a layout change to the backend storage so that datasets and narratives live under a further prefix of the per-group prefix, e.g. s3://nextstrain-groups/blab/datasets/zika.json instead of s3://nextstrain-groups/blab/zika.json, so that the top-level is reserved for internal control data. I have a local prototype of this if we want to pursue that. Done in Prepare for adjusting the layout of the multi-tenant groups bucket #563 and Adjust layout of multi-tenant groups bucket #562.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
No open projects
Development

Successfully merging a pull request may close this issue.

2 participants