Skip to content

[API v3] Services endpoint #14543

Open
Open

Description

@etj

Why

geonode/services/ has no REST API today -- only classic form views and the harvesting API. This gives it one.

What

  • Full CRUD for services.Service at /api/v3/services/.
  • Registration isn't a plain row insert: Service is a ResourceBase subclass, and creating one probes the remote endpoint and builds a
    harvester. Registration must go through that same path, not a bare serializer create().
  • The service's identity (URL, type) isn't editable after registration; only descriptive metadata is.

Activity

  1. added this to the 5.2.0 milestone on Aug 20, 2026
  2. self-assigned this
    on Aug 20, 2026
  3. changed the title [-][v3 API] Services endpoint[/-] [+][API v3] Services endpoint[/+] on Aug 20, 2026
  4. etj commented on Aug 20, 2026

    @etj
    ContributorAuthor

    Implementation notes:

    • Service is a ResourceBase subclass, not a plain model -- list/retrieve visibility should go through GeoNode's normal per-object guardian check (get_visible_resources()), not a blanket "authenticated users see everything."
    • Registration must delegate to the existing form-based path, not reimplement it. CreateServiceForm is the only place the safe-URL check, the duplicate-base_url check, and the remote probe live -- reimplementing any of them independently risks a security-relevant divergence (e.g. missing the safe-URL check and allowing registration of an internal/unsafe URL). A bare ModelSerializer.create() would produce a Service row with no harvester, no keywords, and no verification the remote endpoint even exists, while looking completely normal over the API.
    • Service.delete() currently always raises -- no ResourceManager is registered for Service, so ResourceBase.delete()'s manager lookup fails with ValueError (see ResourceManagerRegistry.get_for_instance()). The classic UI view avoids this by deleting service.harvester and letting the DB cascade remove the service, which never calls the Python method. The new endpoint needs to do the same (delete the harvester if present; if there is none, use a queryset-level delete, not instance.delete()), or DELETE will crash on any service without a harvester.
    • base_url and type should stay read-only after registration -- they describe what was actually probed and verified; letting them change afterward would let a record silently drift from what was verified.
    • Tests should mock the service handler / remote probe -- the suite shouldn't need a live remote endpoint to pass.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions