mirror of
https://github.com/clearml/clearml
synced 2025-01-31 09:07:00 +00:00
Improve httpdriver authentication feature
This commit is contained in:
parent
05364f0796
commit
2fb69ae951
@ -184,7 +184,11 @@ class StorageHelper(object):
|
||||
|
||||
@classmethod
|
||||
def get(cls, url, logger=None, **kwargs):
|
||||
""" Get a storage helper instance for the given URL """
|
||||
"""
|
||||
Get a storage helper instance for the given URL
|
||||
|
||||
:return: StorageHelper instance
|
||||
"""
|
||||
|
||||
# Handle URL substitution etc before locating the correct storage driver
|
||||
url = cls._canonize_url(url)
|
||||
@ -923,6 +927,7 @@ class _HttpDriver(object):
|
||||
|
||||
class _Container(object):
|
||||
_default_backend_session = None
|
||||
_default_files_server_host = None
|
||||
|
||||
def __init__(self, name, retries=5, **kwargs):
|
||||
self.name = name
|
||||
@ -932,7 +937,10 @@ class _HttpDriver(object):
|
||||
if not self._default_backend_session:
|
||||
from ..backend_interface.base import InterfaceBase
|
||||
self._default_backend_session = InterfaceBase._get_default_session()
|
||||
if url.startswith(self._default_backend_session.get_files_server_host()):
|
||||
if self._default_files_server_host is None:
|
||||
self._default_files_server_host = self._default_backend_session.get_files_server_host()
|
||||
|
||||
if url.startswith(self._default_files_server_host):
|
||||
return self._default_backend_session.add_auth_headers({})
|
||||
return None
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user