dicomtrolley.auth¶
Authentication mechanisms for DICOM servers
VitreaAuth
¶
Bases: AuthBase
Can log in to a server running Vitrea Connection 8.2.0.1
Usage¶
Raises¶
DICOMTrolleyAuthError If logging in fails
Notes¶
Vitrea login returns an auth token, but for some reason this is not checked at all and instead all validation is done based on session token.
Source code in dicomtrolley/auth.py
32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 | |
__call__(r)
¶
Called before sending the request
Source code in dicomtrolley/auth.py
98 99 100 101 102 103 104 105 | |
do_login_call(connection)
¶
Log in to vitrea connection url
Raises¶
DICOMTrolleyAuthError If logging in fails
Source code in dicomtrolley/auth.py
74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 | |
response_hook(r, **kwargs)
¶
Called before returning response. Try to log if not authenticated
Source code in dicomtrolley/auth.py
56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 | |
create_session(login_url, user, password, realm='DefaultSystemRealm')
¶
Returns a requests Session that logs in to Vitrea automatically as needed.
Facilitates single-line session creation. For readable code
Parameters¶
login_url: str Call this url to log in user: str username password: str password realm: str, optional Vitrea realm to pass when logging in. Defaults to 'DefaultSystemRealm'
Source code in dicomtrolley/auth.py
9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 | |