Skip to content
This repository was archived by the owner on Jul 11, 2025. It is now read-only.

Conversation

debuggings
Copy link

According to rfc5802, username should escape special characters before sending to the server.

The characters ',' or '=' in usernames are sent as '=2C' and
'=3D' respectively. If the server receives a username that
contains '=' not followed by either '2C' or '3D', then the
server MUST fail the authentication.

According to [rfc5802](https://datatracker.ietf.org/doc/html/rfc5802), username should escape special characters before sending to the server.
> The characters ',' or '=' in usernames are sent as '=2C' and
         '=3D' respectively.  If the server receives a username that
         contains '=' not followed by either '2C' or '3D', then the
         server MUST fail the authentication.
@debuggings debuggings changed the title fix scram username character escape Fix scram username character escape Aug 14, 2024
@debuggings debuggings changed the title Fix scram username character escape Fix SCRAM username character escape Aug 14, 2024
Copy link
Collaborator

@wbarnha wbarnha left a comment

Choose a reason for hiding this comment

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

If this is only an issue within the context of RFC 5802, then I think this is a behavior I'm willing to accept. Since this is the only usage of self.user in scram.py, I may be making much ado about nothing with my other opinion that having such an implementation here feels awkward.

@debuggings
Copy link
Author

Thanks for your reply.

For me, escaping is a part of message preparation, just like r = and n =. Therefore, I think escaping and connecting should happen just before sending the message.

@wbarnha
Copy link
Collaborator

wbarnha commented Aug 15, 2024

I agree. LGTM!

@wbarnha wbarnha merged commit 9bee9fc into kafka-python-ng:master Aug 15, 2024
21 checks passed
@debuggings
Copy link
Author

Hi @wbarnha, may I ask where can I find the release plan? Thanks in advance.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants