Bug: Secret references to non-string fields are injected as strings, causing validation failures

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

还没有人认领这个 Issue。

评估

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

调研方向

首先追踪 secret-reference 的处理方式,以及如何获取 connector connectionSpecification schemas,并以 #850 和 PR #851 中描述的工作作为背景。使用 port 这样的数值字段确认其行为,然后确保数值型 secret reference 按照 connector schema 进行类型转换,并通过 JSON schema 验证。

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

描述

bug enhancement

Description

When a secret reference is used to point to a non-string field (such as 'port'), the value is injected as a string. This can cause validation to fail due to type mismatch.

Example

If a connector config has a numeric field like port and it's provided via secret reference:

{
  "host": "localhost",
  "port": "secret_reference::MY_PORT_SECRET"
}

The secret value is injected as a string (e.g., "5432") instead of being cast to the correct type (e.g., 5432), causing JSON schema validation to fail.

Proposed Solution

Use the connector's JSON schema (from connectionSpecification) to infer when a secret reference needs to be cast to a numeric type rather than keeping it as a string.

For now, we can focus on the generic numeric type and ignore other types.

Context

This is relevant to the work in #850 and PR #851, where we're adding the ability to fetch connector specs from the registry. Having access to the JSON schema enables proper type casting of secret references without requiring local connector execution.

Related

  • Issue #850
  • PR #851
主要语言
Python
星标
343
派生
77
平均合并
1 天 4 小时
30 天内合并 PR
54

贡献指南

打开贡献指南

从这里开始

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

airbytehq/PyAirbyte 的其他 Issue

查看 airbytehq/PyAirbyte 的全部 Issue

相似的 Issue

更多 Python Issue

把新 issue 发到你的邮箱

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