Bug: TransferFamilyAuthorizer.password raises KeyError when the event has no password
维护者通常 1 天内回复
评估
这个 Issue 还没有评估数据。
描述
Expected Behaviour
TransferFamilyAuthorizer.password is typed str | None and documented as "None in case customer authenticating with certificates", so an authorizer event without a password should give None. The Pydantic TransferFamilyAuthorizer model already declares password with default=None.
Current Behaviour
The property returns self["password"], so an event without a password key raises KeyError instead of returning None. The custom identity provider examples in the Transfer Family docs read it defensively (event.get('password', '') == '' in Python) to detect key-based logins, which the data class can't do today.
Code snippet
from aws_lambda_powertools.utilities.data_classes import TransferFamilyAuthorizer
event = {"username": "bobusa", "protocol": "SFTP", "serverId": "s-abcd123456", "sourceIp": "192.168.0.100"}
TransferFamilyAuthorizer(event).password # KeyError: 'password'
Steps to Reproduce
- Build a
TransferFamilyAuthorizerfrom an event that has nopasswordkey. - Read
.password. KeyErroris raised.
Possible Solution
Return self.get("password"), matching the type hint and the Pydantic model. I can open a PR.
Powertools for AWS Lambda (Python) version
latest (develop, 3.38.0)
AWS Lambda function runtime
3.12
Packaging format used
PyPi
Debugging logs
No response
- 主要语言
- Python
- 星标
- 3.3k
- 派生
- 511
- 平均合并
- 3 天 8 小时
- 30 天内合并 PR
- 92
环境准备
- 没有 Dockerfile 或 Docker Compose 文件
- 有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
aws-powertools/powertools-lambda-python 的其他 Issue
-
Bug: POWERTOOLS_IDEMPOTENCY_DISABLED set to an empty or non-boolean value crashes every invocation可能已有人在做 @lechakrawarthy 于 1 天前认领。 未关闭bug good first issue help wanted idempotency
难度 2/5 1-3 小时 新手友好度 85/100
aws-powertools/powertools-lambda-python#8728 · 4 条评论 · 已指派 1 人 ·
维护者通常 1 天内回复
-
Bug: Redis layer fails the invocation instead of retrying when a record expires between SET NX and GET可能已有人在做 @coughlmao 于 1 天前认领。 未关闭bug good first issue help wanted idempotency
难度 2/5 1-3 小时 新手友好度 85/100
aws-powertools/powertools-lambda-python#8727 · 4 条评论 · 已指派 1 人 ·
维护者通常 1 天内回复
-
Bug: Redis orphan lock timeout ignores expires_after_seconds and is always 10 seconds可能已有人在做 @CJstate 于 1 天前认领。 未关闭bug good first issue help wanted idempotency
难度 2/5 1-3 小时 新手友好度 75/100
aws-powertools/powertools-lambda-python#8726 · 3 条评论 · 已指派 1 人 ·
维护者通常 1 天内回复
-
Bug: idempotency payloads with set, frozenset or bytes fields cannot be hashed可能已有人在做 @Neeraj111010 于 1 天前认领。 未关闭bug good first issue help wanted idempotency
难度 2/5 1-3 小时 新手友好度 80/100
aws-powertools/powertools-lambda-python#8725 · 4 条评论 · 已指派 1 人 ·
维护者通常 1 天内回复
-
Bug: with a DynamoDB composite key, DataRecord.idempotency_key is the static partition key value可能已有人在做 @sumedh-aerram 于 1 天前认领。 未关闭bug good first issue help wanted idempotency
难度 2/5 1-3 小时 新手友好度 90/100
aws-powertools/powertools-lambda-python#8724 · 3 条评论 · 已指派 1 人 ·
维护者通常 1 天内回复
查看 aws-powertools/powertools-lambda-python 的全部 Issue
相似的 Issue
-
难度 2/5 1-3 小时 新手友好度 82/100
Nixtla/mlforecast#823 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 68/100
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 65/100
microsoft/ML-For-Beginners#1061 ·
-
bot-found documentation priority: P3
难度 2/5 1 小时以内 新手友好度 82/100
madenvel/KalinkaPlayer#503 ·
-
难度 2/5 1-3 小时 新手友好度 63/100
EleutherAI/lm-evaluation-harness#4508 ·
维护者通常 1 天内回复