Skip to content

Commit

Permalink
[DOM-40084] - update python user agent (#142)
Browse files Browse the repository at this point in the history
* DOM-40084 - added python domino user-agent

* DOM-40084 - updated changelog

* DOM-40084 - updated user-agent

* DOM-40084 - updated changelog
  • Loading branch information
ddl-olsonJD committed Aug 16, 2022
1 parent 178f736 commit 9dad759
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ All notable changes to the `python-domino` library will be documented in this fi
* Updated runs_stdout output
* Fixed issues with import from domino_data
* Updated nbconvert dependency version to 6.3.0
* updated request user-agent to python-domino/{version}

## 1.0.8

Expand Down
2 changes: 2 additions & 0 deletions domino/authentication.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

from requests.auth import AuthBase, HTTPBasicAuth

from ._version import __version__
from .constants import DOMINO_TOKEN_FILE_KEY_NAME, DOMINO_USER_API_KEY_KEY_NAME


Expand All @@ -28,6 +29,7 @@ def __call__(self, r):
auth_token = (
self._from_token_file() if self.domino_token_file else self.auth_token
)
r.headers["User-Agent"] = f"python-domino/{__version__}"
r.headers["Authorization"] = "Bearer " + auth_token
return r

Expand Down

0 comments on commit 9dad759

Please sign in to comment.