-
Notifications
You must be signed in to change notification settings - Fork 58
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Allow creating a connection with ufrag and pwd #82
base: main
Are you sure you want to change the base?
Conversation
and enforce the length according to https://datatracker.ietf.org/doc/html/rfc5245#section-15.1 This allows implementing the peerconnection with a single set of local credentials in aiortc/aiortc#1229
… with ufrag and pwd. PR: aiortc/aioice#82 (comment)
@jlaine ping |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Untested but looks good to me.
if local_username is not None and len(local_username) not in range(4, 256): | ||
raise ValueError("local ice username must satisfy 4*256ice-char") | ||
#: Local username, automatically set to a random value. | ||
self.local_username = random_string(4) | ||
self.local_username = local_username or random_string(4) | ||
|
||
if local_password is not None and len(local_password) not in range(22, 256): | ||
raise ValueError("local ice password must satisfy 22*256ice-char") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
len
probably counts some non-ASCII symbols wrong with respect to the RFCs but why would you do that anyways, so I guess it's who cares in practice.
#: Local password, automatically set to a random value. | ||
self.local_password = random_string(22) | ||
self.local_password = local_password or random_string(22) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
or
is a bit prone to error for an empty string even though this is impossible with above checks. A more explicit assignment in the conditional would be nicer but no strong opinion here.
Looks like the CI pipeline will need some work. I'm assuming it's because 3.7 is EOL. And we should probably add 3.12 - 3.14. |
and enforce the length according to
https://datatracker.ietf.org/doc/html/rfc5245#section-15.1
This allows implementing the peerconnection with a single set of local credentials in
aiortc/aiortc#1229