Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Add session utils for authentication and authorization using OpenID Connect (OIDC) #67

Draft
wants to merge 3 commits into
base: master
Choose a base branch
from
Draft
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
1 change: 1 addition & 0 deletions requirements_test.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,6 @@ pytest==6.2.4
pytest-cov==2.12.1
pytest-flake8==1.0.7
pytest-localserver==0.5.0
responses==0.10.16
types-requests==2.27.14
types-Pillow==9.0.8
3 changes: 2 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@
package_dir={'': 'src'},
extras_require={
'gcp': [
'dataclasses>=0.8; python_version=="3.6"',
'dataclasses>=0.8; python_version < "3.7.0"',
'google-auth>=1.6',
'google-oauth>=1.0',
],
Expand All @@ -61,6 +61,7 @@
install_requires=[
'numpy>=1.19',
'requests>=2.18',
'requests-oauthlib>=1.2',
'retrying>=1.3.3',
'Pillow>=8.3',
'pydicom>=2.2',
Expand Down
4 changes: 2 additions & 2 deletions src/dicomweb_client/ext/gcp/session_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@


def create_session_from_gcp_credentials(
google_credentials: Optional[Any] = None
) -> requests.Session:
google_credentials: Optional[Any] = None
) -> requests.Session:
"""Creates an authorized session for Google Cloud Platform.

Parameters
Expand Down
2 changes: 1 addition & 1 deletion src/dicomweb_client/file.py
Original file line number Diff line number Diff line change
Expand Up @@ -612,7 +612,7 @@ def decode_frame(self, index: int, value: bytes):
n_pixels = self._pixels_per_frame
pixel_offset = int(((index * n_pixels / 8) % 1) * 8)
pixel_array = unpacked_frame[pixel_offset:pixel_offset + n_pixels]
return pixel_array.reshape(rows, columns)
return pixel_array.reshape(rows, columns) # type: ignore
else:
# This hack creates a small dataset containing a Pixel Data element
# with only a single frame item, which can then be decoded using the
Expand Down
Loading