RecorderEndpoint: Parse and use username/password from URLs #44
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
What is the current behavior you want to change?
RecorderEndpoint is not able to push to a basic auth-protected HTTP server, because the GSTreamer element
curlhttpsink
doesn't parse them from the URL, instead it expects them to be set as properties.What is the new behavior provided by this change?
Use GstUri to parse the destination URL and extract the
username:password
field (called "userinfo").Then, split the userinfo from the colon (
:
).Lastly, URL-decode each of the resulting parts.
NOTE: GStreamer 1.16 (Ubuntu 20.04) does NOT support extracting a URL-encoded userinfo field. This means that the username and password will be already decoded, and the splitting on "
:
" will happen at the first colon found, which won't work if the username itself had a colon.So, until we update to a newer Ubuntu/GStreamer version:
THE USERNAME CANNOT CONTAIN A COLON.
Also delete the unneeded function
kms_is_valid_uri()
. Better to delegate that check to the GstUri class constructor, which validates the URI and decides if it is valid or not.How has this been tested?
Basic auth protected Python http-server.
Types of changes
Checklist
Resolves #42