ggshield icon indicating copy to clipboard operation
ggshield copied to clipboard

Use OS port selection for the local OAuth server

Open fbochu opened this issue 8 months ago • 1 comments

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)

fbochu avatar Jun 17 '24 09:06 fbochu