Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature/116 add if condition executor #138

Merged
merged 17 commits into from
May 13, 2024

Conversation

MaartendeKruijf
Copy link
Collaborator

No description provided.

@MaartendeKruijf MaartendeKruijf linked an issue May 3, 2024 that may be closed by this pull request
@MaartendeKruijf MaartendeKruijf self-assigned this May 3, 2024
@MaartendeKruijf MaartendeKruijf added enhancement New feature or request cacao OASIS cacao model related issue labels May 3, 2024
@MaartendeKruijf MaartendeKruijf added this to the SOARCA 1.1 milestone May 3, 2024
@MaartendeKruijf MaartendeKruijf force-pushed the feature/116-add-if-condition-executor branch 2 times, most recently from 064f1e8 to ff78ac2 Compare May 6, 2024 08:19
@MaartendeKruijf MaartendeKruijf marked this pull request as ready for review May 6, 2024 11:05
@MaartendeKruijf MaartendeKruijf force-pushed the feature/116-add-if-condition-executor branch from e52b4b0 to 9641597 Compare May 6, 2024 12:14
return &Executor{stix: stix}
}

type IExecuter interface {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just for clarity - perhaps it would be clearer to rename this interface to something like IIfConditionExecuter?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I tried to keep it short because it's already in the package condition

}
}

return step.OnCompletion, false, nil
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is probably never invoked, right? I would believe that the "on completion" step handling should be performed at decomposer level

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is invoked when on_true or on_false are not set but the condition is valid en evaluates to true or false respectively

}
if branch {
return decomposer.ExecuteBranch(stepId, variables)
}
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If on_completion is handled at decomposer level, then I think its invocation should be performed here

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We are not branching if the on_true or on_false are not taken but for consistency sake we return the onCompletionId

Copy link
Collaborator

@lucamrgs lucamrgs left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great that we have if condition logic. But I don't understand exactly how the on_completion case is handled. Could easily be that I am missing something but I don't see that it is executed?

Also, I think that the reportStepStart and reportStepEnd calls are still missing in the if step execution

@MaartendeKruijf MaartendeKruijf force-pushed the feature/116-add-if-condition-executor branch from 9641597 to 5366135 Compare May 6, 2024 13:12
Copy link
Collaborator

@RabbITCybErSeC RabbITCybErSeC left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Furthermore, in the documentation the following points should be added:

Explaination of what Stix Pattern we have implemented + which ones not

utils/stix/strix.go Outdated Show resolved Hide resolved
@MaartendeKruijf MaartendeKruijf force-pushed the feature/116-add-if-condition-executor branch from 638b755 to 7b24b84 Compare May 8, 2024 12:09
RabbITCybErSeC
RabbITCybErSeC previously approved these changes May 8, 2024
utils/stix/strix.go Outdated Show resolved Hide resolved
@MaartendeKruijf MaartendeKruijf removed the request for review from hidde-jan May 8, 2024 12:13
Copy link
Collaborator

@lucamrgs lucamrgs left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Acknowledged the explanation and reporter changes, and it looks good to me!

@MaartendeKruijf MaartendeKruijf merged commit 8f39ce8 into development May 13, 2024
9 checks passed
@MaartendeKruijf MaartendeKruijf deleted the feature/116-add-if-condition-executor branch May 13, 2024 15:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cacao OASIS cacao model related issue enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add if-condition executor
3 participants