CloudEvent serializes invalid extension attribute names without validation
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 68/100
Research direction
Start with CloudEvent construction and the conversion.to_structured entry point shown in the repro, then trace where extension attributes are serialized. Re-run the provided example to confirm that names containing characters such as the hyphen are rejected, while valid lowercase-letter and digit names continue to serialize.
Written by the indexing model from the issue text.
Description
CloudEvent serializes invalid extension attribute names without validation
Repro:
from cloudevents.v1.http import CloudEvent
from cloudevents.v1.conversion import to_structured
event = CloudEvent(
{
"type": "example.event",
"source": "/test",
"example-extension": "123",
},
{"ok": True},
)
_, body = to_structured(event)
print(body)
Expected: construction or serialization rejects example-extension, because CloudEvents attribute names must only contain lowercase ASCII letters and digits.
Actual: the SDK serializes it successfully, producing an invalid CloudEvent. This can fail at runtime with stricter receivers such as Knative Eventing, which rejects the request with 400 Bad Request.
- Dominant language
- Python
- Stars
- 342
- Forks
- 65
- PR merge metrics
- No merged PRs in 30d
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from cloudevents/sdk-python
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
cloudevents/sdk-python#304 ·
-
enhancement
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
cloudevents/sdk-python#291 · 8 comments ·
-
Difficulty 1/5 Under an hour Newbie friendliness 48/100
cloudevents/sdk-python#247 · 2 comments ·
-
question
Difficulty 3/5 1-2 days Newbie friendliness 45/100
cloudevents/sdk-python#246 · 5 comments ·
-
Difficulty 3/5 1-2 days Newbie friendliness 35/100
cloudevents/sdk-python#213 · 3 comments · 1 reaction ·
All issues in cloudevents/sdk-python
Similar issues
-
Add: hunch Open
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
AbdelStark/awesome-typesafe#104 ·
-
enhancement
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
DiamondLightSource/dodal#2211 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
openml/openml-python#1749 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
sipyourdrink-ltd/bernstein#6191 ·