ggshield
ggshield copied to clipboard
Use OS port selection for the local OAuth server
Is your feature request related to a problem? Please describe.
In the OAuthClient
, we start a local HTTP server by trying out a series of ports. However the port selection could be made by the operating system by passing 0 as port number.
Describe the solution you'd like
from http.server import HTTPServer, SimpleHTTPRequestHandler
server = HTTPServer(("127.0.0.1", 0), SimpleHTTPRequestHandler)
print(server.server_address, server.server_name, server.server_port)