Commit 0ede788
authored
refactor: store PEDM configuration in SQLite instead of JSON files (#1356)
Previously the PEDM profiles and assignments were wrapped up in a
`Policy` object, which was loaded at startup and then maintained via an
`IdList` structure. API calls would have the `Policy` in their context
and interact with it directly.
This PR:
- Strips out unused features from the API surface area (session /
temporary elevations, revoke elevation). We don't support them right now
and it just adds noise.
- The remaining `Policy` item needed for elevation is the current user
selected profile. We load this from the DB at the API front -end and
pass it back to where it's needed.
- The API now calls the database directly to query/update/delete. In
most cases transactions are used where we need to enforce consistency,
but we are not expecting a high volume of calls or needing a high level
of atomicity.
The API and database design is not the most well thought-out, but it
closely reflects the _existing_ APIs to minimize disruption elsewhere
(API clients like RDM, as well as avoid significant behaviour changes
that may introduce new bugs).
Concerns are:
- There's no effort to maintain compatibility here. Existing PEDM users
will need to uninstall, wipe out their %programdata%\Agent\pedm
directory, and reinstall. Internally I'll provide a script to do that.
RDM will be blocked from using any version that doesn't include these
changes.
- The handling of users is not optimal (see @allan2 related PR). This
goes back to Kyle's original implementation and if we had made these
changes earlier, we could've addressed it, but there is no time now.
We'll have some technical debt here to correct in the future.1 parent 131a7c5 commit 0ede788
81 files changed
Lines changed: 915 additions & 4140 deletions
File tree
- crates
- devolutions-pedm
- openapi
- dotnet-client
- .openapi-generator
- api
- docs
- src/Devolutions.Pedm.Client
- Api
- Client
- Model
- schema
- src
- api
- db
- elevator
- dotnet/DesktopAgent
- Service
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
Lines changed: 0 additions & 18 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
8 | | - | |
9 | | - | |
10 | 8 | | |
11 | 9 | | |
12 | 10 | | |
| |||
18 | 16 | | |
19 | 17 | | |
20 | 18 | | |
21 | | - | |
22 | 19 | | |
23 | | - | |
24 | 20 | | |
25 | | - | |
26 | | - | |
27 | 21 | | |
28 | 22 | | |
29 | 23 | | |
30 | | - | |
31 | | - | |
32 | | - | |
33 | 24 | | |
34 | 25 | | |
35 | 26 | | |
| |||
41 | 32 | | |
42 | 33 | | |
43 | 34 | | |
44 | | - | |
45 | | - | |
46 | 35 | | |
47 | 36 | | |
48 | 37 | | |
| |||
55 | 44 | | |
56 | 45 | | |
57 | 46 | | |
58 | | - | |
59 | 47 | | |
60 | | - | |
61 | 48 | | |
62 | | - | |
63 | | - | |
64 | 49 | | |
65 | 50 | | |
66 | 51 | | |
67 | | - | |
68 | | - | |
69 | | - | |
70 | 52 | | |
Lines changed: 1 addition & 15 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
27 | 27 | | |
28 | 28 | | |
29 | 29 | | |
30 | | - | |
31 | | - | |
32 | 30 | | |
33 | 31 | | |
34 | 32 | | |
35 | 33 | | |
36 | 34 | | |
37 | 35 | | |
38 | | - | |
| 36 | + | |
39 | 37 | | |
40 | 38 | | |
41 | 39 | | |
42 | | - | |
43 | 40 | | |
44 | 41 | | |
45 | | - | |
46 | | - | |
47 | 42 | | |
48 | 43 | | |
49 | 44 | | |
| |||
52 | 47 | | |
53 | 48 | | |
54 | 49 | | |
55 | | - | |
56 | | - | |
57 | 50 | | |
58 | 51 | | |
59 | 52 | | |
| |||
65 | 58 | | |
66 | 59 | | |
67 | 60 | | |
68 | | - | |
69 | 61 | | |
70 | | - | |
71 | 62 | | |
72 | | - | |
73 | | - | |
74 | 63 | | |
75 | 64 | | |
76 | 65 | | |
77 | | - | |
78 | | - | |
79 | | - | |
80 | 66 | | |
81 | 67 | | |
82 | 68 | | |
| |||
Lines changed: 10 additions & 147 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
8 | | - | |
9 | | - | |
10 | 8 | | |
11 | 9 | | |
12 | 10 | | |
13 | 11 | | |
14 | 12 | | |
15 | 13 | | |
16 | | - | |
| 14 | + | |
17 | 15 | | |
18 | 16 | | |
19 | 17 | | |
20 | | - | |
21 | 18 | | |
22 | 19 | | |
23 | | - | |
24 | | - | |
25 | 20 | | |
26 | 21 | | |
27 | 22 | | |
| |||
50 | 45 | | |
51 | 46 | | |
52 | 47 | | |
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 | | - | |
106 | 48 | | |
107 | 49 | | |
108 | 50 | | |
| |||
222 | 164 | | |
223 | 165 | | |
224 | 166 | | |
225 | | - | |
| 167 | + | |
226 | 168 | | |
227 | 169 | | |
228 | 170 | | |
| |||
266 | 208 | | |
267 | 209 | | |
268 | 210 | | |
269 | | - | |
| 211 | + | |
270 | 212 | | |
271 | | - | |
| 213 | + | |
272 | 214 | | |
273 | 215 | | |
274 | 216 | | |
275 | 217 | | |
276 | 218 | | |
277 | 219 | | |
278 | 220 | | |
279 | | - | |
| 221 | + | |
280 | 222 | | |
281 | 223 | | |
282 | 224 | | |
| |||
288 | 230 | | |
289 | 231 | | |
290 | 232 | | |
291 | | - | |
| 233 | + | |
292 | 234 | | |
293 | 235 | | |
294 | 236 | | |
295 | 237 | | |
296 | 238 | | |
297 | 239 | | |
298 | 240 | | |
299 | | - | |
| 241 | + | |
300 | 242 | | |
301 | 243 | | |
302 | 244 | | |
| |||
305 | 247 | | |
306 | 248 | | |
307 | 249 | | |
308 | | - | |
| 250 | + | |
309 | 251 | | |
310 | 252 | | |
311 | 253 | | |
| |||
329 | 271 | | |
330 | 272 | | |
331 | 273 | | |
332 | | - | |
| 274 | + | |
333 | 275 | | |
334 | 276 | | |
335 | 277 | | |
| |||
357 | 299 | | |
358 | 300 | | |
359 | 301 | | |
360 | | - | |
| 302 | + | |
361 | 303 | | |
362 | 304 | | |
363 | 305 | | |
| |||
375 | 317 | | |
376 | 318 | | |
377 | 319 | | |
378 | | - | |
379 | | - | |
380 | | - | |
381 | | - | |
382 | | - | |
383 | | - | |
384 | | - | |
385 | | - | |
386 | | - | |
387 | | - | |
388 | | - | |
389 | | - | |
390 | | - | |
391 | | - | |
392 | | - | |
393 | | - | |
394 | | - | |
395 | | - | |
396 | | - | |
397 | | - | |
398 | | - | |
399 | | - | |
400 | | - | |
401 | | - | |
402 | | - | |
403 | | - | |
404 | | - | |
405 | | - | |
406 | | - | |
407 | 320 | | |
408 | 321 | | |
409 | 322 | | |
| |||
456 | 369 | | |
457 | 370 | | |
458 | 371 | | |
459 | | - | |
460 | | - | |
461 | | - | |
462 | | - | |
463 | | - | |
464 | | - | |
465 | | - | |
466 | | - | |
467 | | - | |
468 | | - | |
469 | | - | |
470 | | - | |
471 | | - | |
472 | | - | |
473 | | - | |
474 | | - | |
475 | | - | |
476 | | - | |
477 | | - | |
478 | | - | |
479 | | - | |
480 | | - | |
481 | | - | |
482 | | - | |
483 | | - | |
484 | | - | |
485 | | - | |
486 | | - | |
487 | | - | |
488 | | - | |
489 | | - | |
490 | | - | |
491 | | - | |
492 | | - | |
493 | | - | |
494 | | - | |
495 | | - | |
496 | | - | |
497 | | - | |
498 | | - | |
499 | | - | |
500 | | - | |
501 | | - | |
502 | | - | |
503 | | - | |
504 | | - | |
505 | | - | |
506 | | - | |
507 | | - | |
508 | | - | |
Lines changed: 0 additions & 11 deletions
This file was deleted.
Lines changed: 0 additions & 12 deletions
This file was deleted.
Lines changed: 2 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
7 | | - | |
8 | | - | |
| 7 | + | |
| 8 | + | |
9 | 9 | | |
10 | 10 | | |
11 | 11 | | |
| |||
0 commit comments