File tree Expand file tree Collapse file tree 2 files changed +22
-6
lines changed
src/main/kotlin/org/exploit/keeper Expand file tree Collapse file tree 2 files changed +22
-6
lines changed Original file line number Diff line number Diff line change 1
1
package org.exploit.keeper.controller.keeper
2
2
3
- import jakarta.ws.rs.GET
4
- import jakarta.ws.rs.POST
5
- import jakarta.ws.rs.PUT
6
- import jakarta.ws.rs.Path
3
+ import jakarta.ws.rs.*
7
4
import jakarta.ws.rs.container.ContainerRequestContext
8
5
import org.exploit.keeper.constant.Permission
9
6
import org.exploit.keeper.model.request.Unseal
@@ -37,7 +34,25 @@ class SystemController(
37
34
@Path(" /unseal" )
38
35
fun unseal (req : Unseal ): Progress {
39
36
policyChecker.ensureHasPermission(ctx, Permission .systemUnseal())
40
- return keeper.submit(req.payload64)
37
+
38
+ val payloads = buildList {
39
+ req.payload64?.let { add(it) }
40
+ addAll(req.payloads64)
41
+ }
42
+
43
+ if (payloads.isEmpty()) {
44
+ throw BadRequestException (" At least one payload64 must be provided" )
45
+ }
46
+
47
+ for (payload in payloads) {
48
+ val progress = keeper.submit(payload)
49
+
50
+ if (progress.ready) {
51
+ return progress
52
+ }
53
+ }
54
+
55
+ return keeper.status().progress
41
56
}
42
57
43
58
@PUT
Original file line number Diff line number Diff line change 1
1
package org.exploit.keeper.model.request
2
2
3
3
data class Unseal (
4
- val payload64 : String ,
4
+ val payload64 : String? ,
5
+ val payloads64 : List <String >,
5
6
val reset : Boolean? = false
6
7
)
You can’t perform that action at this time.
0 commit comments