Skip to content

Commit bdc1333

Browse files
committed
fix KeycloakTokenAuth netrc_file naming convention
1 parent a8c0c3e commit bdc1333

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

HTTPAuthOptions.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -54,19 +54,19 @@ def _read_credentials(self, filepath):
5454
raise RuntimeError(f"Error reading {filepath}: {e}")
5555

5656
class KeycloakTokenAuth(HTTPBearerAuth):
57-
def __init__(self, server_url, realm, client_id, client_secret=None, netrcfile=None):
57+
def __init__(self, server_url, realm, client_id, client_secret=None, netrc_file=None):
5858
logging.debug(f"Initializing {type(self)}")
5959
self.server_url = server_url
6060
self.realm = realm
6161
self.client_id = client_id
6262
self.client_secret = client_secret
63-
self.netrcfile = netrcfile
63+
self.netrc_file = netrc_file
6464
self.token_url = f"{server_url}/realms/{realm}/protocol/openid-connect/token"
6565
username, password = self._read_credentials()
6666
self.token = self._get_token(username, password)
6767

6868
def _read_credentials(self):
69-
n = netrc.netrc(self.netrcfile)
69+
n = netrc.netrc(self.netrc_file)
7070
host = urlparse(self.server_url).netloc
7171
creds = n.authenticators(host)
7272
return creds[0], creds[2]

0 commit comments

Comments
 (0)