Commit fa9be4b
authored
Secure repository file paths and stream downloads (#1024)
* Secure repository file paths and stream downloads
Centralize repository file handling through FileRepositoryHelper for AAS
thumbnails, submodel attachments, and AASX packages. Uploaded logical
filenames are now validated as display names only, while stored repository
ids are generated server-side.
Stream thumbnail and attachment HTTP responses from the repository instead
of materializing repository ids as local filesystem paths. Keep legacy File
APIs compatible via safe temp-file/default fallbacks.
Update replacement/delete flows to update domain references safely and clean
up old repository entries after successful updates. Add regression coverage
for path traversal names, absolute repository keys, stream handling, and
authorization behavior.
* Fixes failing tests1 parent d42fbd0 commit fa9be4b
44 files changed
Lines changed: 1674 additions & 275 deletions
File tree
- basyx.aasenvironment/basyx.aasenvironment-core/src/main/java/org/eclipse/digitaltwin/basyx/aasenvironment/base
- basyx.aasrepository
- basyx.aasrepository-backend/src/main/java/org/eclipse/digitaltwin/basyx/aasrepository/backend
- basyx.aasrepository-client/src/main/java/org/eclipse/digitaltwin/basyx/aasrepository/client
- basyx.aasrepository-core/src
- main/java/org/eclipse/digitaltwin/basyx/aasrepository
- test/java/org/eclipse/digitaltwin/basyx/aasrepository
- basyx.aasrepository-feature-authorization/src/main/java/org/eclipse/digitaltwin/basyx/aasrepository/feature/authorization
- basyx.aasrepository-feature-discovery-integration/src/main/java/org/eclipse/digitaltwin/basyx/aasrepository/feature/discoveryintegration
- basyx.aasrepository-feature-kafka/src/main/java/org/eclipse/digitaltwin/basyx/aasrepository/feature/kafka
- basyx.aasrepository-feature-mqtt/src/main/java/org/eclipse/digitaltwin/basyx/aasrepository/feature/mqtt
- basyx.aasrepository-feature-registry-integration/src/main/java/org/eclipse/digitaltwin/basyx/aasrepository/feature/registry/integration
- basyx.aasrepository-feature-search/src/main/java/org/eclipse/digitaltwin/basyx/aasrepository/feature/search
- basyx.aasrepository-http/src/main/java/org/eclipse/digitaltwin/basyx/aasrepository/http
- basyx.aasservice
- basyx.aasservice-backend/src
- main/java/org/eclipse/digitaltwin/basyx/aasservice/backend
- test/java/org/eclipse/digitaltwin/basyx/aasservice/backend
- basyx.aasservice-client/src/main/java/org/eclipse/digitaltwin/basyx/aasservice/client
- basyx.aasservice-core/src/main/java/org/eclipse/digitaltwin/basyx/aasservice
- basyx.aasservice-feature-mqtt/src/main/java/org/eclipse/digitaltwin/basyx/aasservice/feature/mqtt
- basyx.aasxfileserver
- basyx.aasxfileserver-backend/src/main/java/org/eclipse/digitaltwin/basyx/aasxfileserver/backend
- basyx.aasxfileserver-core/src/test/java/org/eclipse/digitaltwin/basyx/aasxfileserver/core
- basyx.common/basyx.filerepository-backend/src
- main/java/org/eclipse/digitaltwin/basyx/core/filerepository
- test/java/org/eclipse/digitaltwin/basyx/core/filerepository
- basyx.submodelrepository
- basyx.submodelrepository-backend/src/main/java/org/eclipse/digitaltwin/basyx/submodelrepository/backend
- basyx.submodelrepository-client/src/main/java/org/eclipse/digitaltwin/basyx/submodelrepository/client
- basyx.submodelrepository-core/src
- main/java/org/eclipse/digitaltwin/basyx/submodelrepository
- test/java/org/eclipse/digitaltwin/basyx/submodelrepository/core
- basyx.submodelrepository-feature-authorization/src/main/java/org/eclipse/digitaltwin/basyx/submodelrepository/feature/authorization
- basyx.submodelrepository-feature-kafka/src/main/java/org/eclipse/digitaltwin/basyx/submodelrepository/feature/kafka
- basyx.submodelrepository-feature-mqtt/src/main/java/org/eclipse/digitaltwin/basyx/submodelrepository/feature/mqtt
- basyx.submodelrepository-feature-operation-delegation/src/main/java/org/eclipse/digitaltwin/basyx/submodelrepository/feature/operation/delegation
- basyx.submodelrepository-feature-registry-integration/src/main/java/org/eclipse/digitaltwin/basyx/submodelrepository/feature/registry/integration
- basyx.submodelrepository-feature-search/src/main/java/org/eclipse/digitaltwin/basyx/submodelrepository/feature/search
- basyx.submodelrepository-http/src/main/java/org/eclipse/digitaltwin/basyx/submodelrepository/http
- basyx.submodelservice
- basyx.submodelservice-backend/src
- main/java/org/eclipse/digitaltwin/basyx/submodelservice/backend
- test/java/org/eclipse/digitaltwin/basyx/submodelservice/backend
- basyx.submodelservice-client/src/main/java/org/eclipse/digitaltwin/basyx/submodelservice/client
- basyx.submodelservice-core/src/main/java/org/eclipse/digitaltwin/basyx/submodelservice
- basyx.submodelservice-feature-authorization/src
- main/java/org/eclipse/digitaltwin/basyx/submodelservice/feature/authorization
- test/java/org/eclipse/digitaltwin/basyx/submodelservice/feature/authorization
- basyx.submodelservice-feature-kafka/src/main/java/org/eclipse/digitaltwin/basyx/submodelservice/feature/kafka
- basyx.submodelservice-feature-mqtt/src/main/java/org/eclipse/digitaltwin/basyx/submodelservice/feature/mqtt
- basyx.submodelservice-feature-operation-dispatching/src/main/java/org/eclipse/digitaltwin/basyx/submodelservice/feature/operationdispatching
- basyx.submodelservice-http/src/main/java/org/eclipse/digitaltwin/basyx/submodelservice/http
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
Lines changed: 23 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
371 | 371 | | |
372 | 372 | | |
373 | 373 | | |
374 | | - | |
| 374 | + | |
| 375 | + | |
| 376 | + | |
375 | 377 | | |
376 | 378 | | |
377 | 379 | | |
| |||
386 | 388 | | |
387 | 389 | | |
388 | 390 | | |
389 | | - | |
| 391 | + | |
390 | 392 | | |
391 | 393 | | |
392 | 394 | | |
| |||
397 | 399 | | |
398 | 400 | | |
399 | 401 | | |
| 402 | + | |
| 403 | + | |
| 404 | + | |
| 405 | + | |
| 406 | + | |
| 407 | + | |
| 408 | + | |
| 409 | + | |
| 410 | + | |
| 411 | + | |
| 412 | + | |
| 413 | + | |
| 414 | + | |
| 415 | + | |
| 416 | + | |
| 417 | + | |
| 418 | + | |
| 419 | + | |
| 420 | + | |
400 | 421 | | |
401 | 422 | | |
402 | 423 | | |
| |||
Lines changed: 5 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
138 | 138 | | |
139 | 139 | | |
140 | 140 | | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
141 | 146 | | |
142 | 147 | | |
143 | 148 | | |
| |||
Lines changed: 5 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
181 | 181 | | |
182 | 182 | | |
183 | 183 | | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
184 | 189 | | |
185 | 190 | | |
186 | 191 | | |
| |||
Lines changed: 45 additions & 23 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | | - | |
| 3 | + | |
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
10 | 10 | | |
11 | | - | |
| 11 | + | |
12 | 12 | | |
13 | 13 | | |
14 | | - | |
| 14 | + | |
15 | 15 | | |
16 | 16 | | |
17 | 17 | | |
18 | 18 | | |
19 | 19 | | |
20 | 20 | | |
21 | 21 | | |
22 | | - | |
| 22 | + | |
23 | 23 | | |
24 | 24 | | |
25 | 25 | | |
26 | 26 | | |
27 | 27 | | |
| 28 | + | |
| 29 | + | |
28 | 30 | | |
29 | 31 | | |
30 | 32 | | |
| |||
34 | 36 | | |
35 | 37 | | |
36 | 38 | | |
| 39 | + | |
37 | 40 | | |
38 | 41 | | |
39 | 42 | | |
40 | 43 | | |
41 | 44 | | |
42 | 45 | | |
43 | | - | |
| 46 | + | |
44 | 47 | | |
45 | 48 | | |
46 | 49 | | |
47 | 50 | | |
48 | | - | |
| 51 | + | |
49 | 52 | | |
50 | 53 | | |
51 | | - | |
| 54 | + | |
52 | 55 | | |
53 | 56 | | |
54 | 57 | | |
55 | 58 | | |
56 | 59 | | |
57 | 60 | | |
58 | | - | |
| 61 | + | |
59 | 62 | | |
60 | 63 | | |
61 | 64 | | |
| |||
64 | 67 | | |
65 | 68 | | |
66 | 69 | | |
67 | | - | |
| 70 | + | |
68 | 71 | | |
69 | 72 | | |
70 | 73 | | |
| |||
74 | 77 | | |
75 | 78 | | |
76 | 79 | | |
77 | | - | |
| 80 | + | |
78 | 81 | | |
79 | 82 | | |
80 | 83 | | |
81 | 84 | | |
82 | 85 | | |
83 | 86 | | |
84 | 87 | | |
85 | | - | |
| 88 | + | |
86 | 89 | | |
87 | 90 | | |
88 | 91 | | |
89 | 92 | | |
90 | 93 | | |
91 | 94 | | |
92 | | - | |
| 95 | + | |
93 | 96 | | |
94 | 97 | | |
95 | 98 | | |
| |||
98 | 101 | | |
99 | 102 | | |
100 | 103 | | |
101 | | - | |
| 104 | + | |
102 | 105 | | |
103 | 106 | | |
104 | 107 | | |
105 | 108 | | |
106 | 109 | | |
107 | 110 | | |
108 | | - | |
| 111 | + | |
109 | 112 | | |
110 | 113 | | |
111 | 114 | | |
112 | 115 | | |
113 | 116 | | |
114 | 117 | | |
115 | | - | |
| 118 | + | |
116 | 119 | | |
117 | 120 | | |
118 | 121 | | |
119 | 122 | | |
120 | 123 | | |
121 | 124 | | |
122 | 125 | | |
123 | | - | |
| 126 | + | |
124 | 127 | | |
125 | 128 | | |
126 | | - | |
| 129 | + | |
127 | 130 | | |
128 | 131 | | |
129 | 132 | | |
130 | 133 | | |
131 | 134 | | |
132 | 135 | | |
133 | | - | |
| 136 | + | |
134 | 137 | | |
135 | 138 | | |
136 | 139 | | |
137 | 140 | | |
138 | 141 | | |
139 | 142 | | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
140 | 162 | | |
141 | 163 | | |
142 | | - | |
| 164 | + | |
143 | 165 | | |
144 | 166 | | |
145 | 167 | | |
| |||
153 | 175 | | |
154 | 176 | | |
155 | 177 | | |
156 | | - | |
| 178 | + | |
157 | 179 | | |
158 | 180 | | |
159 | 181 | | |
160 | 182 | | |
161 | | - | |
| 183 | + | |
162 | 184 | | |
163 | 185 | | |
164 | | - | |
| 186 | + | |
165 | 187 | | |
166 | 188 | | |
167 | 189 | | |
168 | 190 | | |
169 | 191 | | |
170 | | - | |
| 192 | + | |
171 | 193 | | |
Lines changed: 5 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
88 | 88 | | |
89 | 89 | | |
90 | 90 | | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
91 | 96 | | |
92 | 97 | | |
93 | 98 | | |
| |||
0 commit comments