You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In the NGINX logs for prometheus, we see evidence of mlab-ns running two queries. The first receives a HTTP Status 401 (presumably without credentials). The second includes a user "mlab" and succeeds.
When authentication is required, the server sends a header (as well as the 401 error code) requesting authentication. This specifies the authentication scheme and a ‘realm’. [...] The client should then retry the request with the appropriate name and password for the realm included as a header in the request. This is ‘basic authentication’.
It would seem that urllib2 first sends an unauthenticated request, which the server responds with a 401 error, also indicating the auth scheme, as well as the auth realm. urllib2 then looks in its password manager to see if it has a mapping for that realm/URL, then resends the appropriate authenticated request.
I suppose one way around this might be to not use any sort of urllib2 auth handler or password manager, but to simply construct a pre-authenticated URL like https://:@.
Well, if that's how it's supposed to work, then I guess it's okay. My opinion is that I think it's awkward. But, we don't want to do any special handling if we don't have to.
@stephen-soltesz: Is it okay to close this issue, or should we leave it open to consider alternate ways to access the data (such as constructing the URL ourselves)?
In the NGINX logs for prometheus, we see evidence of mlab-ns running two queries. The first receives a HTTP Status 401 (presumably without credentials). The second includes a user "mlab" and succeeds.
First fails.
Second succeeds:
The text was updated successfully, but these errors were encountered: