Secret Manager `list_secrets` silently returns empty when both `organization_id` and `project_id` are set
维护者通常 1 天内回复
@estellesoulard 已经在做这个了。
开始于 2026年9月21日。
评估
调研方向
Start at SecretV1Beta1API.list_secrets and list_secrets_all, then trace how Client injects default_organization_id into requests. Reproduce the project-scoped listing with request logging and compare behavior when the organization ID is omitted; done means the intended handling of both scope parameters is implemented or clearly documented and covered by a regression test.
由索引模型根据 Issue 内容生成。
描述
Description
SecretV1Beta1API.list_secrets (and list_secrets_all) returns an empty result set with HTTP 200 — no error — when the request includes both organization_id and project_id, even though matching secrets exist and the same request without organization_id returns them correctly.
The Client auto-fills default_organization_id from the profile/config on every request. Since list_secrets also accepts an explicit project_id (or falls back to default_project_id), nearly every call ends up sending both parameters — silently breaking listing for anyone who authenticates via a project-scoped API key (created for a single Project, not the whole Organization), which is a documented/recommended way to scope credentials.
Reproduction
from scaleway import Client
from scaleway.secret.v1beta1 import SecretV1Beta1API
client = Client.from_config_file_and_env() # picks up default_organization_id + default_project_id
api = SecretV1Beta1API(client)
r = api.list_secrets(scheduled_for_deletion=False, project_id=client.default_project_id)
print(r.total_count) # -> 0
Enabling request logging shows the outgoing request includes both IDs:
GET https://api.scaleway.com/secret-manager/v1beta1/regions/fr-par/secrets?organization_id=<ORG_ID>&project_id=<PROJECT_ID>&scheduled_for_deletion=False
Calling the same endpoint directly with curl, omitting organization_id, returns the expected secrets:
curl -H "X-Auth-Token: $SCW_SECRET_KEY"
"https://api.scaleway.com/secret-manager/v1beta1/regions/fr-par/secrets?project_id=<PROJECT_ID>&scheduled_for_deletion=false"
# -> {"secrets": [...], "total_count": 9}
Re-adding organization_id to that same curl request reproduces the empty result:
curl -H "X-Auth-Token: $SCW_SECRET_KEY"
"https://api.scaleway.com/secret-manager/v1beta1/regions/fr-par/secrets?organization_id=<ORG_ID>&project_id=<PROJECT_ID>&scheduled_for_deletion=false"
# -> {"secrets": [], "total_count": 0}
So this looks like API-side behavior (the two filters may be ANDed against an internal scope in a way that a project-scoped key can't satisfy when organization_id is present), but the SDK makes it very easy to hit unknowingly, since organization_id is injected automatically and silently, with no error/warning that the combination yields zero rows.
Environment
scalewaySDK version: 2.11.0- Python: 3.12
- Auth: project-scoped API key (via
scwconfig file /SCW_ACCESS_KEY+SCW_SECRET_KEY)
Expected behavior
Either:
- The SDK should not auto-send
organization_idwhen an explicit (or default)project_idis already being used for a request, or - The API should return an explicit error (e.g. 403) instead of an empty 200 when the org/project combination can't be satisfied, or
- This should be documented so it's discoverable without reverse-engineering.
Workaround
Explicitly clear client.default_organization_id = None before calling list_secrets/list_secrets_all when authenticating with a project-scoped key.
- 主要语言
- Python
- 星标
- 37
- 派生
- 17
- 平均合并
- 1 天 15 小时
- 30 天内合并 PR
- 72
环境准备
- 没有 Dockerfile 或 Docker Compose 文件
- 有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
scaleway/scaleway-sdk-python 的其他 Issue
-
Published wheel declares both BSD and proprietary classifiers, and ships no license file可能重新可做 @estellesoulard 于 31 天前认领,目前没有进行中的 PR。 未关闭bug
难度 2/5 1-3 小时 新手友好度 68/100
scaleway/scaleway-sdk-python#2131 · 已指派 1 人 ·
维护者通常 1 天内回复
-
Ensure SDK python usability with LSP pylance / pyright可能重新可做 @elwinar 于 50 天前认领,目前没有进行中的 PR。 未关闭agent enhancement
scaleway/scaleway-sdk-python#1954 · 已指派 1 人 ·
维护者通常 1 天内回复
-
bug
难度 3/5 1-2 天 新手友好度 52/100
scaleway/scaleway-sdk-python#1673 ·
维护者通常 1 天内回复
-
Breaking change in v2.10.x: User and Server models require new mandatory fields可能重新可做 @estellesoulard 于 281 天前认领,目前没有进行中的 PR。 未关闭bug
scaleway/scaleway-sdk-python#1309 · 1 个 reaction · 已指派 1 人 ·
维护者通常 1 天内回复
-
Allow setting MongoDB private network when restoring a snapshot可能重新可做 @estellesoulard 于 281 天前认领,目前没有进行中的 PR。 未关闭
scaleway/scaleway-sdk-python#1139 · 已指派 1 人 ·
维护者通常 1 天内回复
查看 scaleway/scaleway-sdk-python 的全部 Issue
相似的 Issue
-
难度 2/5 1-3 小时 新手友好度 82/100
volcengine/OpenViking#6445 ·
维护者通常 1 天内回复
-
BUG:Edit Album strips spaces from the password so albums with a leading/trailing space in the password can't be edited可能已有人在做 @ManyaJain111 今天认领。 未关闭bug enhancement possible-duplicate
难度 2/5 1-3 小时 新手友好度 77/100
AOSSIE-Org/PictoPy#1637 · 4 条评论 ·
维护者通常 2 天内回复
-
难度 2/5 1-3 小时 新手友好度 74/100
deepspeedai/DeepSpeed#8884 ·
维护者通常 3 天内回复
-
难度 2/5 1-3 小时 新手友好度 76/100
flagos-ai/FlagQuantum#718 ·
维护者通常 1 天内回复
-
bug CI-failure high priority
难度 1/5 1 小时以内 新手友好度 86/100
vllm-project/afd-plugin#483 ·
维护者通常 1 天内回复