-
-
Notifications
You must be signed in to change notification settings - Fork 255
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Support for specifying STUN server: input validation (1/3) (#1645)
Related #1460. This PR adds the backend validation logic for processing the user-provided input values for the STUN server (server + port). These values will later [come from the UI](#1647). ## Notes - I added comments in the `janus.jcfg` file to shed some more light on how the config parameters work. - Based on these rules, I implemented the request validators. - I created a unified, public `parse_h264_stun_address` validation, to enforce that they are either both present or both absent. - The `_SERVER_PATTERN` is intentionally broad, I’m not sure it would be worth to have a stricter validation here. (At least I couldn’t find any reasonably simple way, without either making the regex more complex, or pulling in an external library.) For our purposes, it’s probably enough to provide a sanity check, rather than a bullet-proof validation. - The IP address validation can be done conveniently via the `ipaddress` native Python package. <a data-ca-tag href="https://codeapprove.com/pr/tiny-pilot/tinypilot/1645"><img src="https://codeapprove.com/external/github-tag-allbg.png" alt="Review on CodeApprove" /></a>
- Loading branch information
1 parent
0a03d2c
commit c92b041
Showing
4 changed files
with
247 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters