File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -16,8 +16,20 @@ public WindowsFrontendAdapter(WindowsExecution execution) {
1616 this .execution = Objects .requireNonNull (execution , "execution" );
1717 }
1818
19- public CompletionStage <WindowsExecution .Result > accept (WindowsCall call ) {
19+ public CompletionStage <WindowsExecution .WindowsExecutionResult > accept (WindowsCall call ) {
2020 Objects .requireNonNull (call , "call" );
21- return CompletableFuture .supplyAsync (() -> execution .execute (call ));
21+ if (!execution .program ().equals (call .program ())
22+ || !execution .directive ().equals (call .directive ())
23+ || !execution .citizen ().equals (call .citizen ())) {
24+ return CompletableFuture .failedStage (
25+ new SecurityException ("Windows call does not match the configured execution context" ));
26+ }
27+ return CompletableFuture .supplyAsync (() -> {
28+ try {
29+ return execution .execute ();
30+ } catch (Exception e ) {
31+ throw new RuntimeException ("Windows execution failed" , e );
32+ }
33+ });
2234 }
2335}
You can’t perform that action at this time.
0 commit comments