Skip to content

Store in-flight request headers only for protocol parser#2723

Merged
dpkp merged 3 commits intomasterfrom
dpkp/get-response-class
Mar 9, 2026
Merged

Store in-flight request headers only for protocol parser#2723
dpkp merged 3 commits intomasterfrom
dpkp/get-response-class

Conversation

@dpkp
Copy link
Owner

@dpkp dpkp commented Mar 8, 2026

No longer need to track RESPONSE_TYPE explicitly on each request class. Currently creates a greedy class registry on kafka.protocol import; will leave lazy registry for later if needed.

Also refactor common methods from kafka.protocol.api.Request and Response in to a common RequestResponse class. Adds stateful header property.

response_type = get_response_class(header.api_key, header.api_version)
if response_type is None:
log.error('Unable to find ResponseType for api_key=%d api_version=%d',
header.api_key, header.api_version)

Check failure

Code scanning / CodeQL

Clear-text logging of sensitive information High

This expression logs
sensitive data (password)
as clear text.

Copilot Autofix

AI 17 days ago

Copilot could not generate an autofix suggestion

Copilot could not generate an autofix suggestion for this alert. Try pushing a new commit or if the problem persists contact support.

Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

false positive. api_key is not sensitive.

@dpkp dpkp force-pushed the dpkp/get-response-class branch 2 times, most recently from 50d0aa7 to afa3b96 Compare March 9, 2026 00:23
@dpkp dpkp changed the base branch from master to dpkp/request-response-class March 9, 2026 00:23
@dpkp dpkp force-pushed the dpkp/get-response-class branch from 7ee4a67 to 1ebc1fd Compare March 9, 2026 00:30
@dpkp dpkp deleted the branch master March 9, 2026 00:31
@dpkp dpkp closed this Mar 9, 2026
@dpkp dpkp reopened this Mar 9, 2026
@dpkp dpkp changed the base branch from dpkp/request-response-class to master March 9, 2026 00:33
@dpkp dpkp force-pushed the master branch 2 times, most recently from d4637e5 to efbcb43 Compare March 9, 2026 00:36
@dpkp dpkp force-pushed the dpkp/get-response-class branch from 1ebc1fd to ce4c150 Compare March 9, 2026 00:37
@dpkp dpkp merged commit 9a8af08 into master Mar 9, 2026
19 checks passed
@dpkp dpkp deleted the dpkp/get-response-class branch March 9, 2026 00:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant