Hacktoberfest 2026:维护者为十月标记出来的 issue,仍然开放、适合新手。 浏览 Hacktoberfest issue

Validators cause unwanted fetch of file URL

未关闭
#526 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

评估

难度
3/5
预计耗时
1-2 天
新手友好度
42/100
Issue 类型
缺陷
描述清晰度
基本清楚
活跃度
停滞
技术栈
python
领域
backend

调研方向

从所引用行的 pywps/validator/complexvalidator.py 中的 validator 逻辑以及 pywps/inout/basic.py 中 UrlHandler.file 的实现开始。使用 MODE.SIMPLE 和远程 URL 的 ComplexInput 重现该问题。完成的标准是:简单验证在不获取 URL 的情况下检查类型,而严格验证在需要时仍保留内容获取。

由索引模型根据 Issue 内容生成。

描述

bug

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.

https://github.com/geopython/pywps/blob/d05483d75e753b3cda303f5c0bb778a0f9465393/pywps/validator/complexvalidator.py#L126

https://github.com/geopython/pywps/blob/d05483d75e753b3cda303f5c0bb778a0f9465393/pywps/validator/complexvalidator.py#L151

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 ComplexInput and some format with MODE.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

环境准备

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

geopython/pywps 的其他 Issue

查看 geopython/pywps 的全部 Issue

相似的 Issue

更多 Python Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。