Validators cause unwanted fetch of file URL
还没有人认领这个 Issue。
评估
调研方向
从所引用行的 pywps/validator/complexvalidator.py 中的 validator 逻辑以及 pywps/inout/basic.py 中 UrlHandler.file 的实现开始。使用 MODE.SIMPLE 和远程 URL 的 ComplexInput 重现该问题。完成的标准是:简单验证在不获取 URL 的情况下检查类型,而严格验证在需要时仍保留内容获取。
由索引模型根据 Issue 内容生成。
描述
Description
When the WPS execution occurs and that an input reference URL (for example remote JSON for below references), the format validator will actually pull the file because file property refers to UrlHandler.file, which in turn does the request and write the chucks locally.
In UrlHandler.file :
https://github.com/geopython/pywps/blob/d05483d75e753b3cda303f5c0bb778a0f9465393/pywps/inout/basic.py#L461-L467
This might be ok for usual data processing execution because most processes want the file to be generated locally at some point, but it shouldn't be done during validation when MODE < STRICT as it is not required for checking the extension from the name (which is what MODE.SIMPLE attempts to do).
The behavior is valid when MODE >= STRICT because the full contents are validated, but it is not required for simple mime-type checks.
My general use case is that I need to reference https://<somewhere> files and pass them down to further remote processes. Therefore, I want to validate that the file type is correct, but not fetch them right away (the child process will do so).
As the file could be quite big, fetching it 2 times (parent/child process) for basic validation is not great. Since the file is not required locally until I explicitly call file property, the validator shouldn't do so if it doesn't need it.
Environment
- operating system:
- Python version:
- PyWPS version: 4.2.4
- source/distribution
- git clone
- Debian
- PyPI
- zip/tar.gz
- other (please specify):
- web server
- Apache/mod_wsgi
- CGI
- other (please specify):
Steps to Reproduce
- Setup a WPS with an
ComplexInputand some format withMODE.SIMPLE. - Execute the WPS process and see that the file is fetched before even arriving in the handler.
Additional Information
Part of requirements for developing OGC EMS which dispatches execution to remote ADES.
https://github.com/crim-ca/weaver
- 主要语言
- Python
- 星标
- 186
- 派生
- 117
- PR 合并指标
- 30 天内没有已合并 PR
环境准备
- 没有 Dockerfile 或 Docker Compose 文件
- 有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
geopython/pywps 的其他 Issue
-
ReadTheDocs OAuth App Installation可能重新可做 @tomkralidis 于 92 天前认领,目前没有进行中的 PR。 未关闭documentation
-
Modernizing the packaging of the library可能重新可做 @Zeitsperre 于 305 天前认领,目前没有进行中的 PR。 未关闭documentation enhancement packaging
-
DBLog test are bound to other test可能已有人在做 @C1-BA-B1-F3 于 18 天前认领。 未关闭
难度 2/5 1-3 小时 新手友好度 45/100
-
难度 3/5 1-2 天 新手友好度 45/100
-
ComplexOutput data as reference always generates a file named "input.csv", should be "output".可能已有人在做 @C1-BA-B1-F3 于 18 天前认领。 未关闭
难度 3/5 1-2 天 新手友好度 35/100
相似的 Issue
-
Uninstall guide omits the CloudWatch log groups AWS CodeBuild creates for useCodeBuild pipelines未关闭bug documentation
难度 1/5 1-3 小时 新手友好度 88/100
awslabs/visual-asset-management-system#552 ·
维护者通常 1 天内回复
-
netbox status: needs triage type: documentation
难度 1/5 1 小时以内 新手友好度 76/100
netbox-community/netbox#23460 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 75/100
awslabs/threat-composer#362 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 78/100
维护者通常 1 天内回复
-
bug
难度 2/5 1-3 小时 新手友好度 72/100
ansys/pyansys-common-mcp#213 ·
维护者通常 3 天内回复