Mercurial > hg > orthanc-authorization
annotate README @ 119:66b2b938c43e
fix resource-token when no anonymous profile is available
author | Alain Mazy <am@osimis.io> |
---|---|
date | Tue, 12 Sep 2023 12:39:15 +0200 |
parents | 68ce6fd8b22a |
children | c14b49c6eb6b |
rev | line source |
---|---|
1 | 1 Advanced authorization for Orthanc |
2 ================================== | |
3 | |
4 | |
5 General Information | |
6 ------------------- | |
7 | |
8 This repository contains the source code of an advanced authorization | |
9 plugin for Orthanc. | |
10 | |
11 For each incoming REST request to some URI, the plugin will query a | |
12 Web service to know whether the access is granted to the | |
13 user. Authorization credentials can be retrieved either from a GET | |
14 argument, or from a HTTP header. | |
15 | |
16 | |
17 Installation and usage | |
18 ---------------------- | |
19 | |
20 Build instructions are similar to that of Orthanc: | |
51 | 21 https://book.orthanc-server.com/faq/compiling.html |
1 | 22 |
23 Usage details are available as part of the Orthanc Book: | |
24 http://book.orthanc-server.com/plugins/authorization.html | |
25 | |
26 | |
119
66b2b938c43e
fix resource-token when no anonymous profile is available
Alain Mazy <am@osimis.io>
parents:
108
diff
changeset
|
27 Integration tests |
66b2b938c43e
fix resource-token when no anonymous profile is available
Alain Mazy <am@osimis.io>
parents:
108
diff
changeset
|
28 ----------------- |
66b2b938c43e
fix resource-token when no anonymous profile is available
Alain Mazy <am@osimis.io>
parents:
108
diff
changeset
|
29 |
66b2b938c43e
fix resource-token when no anonymous profile is available
Alain Mazy <am@osimis.io>
parents:
108
diff
changeset
|
30 Integration tests are available in the https://hg.orthanc-server.com/orthanc-tests/ repo |
66b2b938c43e
fix resource-token when no anonymous profile is available
Alain Mazy <am@osimis.io>
parents:
108
diff
changeset
|
31 in the folder NewTests/Authorization. |
66b2b938c43e
fix resource-token when no anonymous profile is available
Alain Mazy <am@osimis.io>
parents:
108
diff
changeset
|
32 |
72
e381ba725669
new PUT auth/tokens/{token-type} API route + updated interface with WebService
Alain Mazy <am@osimis.io>
parents:
51
diff
changeset
|
33 API |
e381ba725669
new PUT auth/tokens/{token-type} API route + updated interface with WebService
Alain Mazy <am@osimis.io>
parents:
51
diff
changeset
|
34 --- |
e381ba725669
new PUT auth/tokens/{token-type} API route + updated interface with WebService
Alain Mazy <am@osimis.io>
parents:
51
diff
changeset
|
35 |
e381ba725669
new PUT auth/tokens/{token-type} API route + updated interface with WebService
Alain Mazy <am@osimis.io>
parents:
51
diff
changeset
|
36 Since version 0.5.0, the plugin implements a RestA API to generate tokens |
e381ba725669
new PUT auth/tokens/{token-type} API route + updated interface with WebService
Alain Mazy <am@osimis.io>
parents:
51
diff
changeset
|
37 (provided that the Web service is able to do so). |
e381ba725669
new PUT auth/tokens/{token-type} API route + updated interface with WebService
Alain Mazy <am@osimis.io>
parents:
51
diff
changeset
|
38 |
e381ba725669
new PUT auth/tokens/{token-type} API route + updated interface with WebService
Alain Mazy <am@osimis.io>
parents:
51
diff
changeset
|
39 Sample Orthanc Flavored API: |
e381ba725669
new PUT auth/tokens/{token-type} API route + updated interface with WebService
Alain Mazy <am@osimis.io>
parents:
51
diff
changeset
|
40 |
e381ba725669
new PUT auth/tokens/{token-type} API route + updated interface with WebService
Alain Mazy <am@osimis.io>
parents:
51
diff
changeset
|
41 curl -X PUT http://localhost:8042/auth/tokens/resource-instant-link -H 'Content-Type: application/json' \ |
e381ba725669
new PUT auth/tokens/{token-type} API route + updated interface with WebService
Alain Mazy <am@osimis.io>
parents:
51
diff
changeset
|
42 -d '{"ID": "toto", |
e381ba725669
new PUT auth/tokens/{token-type} API route + updated interface with WebService
Alain Mazy <am@osimis.io>
parents:
51
diff
changeset
|
43 "Resources" : [{ |
e381ba725669
new PUT auth/tokens/{token-type} API route + updated interface with WebService
Alain Mazy <am@osimis.io>
parents:
51
diff
changeset
|
44 "DicomUid": "1.2", |
e381ba725669
new PUT auth/tokens/{token-type} API route + updated interface with WebService
Alain Mazy <am@osimis.io>
parents:
51
diff
changeset
|
45 "OrthancId": "", |
e381ba725669
new PUT auth/tokens/{token-type} API route + updated interface with WebService
Alain Mazy <am@osimis.io>
parents:
51
diff
changeset
|
46 "Level": "study" |
e381ba725669
new PUT auth/tokens/{token-type} API route + updated interface with WebService
Alain Mazy <am@osimis.io>
parents:
51
diff
changeset
|
47 }], |
e381ba725669
new PUT auth/tokens/{token-type} API route + updated interface with WebService
Alain Mazy <am@osimis.io>
parents:
51
diff
changeset
|
48 "Type": "resource-instant-link", |
e381ba725669
new PUT auth/tokens/{token-type} API route + updated interface with WebService
Alain Mazy <am@osimis.io>
parents:
51
diff
changeset
|
49 "ExpirationDate": "2026-12-31T11:00:00Z"}' |
e381ba725669
new PUT auth/tokens/{token-type} API route + updated interface with WebService
Alain Mazy <am@osimis.io>
parents:
51
diff
changeset
|
50 |
e381ba725669
new PUT auth/tokens/{token-type} API route + updated interface with WebService
Alain Mazy <am@osimis.io>
parents:
51
diff
changeset
|
51 Sample response: |
e381ba725669
new PUT auth/tokens/{token-type} API route + updated interface with WebService
Alain Mazy <am@osimis.io>
parents:
51
diff
changeset
|
52 { |
e381ba725669
new PUT auth/tokens/{token-type} API route + updated interface with WebService
Alain Mazy <am@osimis.io>
parents:
51
diff
changeset
|
53 "Token": "e148.....", |
e381ba725669
new PUT auth/tokens/{token-type} API route + updated interface with WebService
Alain Mazy <am@osimis.io>
parents:
51
diff
changeset
|
54 "Url": null |
e381ba725669
new PUT auth/tokens/{token-type} API route + updated interface with WebService
Alain Mazy <am@osimis.io>
parents:
51
diff
changeset
|
55 } |
e381ba725669
new PUT auth/tokens/{token-type} API route + updated interface with WebService
Alain Mazy <am@osimis.io>
parents:
51
diff
changeset
|
56 |
e381ba725669
new PUT auth/tokens/{token-type} API route + updated interface with WebService
Alain Mazy <am@osimis.io>
parents:
51
diff
changeset
|
57 The API that must be implemented by the webservice is slighlty different wrt naming conventions: |
e381ba725669
new PUT auth/tokens/{token-type} API route + updated interface with WebService
Alain Mazy <am@osimis.io>
parents:
51
diff
changeset
|
58 |
e381ba725669
new PUT auth/tokens/{token-type} API route + updated interface with WebService
Alain Mazy <am@osimis.io>
parents:
51
diff
changeset
|
59 curl -X PUT http://localhost:8000/tokens/resource-instant-link -H 'Content-Type: application/json' \ |
e381ba725669
new PUT auth/tokens/{token-type} API route + updated interface with WebService
Alain Mazy <am@osimis.io>
parents:
51
diff
changeset
|
60 -d '{"id": "toto", |
e381ba725669
new PUT auth/tokens/{token-type} API route + updated interface with WebService
Alain Mazy <am@osimis.io>
parents:
51
diff
changeset
|
61 "resources" : [{ |
e381ba725669
new PUT auth/tokens/{token-type} API route + updated interface with WebService
Alain Mazy <am@osimis.io>
parents:
51
diff
changeset
|
62 "dicom-uid": "1.2", |
e381ba725669
new PUT auth/tokens/{token-type} API route + updated interface with WebService
Alain Mazy <am@osimis.io>
parents:
51
diff
changeset
|
63 "level": "study" |
e381ba725669
new PUT auth/tokens/{token-type} API route + updated interface with WebService
Alain Mazy <am@osimis.io>
parents:
51
diff
changeset
|
64 }], |
e381ba725669
new PUT auth/tokens/{token-type} API route + updated interface with WebService
Alain Mazy <am@osimis.io>
parents:
51
diff
changeset
|
65 "type": "resource-instant-link", |
e381ba725669
new PUT auth/tokens/{token-type} API route + updated interface with WebService
Alain Mazy <am@osimis.io>
parents:
51
diff
changeset
|
66 "expiration-date": "2026-12-31T11:00:00Z"}' |
e381ba725669
new PUT auth/tokens/{token-type} API route + updated interface with WebService
Alain Mazy <am@osimis.io>
parents:
51
diff
changeset
|
67 |
e381ba725669
new PUT auth/tokens/{token-type} API route + updated interface with WebService
Alain Mazy <am@osimis.io>
parents:
51
diff
changeset
|
68 Sample response: |
e381ba725669
new PUT auth/tokens/{token-type} API route + updated interface with WebService
Alain Mazy <am@osimis.io>
parents:
51
diff
changeset
|
69 { |
e381ba725669
new PUT auth/tokens/{token-type} API route + updated interface with WebService
Alain Mazy <am@osimis.io>
parents:
51
diff
changeset
|
70 "token": "e148.....", |
e381ba725669
new PUT auth/tokens/{token-type} API route + updated interface with WebService
Alain Mazy <am@osimis.io>
parents:
51
diff
changeset
|
71 "url": null |
e381ba725669
new PUT auth/tokens/{token-type} API route + updated interface with WebService
Alain Mazy <am@osimis.io>
parents:
51
diff
changeset
|
72 } |
e381ba725669
new PUT auth/tokens/{token-type} API route + updated interface with WebService
Alain Mazy <am@osimis.io>
parents:
51
diff
changeset
|
73 |
e381ba725669
new PUT auth/tokens/{token-type} API route + updated interface with WebService
Alain Mazy <am@osimis.io>
parents:
51
diff
changeset
|
74 |
e381ba725669
new PUT auth/tokens/{token-type} API route + updated interface with WebService
Alain Mazy <am@osimis.io>
parents:
51
diff
changeset
|
75 |
108 | 76 Contributing |
77 ------------ | |
78 | |
79 Instructions for contributing to the Orthanc project are included in | |
80 the Orthanc Book: | |
81 https://book.orthanc-server.com/developers/repositories.html | |
82 | |
83 | |
1 | 84 Licensing |
85 --------- | |
86 | |
87 The authorization plugin for Orthanc is licensed under the AGPL license. | |
88 | |
89 We also kindly ask scientific works and clinical studies that make | |
90 use of Orthanc to cite Orthanc in their associated publications. | |
91 Similarly, we ask open-source and closed-source products that make | |
92 use of Orthanc to warn us about this use. You can cite our work | |
93 using the following BibTeX entry: | |
94 | |
95 @inproceedings{Jodogne:ISBI2013, | |
96 author = {Jodogne, S. and Bernard, C. and Devillers, M. and Lenaerts, E. and Coucke, P.}, | |
97 title = {Orthanc -- {A} Lightweight, {REST}ful {DICOM} Server for Healthcare and Medical Research}, | |
98 booktitle={Biomedical Imaging ({ISBI}), {IEEE} 10th International Symposium on}, | |
99 year={2013}, | |
100 pages={190-193}, | |
101 ISSN={1945-7928}, | |
102 month=apr, | |
103 url={http://ieeexplore.ieee.org/xpl/articleDetails.jsp?tp=&arnumber=6556444}, | |
104 address={San Francisco, {CA}, {USA}} | |
105 } |