-
Notifications
You must be signed in to change notification settings - Fork 0
Ensure OIDC Callback Server releases bound TCP port #138
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
Conversation
Codecov Report
@@ Coverage Diff @@
## main #138 +/- ##
==========================================
+ Coverage 91.65% 91.83% +0.18%
==========================================
Files 8 8
Lines 827 821 -6
==========================================
- Hits 758 754 -4
+ Misses 69 67 -2
Continue to review full report at Codecov.
|
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.
This all looks OK, the test is a nice touch!
We are aware that the coverage in this code area is sub-optimal. #139 will resolve this |
Closes #137
The OIDCCallbackHTTPServer wasn't correctly releasing TCP port 32284. This caused problems if we tried to authenticate to a second OIDC server in the same script, e.g. by using the STK.
This PR re-works the OIDCCallbackHTTPServer implementation to use
handle_request()
instead ofserve_forever()
, which seems to eliminate the need to run the server in a separate thread. Instead, we now synchronously wait thelogin_timeout
length of time for the server to handle a request. If it does, we return the auth_code.I have also added tests that check the status of the TCP port both when the server is running and when it has been closed.