Skip to content

feat(cloud-registry): add getMe() for FOCA's /me #449

Open

Description

@uniqueg

Why?

FOCA-based services have a GET /me endpoint, starting with cloud-registry 0.4.0. It returns the current user's ID, their admin flag and their roles on resources:

{"user_id": "...", "admin": false, "services": [{"service_id": "...", "role": "owner", "group": "..."}]}

Apps need it to show actions by role, e.g., edit for owners and maintainers, delete for owners and admins. Neither the Cloud Registry provider nor its types cover it. So the Cloud Registry UI adds its own getMe() and Me type (elixir-cloud-aai/cloud-registry-ui#12).

Mid-term, the components should be layered:

  • GA4GH Service Registry components;
  • Cloud Registry components built on them;
  • components for features that all FOCA apps share, such as /me and the permissions endpoints (GET/PUT/DELETE /services/{id}/permissions[/{userId}]).

This issue is a first step towards the last group.

What?

  • Add getMe() and exported types for its response, either to the Cloud Registry provider or to a shared provider for FOCA features that the Cloud Registry provider extends.
  • Keep the types generic enough for other FOCA apps (resource IDs and roles).

Acceptance criteria

  • Apps can call getMe() on the package's provider and use its exported types.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions