Skip to content

Add userinfo, permissions, wms handlers and async-execution polling#131

Open
mwallschlaeger wants to merge 1 commit into
GeoNodeUserGroup-DE:mainfrom
geosolutions-it:feature/validator-additions
Open

Add userinfo, permissions, wms handlers and async-execution polling#131
mwallschlaeger wants to merge 1 commit into
GeoNodeUserGroup-DE:mainfrom
geosolutions-it:feature/validator-additions

Conversation

@mwallschlaeger

@mwallschlaeger mwallschlaeger commented May 28, 2026

Copy link
Copy Markdown
Member

Adds the following features:

  • GeonodeUserInfoHandler.get() — wraps /api/v2/userinfo, exposes the identity claims plus the session access_token used downstream by GeoServer.
  • GeonodePermissionsHandler.{get,set,wait_for_completion} — wraps the GET/PUT /api/v2/resources/{pk}/permissions endpoints. PUT is asynchronous (returns execution_id + status_url); callers can poll the execution to completion before relying on the new permission state.
  • GeonodeWmsHandler.get_map() — issues WMS GetMap against the GeoNode-managed GeoServer. Sends no auth header because GeoServer's user realm rejects the Django Basic Auth credentials; the OAuth2 access_token query parameter (from /userinfo) is the credential.
  • GeonodeExecutionRequestHandler.wait_for_completion(exec_id) — public polling primitive shared by uploads, async deletes, and permission changes. Raises GeoNodeRestException on failed or timeout.
  • GeonodeResourceHandler.delete_async(pk) + wait_for_completion — the async sibling of the existing synchronous delete; returns the {status, execution_id, status_url} receipt so callers can confirm removal before downstream assertions.
  • GeonodeRest.http_put() — fills the missing verb so PUT-style endpoints (permissions, future settings) can be hit without a custom requests call.
  • GeonodeRest.http_get_anonymous() — issues a GET with no session credentials, returning the raw Response so callers can inspect 401/403 outcomes that are the expected result of a probe.

Also refactors the existing private GeonodeDatasetsHandler.wait_for_upload to delegate to the new public wait_for_completion, removing the duplicated polling loop.

Description

A brief description of the feature or bug that this pull request addresses.

Type of Change

Please select the relevant option:

  • Bug fix
  • New feature
  • Documentation update
  • Refactoring
  • Release
  • Other (please describe)

Related Issue

If there is an existing issue related to this pull request, please reference it here.

closes #

Checklist

Please ensure that your pull request meets the following requirements:

  • The pull request is limited to one type (docs, feature, bug fix, etc.)
  • The pull request is as small as possible. Consider opening multiple pull requests instead of one large one.
  • The feature or bug fix has been discussed and documented in an issue beforehand.

Additional Notes

Any additional information or context regarding the pull request can be provided here.

Thank you for creating this pull request

Adds the following features:

- GeonodeUserInfoHandler.get() — wraps /api/v2/userinfo, exposes the
  identity claims plus the session access_token used downstream by
  GeoServer.
- GeonodePermissionsHandler.{get,set,wait_for_completion} — wraps the
  GET/PUT /api/v2/resources/{pk}/permissions endpoints. PUT is
  asynchronous (returns execution_id + status_url); callers can poll the
  execution to completion before relying on the new permission state.
- GeonodeWmsHandler.get_map() — issues WMS GetMap against the
  GeoNode-managed GeoServer. Sends no auth header because GeoServer's
  user realm rejects the Django Basic Auth credentials; the OAuth2
  access_token query parameter (from /userinfo) is the credential.
- GeonodeExecutionRequestHandler.wait_for_completion(exec_id) — public
  polling primitive shared by uploads, async deletes, and permission
  changes. Raises GeoNodeRestException on `failed` or timeout.
- GeonodeResourceHandler.delete_async(pk) + wait_for_completion — the
  async sibling of the existing synchronous delete; returns the
  {status, execution_id, status_url} receipt so callers can confirm
  removal before downstream assertions.
- GeonodeRest.http_put() — fills the missing verb so PUT-style endpoints
  (permissions, future settings) can be hit without a custom requests
  call.
- GeonodeRest.http_get_anonymous() — issues a GET with no session
  credentials, returning the raw Response so callers can inspect 401/403
  outcomes that are the expected result of a probe.

Also refactors the existing private GeonodeDatasetsHandler.__wait_for_upload__
to delegate to the new public wait_for_completion, removing the
duplicated polling loop.
@mwallschlaeger

Copy link
Copy Markdown
Member Author

@giohappy please apply mypy fix: 400de6c

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants