File tree Expand file tree Collapse file tree 2 files changed +13
-6
lines changed
Expand file tree Collapse file tree 2 files changed +13
-6
lines changed Original file line number Diff line number Diff line change 44from mlflow .tracking .request_auth .abstract_request_auth_provider import (
55 RequestAuthProvider ,
66)
7+ from requests .auth import AuthBase
78
89
910class ProxyAuthProvider (RequestAuthProvider ):
@@ -15,12 +16,18 @@ def get_name(self):
1516 return "proxy_auth_provider"
1617
1718 def get_auth (self ):
18- # Add your Authelia Proxy-Authorization logic here
19+ return ProxyAuth (self .username , self .password )
20+
21+
22+ class ProxyAuth (AuthBase ):
23+ def __init__ (self , username , password ):
24+ self .username = username
25+ self .password = password
26+
27+ def __call__ (self , r ):
1928 credentials = f"{ self .username } :{ self .password } "
2029 encoded_credentials = base64 .b64encode (credentials .encode ("utf-8" )).decode (
2130 "utf-8"
2231 )
23- proxy_authorization_header = f"Basic { encoded_credentials } "
24-
25- # Return a dictionary containing the header for authentication
26- return {"Proxy-Authorization" : proxy_authorization_header }
32+ r .headers ["Proxy-Authorization" ] = f"Basic { encoded_credentials } "
33+ return r
Original file line number Diff line number Diff line change 22
33setup (
44 name = "mlflow-plugin-proxy-auth" ,
5- version = "0.0.2 " ,
5+ version = "0.0.3 " ,
66 packages = find_packages (),
77 install_requires = ["mlflow" ],
88 entry_points = {
You can’t perform that action at this time.
0 commit comments