Repository navigation
Keep certificate checks on in the usage sharing example - #116
Merged
Merged
Conversation
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Closes #51.
Problem
The on-premise usage sharing example replaced
requests.postfor the whole process with a version that passesverify=False, and silenced urllib3'sInsecureRequestWarning(shareusage.pylines 68 to 73 onrc). So the usage data the example sends tohttps://devices-v4.51degrees.com/new.ashx, and every otherrequests.postin the same process, went over HTTPS without checking the server's certificate, and nothing was logged. The comment said it was for testing, but the example is the code people copy into their own applications, and no other example or package here turns certificate checks off.What changed
shareusage.py, so the example sends with certificate checks on, as theShareUsageelement does by default.test_shareusage_certificate_checks.pyis new. It reads the example's source and fails if the example assigns torequests.post, passes averifyargument or sets averifykey, or callsdisable_warnings. It reads the source rather than running the example, so it needs no data file and no network.Nothing relied on the lines. No test runs the usage sharing example, and the example's own endpoint,
https://devices-v4.51degrees.com/new.ashx, has a certificate that a normal check accepts.The examples package is tested but never published, so the release plan releases nothing for this change.
How it was verified
Both runs are temporary branches holding a workflow that installs the pipeline packages from the checkout into a virtual environment of the runner's own Python (3.12.3 on Ubuntu, 3.12.10 on Windows) and runs the new test with pytest.
rcat df0949d7 with the new test, commit da28865f, run 43479727528, failed onubuntu-latestandwindows-latestwith3 failed, beingtest_does_not_replace_requests_post,test_does_not_turn_off_certificate_checksandtest_does_not_silence_certificate_warnings.3 passed.tools/pr-matrix.pyontmp/pr-matrix-116, finished with success. Configure printed "Left out 5 macOS entries", all ten Build and Test jobs (Ubuntu and Windows, Python 3.10 to 3.14) passed, and all elevenSetting 'PullRequestSha'lines read0678b496fdd25437afc274dc3d20e8a79bfe08fb, this head. macOS was left out of this draft's full build under the 9 November decision. The rc head is built with macOS before it merges into main.The last release into
mainwas #114, merged at 06:22 UTC on 13 November.