Skip to content

Commit

Permalink
SOARCA-179: Fix spelling mistake 'executer' -> 'executor'
Browse files Browse the repository at this point in the history
  • Loading branch information
mpboom committed Jan 31, 2025
1 parent 7c124ff commit 074ae86
Show file tree
Hide file tree
Showing 17 changed files with 43 additions and 43 deletions.
2 changes: 1 addition & 1 deletion docs/content/en/docs/core-components/api-design.md
Original file line number Diff line number Diff line change
Expand Up @@ -372,7 +372,7 @@ None
@endjson
```

Module is the executing module name that will do the executer call.
Module is the executing module name that will do the executor call.

Category defines what kind of step is executed:
```plantuml
Expand Down
2 changes: 1 addition & 1 deletion docs/content/en/docs/core-components/decomposer.md
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ loop for all playbook steps
decomposer -> decomposer: parse command
decomposer -> exe: execute command
note over exe: correct executer is selected
note over exe: correct executor is selected
... Time has passed ...
decomposer <-- exe
end loop
Expand Down
4 changes: 2 additions & 2 deletions docs/content/en/docs/core-components/executer.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
---
title: Executer
title: Executor
weight: 5
categories: [architecture]
tags: []
description: >
Design of the SOARCA step executer
Design of the SOARCA step executor
---

## Components
Expand Down
6 changes: 3 additions & 3 deletions docs/content/en/docs/core-components/modules.md
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
---
title: Executer Modules
title: Executor Modules
weight: 6
categories: [architecture]
tags: [components]
description: >
Native executer modules
Native executor modules
---

Executer modules are part of the SOARCA core. Executer modules perform the actual commands in CACAO playbook steps.
Executor modules are part of the SOARCA core. Executor modules perform the actual commands in CACAO playbook steps.

## Native modules in SOARCA
The following capability modules are currently defined in SOARCA:
Expand Down
4 changes: 2 additions & 2 deletions docs/content/en/docs/core-components/reporting.md
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ Cache .up.|> IDownStreamReporter

The reporting logic and extensibility is implemented in the SOARCA architecture by means of reporting interfaces. At this stage, we implement an *IWorkflowReporter* to push information about the entire workflow to be executed, and an *IStepReporter* to push step-specific information as the steps of the workflow are executed.

A high level *Reporter* component will implement both interfaces, and maintain the list of *DownStreamRepporter*s activated for the SOARCA instance. The *Reporter* class will invoke all reporting functions for each active reporter. The *Executer* and *Decomposer* components will be injected each with the Reporter though, as interface of respectively workflow reporter, and step reporter, to keep the reporting scope separated.
A high level *Reporter* component will implement both interfaces, and maintain the list of *DownStreamRepporter*s activated for the SOARCA instance. The *Reporter* class will invoke all reporting functions for each active reporter. The *Executor* and *Decomposer* components will be injected each with the Reporter though, as interface of respectively workflow reporter, and step reporter, to keep the reporting scope separated.

The *DownStream* reporters will implement push-based reporting functions specific for the reporting target, as shown in the *IDownStreamReporter* interface. Internal components to SOARCA, and third-party tool reporters, will thus implement the *IDownStreamReporter* interface.

Expand All @@ -89,7 +89,7 @@ SOARCA implements internally reporting modules to handle database and caches rep

### Cache reporter

