AMW-625 add use_netrc option to prevent .netrc overriding bearer token auth

When ~/.netrc contains an entry matching the Keycloak host, open_url()
silently replaces the OIDC Bearer header with Basic auth, causing 401
errors. Add use_netrc option (default false) to all keycloak modules
and pass it through to both open_url() call sites.

Includes molecule test scenario (netrc) that verifies both behaviors:
- default use_netrc=false ignores .netrc (fix works)
- use_netrc=true picks up .netrc and gets 401 (proves the bug)

Fixes: https://github.com/ansible-middleware/keycloak/issues/403
This commit is contained in:
Martin Cihlar
2026-09-07 09:09:39 +02:00
parent 8d5526aeb6
commit d6ceb63914
5 changed files with 127 additions and 0 deletions
+1
View File
@@ -0,0 +1 @@
../../roles