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
{{ message }}
Repository navigation
fix: don't apply ambient .netrc credentials to backend requests #449
Requests to configured TES backends go through requests with its defaults, which reads a .netrc file of the environment (~/.netrc, or NETRC):
Requests without credentials (auth: none, and anonymous version probes) get the Basic credentials of a matching .netrc entry.
Requests with proTES' access token (auth: client_credentials) get them too: requests replaces the Authorization header with Basic credentials of a matching entry.
When requests follows a redirect (GET requests, e.g., /service-info and /tasks/{id}), it looks up .netrc again for the new URL, whatever auth the first request had.
Requests to discovered backends use FOCA's guarded client, which ignores .netrc already. A no-op auth for requests without credentials alone doesn't cover redirects or the token (tried and reverted in #448).
Possible fix: send all requests to configured backends through a session of their own that never reads .netrc (e.g., a requests.Session subclass whose rebuild_auth only strips credentials on host changes, and a no-op session auth), keeping the proxy and TLS settings of the environment; the token as an auth callable.
Acceptance criteria
No request to a TES backend gets credentials from .netrc: not without credentials, not with the token or Basic credentials, not after redirects.
Proxy and CA settings of the environment still apply.
Tests cover the first request and a redirect; the docs (credentials of TES instances) say so.
Activity