Skip to content

Commit

Permalink
made the auth name for mscolab configurable (#1907)
Browse files Browse the repository at this point in the history
  • Loading branch information
ReimarBauer authored Aug 19, 2023
1 parent 19e2ce8 commit d4dd808
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
4 changes: 2 additions & 2 deletions mslib/msui/mscolab.py
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ def __init__(self, parent=None, mscolab=None):

def mscolab_url_changed(self, text):
self.httpPasswordLe.setText(
get_password_from_keyring("MSCOLAB_AUTH_" + text, "mscolab"))
get_password_from_keyring("MSCOLAB_AUTH_" + text, config_loader(dataset="MSCOLAB_auth_user_name")))

def mscolab_login_changed(self, text):
self.loginPasswordLe.setText(
Expand Down Expand Up @@ -214,7 +214,7 @@ def enable_login_btn(self):
def connect_handler(self):
try:
url = str(self.urlCb.currentText())
auth = "mscolab", self.httpPasswordLe.text()
auth = config_loader(dataset="MSCOLAB_auth_user_name"), self.httpPasswordLe.text()
s = requests.Session()
s.auth = auth
s.headers.update({'x-test': 'true'})
Expand Down
5 changes: 5 additions & 0 deletions mslib/utils/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,9 @@ class MSUIDefaultConfig:
"http://localhost:8083",
]

# Username used for http auth
MSCOLAB_auth_user_name = "mscolab"

# category for MSC operations
MSCOLAB_category = "default"

Expand Down Expand Up @@ -237,6 +240,7 @@ class MSUIDefaultConfig:
'new_flighttrack_flightlevel',
'MSCOLAB_category',
'mscolab_server_url',
'MSCOLAB_auth_user_name',
'wms_cache',
'wms_cache_max_size_bytes',
'wms_cache_max_age_seconds',
Expand Down Expand Up @@ -297,6 +301,7 @@ class MSUIDefaultConfig:
"default_LSEC_WMS": "Documentation Required",
"default_MSCOLAB": "Documentation Required",
"MSS_auth": "Documentation Required",
"MSCOLAB_auth_user_name": "Documentation Required",
"WMS_request_timeout": "Documentation Required",
"WMS_preload": "Documentation Required",
"wms_cache": "Documentation Required",
Expand Down

0 comments on commit d4dd808

Please sign in to comment.