Skip to content
Merged
Show file tree
Hide file tree
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
20 changes: 20 additions & 0 deletions .snyk
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,30 @@ ignore:
reason: 'No patch available'
expires: 2025-04-01T00:00:00.000Z
created: 2023-12-04T09:05:00.000Z
SNYK-JS-KATEX-8647963:
- '*':
reason: 'No patch available'
expires: 2025-04-01T00:00:00.000Z
created: 2025-02-04T15:29:00.000Z
SNYK-PYTHON-PANDAS-8549481:
- '*':
reason: 'No patch available'
expires: 2025-04-01T00:00:00.000Z
created: 2025-01-02T10:30:00.000Z
SNYK-PYTHON-JINJA2-8548181:
- '*':
reason: 'Will patch later'
expires: 2025-04-01T00:00:00.000Z
created: 2025-02-04T15:28:00.000Z
SNYK-PYTHON-JINJA2-8548987:
- '*':
reason: 'Will patch later'
expires: 2025-04-01T00:00:00.000Z
created: 2025-02-04T15:28:00.000Z
SNYK-PYTHON-TORNADO-8400708:
- '*':
reason: ''
expires: 2025-04-01T00:00:00.000Z
created: 2025-02-04T15:28:00.000Z
patch: {}
version: v1.25.0
8 changes: 5 additions & 3 deletions tagreader/web_handlers.py
Original file line number Diff line number Diff line change
Expand Up @@ -187,6 +187,7 @@ def __init__(
self.datasource = datasource
self.base_url = url
self.session = requests.Session()
self.auth = auth
self.session.auth = auth if auth is not None else get_auth_aspen()
if verify_ssl is False:
urllib3.disable_warnings(InsecureRequestWarning)
Expand Down Expand Up @@ -790,6 +791,7 @@ def generate_search_params(
tag: Optional[str],
desc: Optional[str],
datasource: Optional[str],
auth: Optional[Any] = None,
) -> Dict[str, str]:
q = []
if tag is not None:
Expand All @@ -801,7 +803,7 @@ def generate_search_params(

if datasource is not None:
params["dataserverwebid"] = (
f"{get_piwebapi_source_to_webid_dict()[datasource]}"
f"{get_piwebapi_source_to_webid_dict(auth=auth)[datasource]}"
)

return params
Expand Down Expand Up @@ -913,7 +915,7 @@ def search(
return_desc: bool = True,
) -> Union[List[Tuple[str, str]], List[str]]:
params = self.generate_search_params(
tag=tag, desc=desc, datasource=self.datasource
tag=tag, desc=desc, datasource=self.datasource, auth=self.auth
)
url = urljoin(self.base_url, "points", "search")
done = False
Expand Down Expand Up @@ -969,7 +971,7 @@ def tag_to_web_id(self, tag: str) -> Optional[str]:
return self.web_id_cache[tag]

params = self.generate_search_params(
tag=tag, datasource=self.datasource, desc=None
tag=tag, datasource=self.datasource, desc=None, auth=self.auth
)
url = urljoin(self.base_url, "points", "search")
data = self.fetch(url, params=params)
Expand Down
Loading