Skip to content

fix case where LDAP username and authentication username are different #135

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions pyral/restapi.py
Original file line number Diff line number Diff line change
Expand Up @@ -181,11 +181,12 @@ class Rally(object):
FORMATTED_ID_PATTERN = re.compile(r'^[A-Z]{1,2}\d+$') #S|US|DE|DS|TA|TC|TS|PI
MAX_ATTACHMENT_SIZE = 50000000 # approx 50 MB

def __init__(self, server=SERVER, user=None, password=None, apikey=None,
def __init__(self, server=SERVER, user=None, auth_user=None, password=None, apikey=None,
version=WS_API_VERSION, warn=True, server_ping=None,
isolated_workspace=False, **kwargs):
self.server = server
self.user = user or USER_NAME
self.auth_user = auth_user or self.user # use this in cases where the "user name" and "LDAP User Name" differ
self.password = password or PASSWORD
self.apikey = apikey
self.version = WS_API_VERSION # we only support v2.0 now
Expand Down Expand Up @@ -239,7 +240,7 @@ def __init__(self, server=SERVER, user=None, password=None, apikey=None,
self.user = None
self.password = None
else:
self.session.auth = requests.auth.HTTPBasicAuth(self.user, self.password)
self.session.auth = requests.auth.HTTPBasicAuth(self.auth_user, self.password)
self.session.timeout = 10.0
self.session.proxies = proxy_dict
self.session.verify = verify_ssl_cert
Expand Down