The *Cache* reporter mediates between [decomposer](https://cossas.github.io/SOARCA/docs/core-components/decomposer/) and [executors](https://cossas.github.io/SOARCA/docs/core-components/executer/), [database](https://cossas.github.io/SOARCA/docs/core-components/database/), and reporting APIs. As *DownStreamReporter*, the *Cache* stores workflow and step reports in-memory for an ongoing execution. As *IExecutionInformant*, the *Cache* provides information to the reporting API. The schema below shows how it is positioned in the SOARCA architecture.
The *Cache* reporter mediates between [decomposer](https://cossas.github.io/SOARCA/docs/core-components/decomposer/) and [executors](https://cossas.github.io/SOARCA/docs/core-components/executor/), [database](https://cossas.github.io/SOARCA/docs/core-components/database/), and reporting APIs. As *DownStreamReporter*, the *Cache* stores workflow and step reports in-memory for an ongoing execution. As *IExecutionInformant*, the *Cache* provides information to the reporting API. The schema below shows how it is positioned in the SOARCA architecture.

```plantuml
@startuml
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -103,31 +103,31 @@ Interface IPlaybookDatabase
Interface IDatabase
Interface ICapability
Interface IDecomposer
Interface IExecuter
Interface IExecutor
class Controller
class Decomposer
class PlaybookDatabase
class Status
class Mongo
class Capability
Class Executer
Class Executor
IPlaybook <|.. Playbook
ITrigger <|.. Trigger
IStatus <|.. Status
ICapability <|.. Capability
IExecuter <|.. Executer
IExecutor <|.. Executor
Trigger -> IPlaybookDatabase
IPlaybookDatabase <- Playbook
IPlaybookDatabase <|.. PlaybookDatabase
IDatabase <-up- PlaybookDatabase
IDatabase <|.. Mongo
IDecomposer <- Trigger
IDecomposer <|.. Decomposer
IExecuter <- Decomposer
ICapability <- Executer
IExecutor <- Decomposer
ICapability <- Executor
@enduml
```

Expand Down Expand Up @@ -155,7 +155,7 @@ interface ITrigger{
Interface IPlaybookDatabase
Interface IDecomposer
Interface IExecuter
Interface IExecutor
class Trigger
class Controller
Expand All @@ -173,7 +173,7 @@ IPlaybookDatabase <|.. PlaybookDatabase
IDecomposer <- Trigger
IDecomposer <|.. Decomposer
IExecuter -> Decomposer
IExecutor -> Decomposer
```

Expand Down
2 changes: 1 addition & 1 deletion docs/content/en/docs/soarca-extensions/fin-protocol.md
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ The message is used to register a fin to SOARCA. It has the following payload.
"capabilities": [
{
"capability_id": "uuid",
"name": "ssh executer",
"name": "ssh executor",
"version": "0.1.0",
"step": {
"type": "action",
Expand Down
2 changes: 1 addition & 1 deletion pkg/core/capability/http/http.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import (
"soarca/pkg/utils/http"
)

// Receive HTTP API command data from decomposer/executer
// Receive HTTP API command data from decomposer/executor
// Validate HTTP API call
// Run HTTP API call
// Return response
Expand Down
8 changes: 4 additions & 4 deletions pkg/core/decomposer/decomposer.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,8 @@ func init() {
}

func New(actionExecutor executors.IActionExecutor,
playbookActionExecutor executors.IPlaybookExecuter,
condition executors.IConditionExecuter,
playbookActionExecutor executors.IPlaybookExecutor,
condition executors.IConditionExecutor,
guid guid.IGuid,
reporter reporter.IWorkflowReporter,
time timeUtil.ITime) *Decomposer {
Expand All @@ -60,8 +60,8 @@ type Decomposer struct {
playbook cacao.Playbook
details ExecutionDetails
actionExecutor executors.IActionExecutor
playbookActionExecutor executors.IPlaybookExecuter
conditionExecutor executors.IConditionExecuter
playbookActionExecutor executors.IPlaybookExecutor
conditionExecutor executors.IConditionExecutor
guid guid.IGuid
reporter reporter.IWorkflowReporter
time timeUtil.ITime
Expand Down
2 changes: 1 addition & 1 deletion pkg/core/executors/action/action.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ func New(capabilities map[string]capability.ICapability, reporter reporter.IStep
return &instance
}

type IExecuter interface {
type IExecutor interface {
Execute(metadata execution.Metadata,
step executors.PlaybookStepMetadata) (cacao.Variables, error)
}
Expand Down
18 changes: 9 additions & 9 deletions pkg/core/executors/action/action_executor_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ func TestExecuteStep(t *testing.T) {

capabilities := map[string]capability.ICapability{"mock-ssh": mock_ssh, "http-api": mock_http}

executerObject := New(capabilities, mock_reporter, mock_time)
executorObject := New(capabilities, mock_reporter, mock_time)
executionId, _ := uuid.Parse("6ba7b810-9dad-11d1-80b4-00c04fd430c8")
playbookId := "playbook--d09351a2-a075-40c8-8054-0b7c423db83f"
stepId := "step--81eff59f-d084-4324-9e0a-59e353dbd28f"
Expand Down Expand Up @@ -99,7 +99,7 @@ func TestExecuteStep(t *testing.T) {
Return(cacao.NewVariables(expectedVariables),
nil)

_, err := executerObject.Execute(metadata,
_, err := executorObject.Execute(metadata,
actionMetadata)

assert.Equal(t, err, nil)
Expand All @@ -116,7 +116,7 @@ func TestExecuteActionStep(t *testing.T) {

capabilities := map[string]capability.ICapability{"ssh": mock_ssh, "http-api": mock_http}

executerObject := New(capabilities, mock_reporter, mock_time)
executorObject := New(capabilities, mock_reporter, mock_time)
executionId, _ := uuid.Parse("6ba7b810-9dad-11d1-80b4-00c04fd430c8")
playbookId := "playbook--d09351a2-a075-40c8-8054-0b7c423db83f"
stepId := "step--81eff59f-d084-4324-9e0a-59e353dbd28f"
Expand Down Expand Up @@ -166,7 +166,7 @@ func TestExecuteActionStep(t *testing.T) {
variables: cacao.NewVariables(expectedVariables),
agent: agent}

_, err := executerObject.executeCommands(metadata,
_, err := executorObject.executeCommands(metadata,
data)

assert.Equal(t, err, nil)
Expand All @@ -182,7 +182,7 @@ func TestNonExistingCapabilityStep(t *testing.T) {

capabilities := map[string]capability.ICapability{"ssh": mock_ssh, "http-api": mock_http}

executerObject := New(capabilities, new(mock_reporter.Mock_Reporter), mock_time)
executorObject := New(capabilities, new(mock_reporter.Mock_Reporter), mock_time)
executionId, _ := uuid.Parse("6ba7b810-9dad-11d1-80b4-00c04fd430c8")
playbookId := "playbook--d09351a2-a075-40c8-8054-0b7c423db83f"
stepId := "step--81eff59f-d084-4324-9e0a-59e353dbd28f"
Expand Down Expand Up @@ -218,7 +218,7 @@ func TestNonExistingCapabilityStep(t *testing.T) {
target: expectedTarget,
variables: cacao.NewVariables(expectedVariables),
agent: agent}
_, err := executerObject.executeCommands(metadata,
_, err := executorObject.executeCommands(metadata,
data)

assert.Equal(t, err, errors.New("capability: non-existing is not available in soarca"))
Expand All @@ -232,7 +232,7 @@ func TestVariableInterpolation(t *testing.T) {

capabilities := map[string]capability.ICapability{"cap1": mock_capability1}

executerObject := New(capabilities, new(mock_reporter.Mock_Reporter), mock_time)
executorObject := New(capabilities, new(mock_reporter.Mock_Reporter), mock_time)
executionId, _ := uuid.Parse("6ba7b810-9dad-11d1-80b4-00c04fd430c8")
playbookId := "playbook--d09351a2-a075-40c8-8054-0b7c423db83f"
stepId := "step--81eff59f-d084-4324-9e0a-59e353dbd28f"
Expand Down Expand Up @@ -383,7 +383,7 @@ func TestVariableInterpolation(t *testing.T) {
variables: cacao.NewVariables(var1, var2, var3, varUser, varPassword, varOauth, varPrivateKey, varToken, varUserId, varheader1, varheader2),
agent: agent}

_, err := executerObject.executeCommands(metadata,
_, err := executorObject.executeCommands(metadata,
data1)

assert.Equal(t, err, nil)
Expand Down Expand Up @@ -424,7 +424,7 @@ func TestVariableInterpolation(t *testing.T) {
variables: cacao.NewVariables(varHttpContent, varheader1, varheader2),
agent: agent}

_, err = executerObject.executeCommands(metadata,
_, err = executorObject.executeCommands(metadata,
data2)

assert.Equal(t, err, nil)
Expand Down
2 changes: 1 addition & 1 deletion pkg/core/executors/condition/condition.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ func New(comparison comparison.IComparison,
reporter: reporter, time: time}
}

type IExecuter interface {
type IExecutor interface {
Execute(metadata execution.Metadata,
step cacao.Step, variables cacao.Variables) (string, bool, error)
}
Expand Down
4 changes: 2 additions & 2 deletions pkg/core/executors/executors.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import (
"soarca/pkg/models/execution"
)

type IPlaybookExecuter interface {
type IPlaybookExecutor interface {
Execute(execution.Metadata,
cacao.Step,
cacao.Variables) (cacao.Variables, error)
Expand All @@ -16,7 +16,7 @@ type Context struct {
Variables cacao.Variables
}

type IConditionExecuter interface {
type IConditionExecutor interface {
Execute(metadata execution.Metadata,
stepContext Context) (string, bool, error)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ func TestExecutePlaybook(t *testing.T) {
controller := new(mock_decomposer_controller.Mock_Controller)
database := new(mock_database_controller.Mock_Controller)

executerObject := New(controller, database, mock_reporter, mock_time)
executorObject := New(controller, database, mock_reporter, mock_time)
executionId, _ := uuid.Parse("6ba7b810-9dad-11d1-80b4-00c04fd430c8")
playbookId := "playbook--d09351a2-a075-40c8-8054-0b7c423db83f"
stepId := "step--81eff59f-d084-4324-9e0a-59e353dbd28f"
Expand Down Expand Up @@ -89,7 +89,7 @@ func TestExecutePlaybook(t *testing.T) {

mockDecomposer.On("Execute", playbook2).Return(&details, nil)

results, err := executerObject.Execute(metadata, step, cacao.NewVariables(addedVariables))
results, err := executorObject.Execute(metadata, step, cacao.NewVariables(addedVariables))

mockDecomposer.AssertExpectations(t)
mock_reporter.AssertExpectations(t)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ type Mock_Condition struct {
mock.Mock
}

func (executer *Mock_Condition) Execute(metadata execution.Metadata,
func (executor *Mock_Condition) Execute(metadata execution.Metadata,
context executors.Context) (string, bool, error) {
args := executer.Called(metadata, context)
args := executor.Called(metadata, context)
return args.String(0), args.Bool(1), args.Error(2)
}
4 changes: 2 additions & 2 deletions test/unittest/mocks/mock_executor/mock_executor.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@ type Mock_Action_Executor struct {
mock.Mock
}

func (executer *Mock_Action_Executor) Execute(
func (executor *Mock_Action_Executor) Execute(
metadata execution.Metadata,
details executors.PlaybookStepMetadata) (cacao.Variables,
error) {
args := executer.Called(metadata, details)
args := executor.Called(metadata, details)
return args.Get(0).(cacao.Variables), args.Error(1)
}
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@ type Mock_PlaybookActionExecutor struct {
mock.Mock
}

func (executer *Mock_PlaybookActionExecutor) Execute(metadata execution.Metadata,
func (executor *Mock_PlaybookActionExecutor) Execute(metadata execution.Metadata,
step cacao.Step,
variables cacao.Variables) (cacao.Variables, error) {
args := executer.Called(metadata, step, variables)
args := executor.Called(metadata, step, variables)
return args.Get(0).(cacao.Variables), args.Error(1)
}

0 comments on commit 074ae86

Please sign in to comment.