Skip to content

Commit

Permalink
add missing DRU conformance requirements + fix unssuported-content-ty…
Browse files Browse the repository at this point in the history
…pe for invalid deploy/update (fixes #624)
  • Loading branch information
fmigneault committed Oct 10, 2024
1 parent d4ffd34 commit 839fa2f
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 11 deletions.
5 changes: 3 additions & 2 deletions CHANGES.rst
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,12 @@ Changes

Changes:
--------
- No change.
- Add missing conformance and requirement references for *OGC API - Processes - Part 2: DRU*.

Fixes:
------
- No change.
- Add the appropriate HTTP error type to respect ``/conf/dru/deploy/unsupported-content-type``
(fixes `#624 <https://github.com/crim-ca/weaver/issues/624>`_).

.. _changes_5.9.0:

Expand Down
31 changes: 23 additions & 8 deletions weaver/wps_restapi/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -395,16 +395,12 @@ def get_conformance(category, settings):
# f"{ogcapi_proc_part2}/conf/docker/deploy/body",
# f"{ogcapi_proc_part2}/conf/docker/replace/body",
f"{ogcapi_proc_part2}/conf/dru",
# FIXME: https://github.com/crim-ca/weaver/issues/624
# f"{ogcapi_proc_part2}/conf/dru/deploy/content-type",
f"{ogcapi_proc_part2}/conf/dru/deploy/content-type",
f"{ogcapi_proc_part2}/conf/dru/deploy/post-op",
# FIXME: https://github.com/crim-ca/weaver/issues/624
# f"{ogcapi_proc_part2}/conf/dru/deploy/unsupported-content-type",
# FIXME: https://github.com/crim-ca/weaver/issues/624
# f"{ogcapi_proc_part2}/conf/dru/replace/content-type",
f"{ogcapi_proc_part2}/conf/dru/deploy/unsupported-content-type",
f"{ogcapi_proc_part2}/conf/dru/replace/content-type",
f"{ogcapi_proc_part2}/conf/dru/replace/put-op",
# FIXME: https://github.com/crim-ca/weaver/issues/624
# f"{ogcapi_proc_part2}/conf/dru/replace/unsupported-content-type",
f"{ogcapi_proc_part2}/conf/dru/replace/unsupported-content-type",
f"{ogcapi_proc_part2}/conf/dru/undeploy/delete-op",
f"{ogcapi_proc_part2}/conf/dru/undeploy/response-immutable-success",
f"{ogcapi_proc_part2}/conf/dru/undeploy/response-immutable",
Expand All @@ -414,13 +410,23 @@ def get_conformance(category, settings):
f"{ogcapi_proc_part2}/conf/dru/static-indicator",
f"{ogcapi_proc_part2}/conf/dru/test-process",
f"{ogcapi_proc_part2}/conf/dru/test-process",
f"{ogcapi_proc_part2}/conf/deploy-replace-undeploy",
f"{ogcapi_proc_part2}/conf/ogcapppkg",
f"{ogcapi_proc_part2}/conf/ogcapppkg/deploy/body",
f"{ogcapi_proc_part2}/conf/ogcapppkg/deploy/response",
f"{ogcapi_proc_part2}/conf/ogcapppkg/deploy/response-duplicate",
f"{ogcapi_proc_part2}/conf/ogcapppkg/deploy/response-success",
f"{ogcapi_proc_part2}/conf/ogcapppkg/replace/body",
f"{ogcapi_proc_part2}/conf/ogcapppkg/replace/response",
f"{ogcapi_proc_part2}/req/cwl",
f"{ogcapi_proc_part2}/req/cwl/execution-unit",
f"{ogcapi_proc_part2}/req/cwl/deploy/body",
# FIXME: multi-CWL $graph (class: Workflow), must allow section of 1 with 'w' query param
# (https://github.com/crim-ca/weaver/issues/739)
# f"{ogcapi_proc_part2}/req/cwl/deploy/w-param",
# f"{ogcapi_proc_part2}/req/cwl/deploy/exception-workflow-not-found",
f"{ogcapi_proc_part2}/req/cwl/package/response-body",
f"{ogcapi_proc_part2}/req/cwl/replace/body",
f"{ogcapi_proc_part2}/per/deploy-replace-undeploy/replace/body",
f"{ogcapi_proc_part2}/rec/deploy-replace-undeploy/deploy/body-ogcapppkg",
f"{ogcapi_proc_part2}/rec/deploy-replace-undeploy/replace/body-ogcapppkg",
Expand All @@ -431,19 +437,28 @@ def get_conformance(category, settings):
f"{ogcapi_proc_part2}/req/deploy-replace-undeploy/deploy/response-body",
f"{ogcapi_proc_part2}/req/deploy-replace-undeploy/deploy/response-pid",
f"{ogcapi_proc_part2}/req/deploy-replace-undeploy/deploy/response",
f"{ogcapi_proc_part2}/req/deploy-replace-undeploy/deploy/unsupported-content-type",
f"{ogcapi_proc_part2}/req/deploy-replace-undeploy/package/get-op",
f"{ogcapi_proc_part2}/req/deploy-replace-undeploy/package/response-body",
f"{ogcapi_proc_part2}/req/deploy-replace-undeploy/package/response-success",
f"{ogcapi_proc_part2}/req/deploy-replace-undeploy/replace/body",
f"{ogcapi_proc_part2}/req/deploy-replace-undeploy/replace/content-type",
f"{ogcapi_proc_part2}/req/deploy-replace-undeploy/replace/put-op",
f"{ogcapi_proc_part2}/req/deploy-replace-undeploy/replace/response",
f"{ogcapi_proc_part2}/req/deploy-replace-undeploy/replace/unsupported-content-type",
f"{ogcapi_proc_part2}/req/deploy-replace-undeploy/static/indicator",
f"{ogcapi_proc_part2}/req/deploy-replace-undeploy/undeploy/delete-op",
f"{ogcapi_proc_part2}/req/deploy-replace-undeploy/undeploy/response",
f"{ogcapi_proc_part2}/req/deploy-replace-undeploy/ogcapppkg",
f"{ogcapi_proc_part2}/req/dru/mutable-process",
f"{ogcapi_proc_part2}/req/dru/test-process",
f"{ogcapi_proc_part2}/req/ogcapppkg",
f"{ogcapi_proc_part2}/req/ogcapppkg/deploy/body",
f"{ogcapi_proc_part2}/req/ogcapppkg/execution-unit-docker",
f"{ogcapi_proc_part2}/req/ogcapppkg/package/response-body",
f"{ogcapi_proc_part2}/req/ogcapppkg/process-description",
f"{ogcapi_proc_part2}/req/ogcapppkg/profile-docker",
f"{ogcapi_proc_part2}/req/ogcapppkg/replace/body",
f"{ogcapi_proc_part2}/req/ogcapppkg/schema",
# FIXME: below partially, for full Part 3, would need $graph support
# (see https://github.com/crim-ca/weaver/issues/56 and below '/conf/app-pck/cwl')
Expand Down
2 changes: 1 addition & 1 deletion weaver/wps_restapi/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,7 @@ def parse_content(request=None, # type:
except colander.Invalid as exc:
raise HTTPUnsupportedMediaType(json={
"title": "Unsupported Media Type",
"type": "UnsupportedMediaType",
"type": "http://www.opengis.net/def/exceptions/ogcapi-processes-2/1.0/unsupported-media-type",
"detail": str(exc),
"status": HTTPUnsupportedMediaType.code,
"cause": {"Content-Type": None if content_type is None else str(content_type)},
Expand Down

0 comments on commit 839fa2f

Please sign in to comment.