Skip to content

feat: register and control service types #235

Closed

Description

@uniqueg

Why?

GET /services/types lists the distinct types of the registered services. Types aren't stored, so:

  • a type can't be registered before a service uses it;
  • any user who registers a service with a new type adds that type;
  • registries can't offer a curated list of types (e.g., org.ga4gh · tes · 1.1.0) for clients to pick from.

What?

  • Store service types ({group, artifact, version}) in their own collection.
    • POST /services/types registers one.
    • DELETE /services/types with the type in the body, or an equivalent path design consistent with the API, removes one. Only admins may remove types, in every mode; users who add types don't own them and can never remove them, since that could invalidate other people's services. Removing a type that registered services still use is refused (409, detail: "Service type is in use. If you really want to revoke it, edit or delete all services that depend on it.").
    • Both are extensions of the GA4GH API, in additions.openapi.yaml.
  • GET /services/types lists the stored types.
    • A one-off, idempotent migration seeds them from the types of existing services, so nothing disappears on upgrade.
  • A configuration option for who may add types (both are generic, for any deployment):
    • open (the current behaviour): any logged-in user may add types, explicitly via POST /services/types or implicitly by registering or updating a service with a new type, which is then stored.
    • controlled: only admins may add types. Services from non-admins must use a stored type (400 with a clear detail otherwise). Admins are exempt, and their new types are stored.
    • Choose the default that keeps the current behaviour; document both.
  • GET /me tells clients whether the caller may add types (e.g., may_add_service_types), so UIs can offer "Add new service type" only when it works.

Out of scope: a "pending" mode where users request new types and admins approve them in-app.

Acceptance criteria

  • Admins can register and remove service types before any service uses them.
  • In controlled mode, non-admins can only register services with stored types, and they can't add types.
  • Clients can tell from GET /me whether the caller may add types.

Requested by the maintainer for the Cloud Registry UI (elixir-cloud-aai/cloud-registry-ui#19).

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

    priority: hightype: featureworkload: days

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions