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

[backend/frontend] Improve latency on exercise overview #1767

Merged
merged 90 commits into from
Nov 15, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
90 commits
Select commit Hold shift + click to select a range
282e414
[backend] wip
savacano28 Oct 29, 2024
9b63826
[backend] wip
savacano28 Oct 29, 2024
65d16e6
[backend/frontend] wip
savacano28 Oct 29, 2024
a1ce0d8
[backend/frontend] wip
savacano28 Oct 29, 2024
16cd18b
[backend/frontend] wip
savacano28 Oct 29, 2024
0304966
[backend/frontend] wip
savacano28 Oct 29, 2024
8c0d1c6
[backend/frontend] clean
savacano28 Oct 30, 2024
91df99e
[backend/frontend] clean
savacano28 Oct 30, 2024
dd3899b
[backend] spotless
savacano28 Oct 30, 2024
df1289d
[backend] wip
savacano28 Nov 4, 2024
cb86477
[backend] clean
savacano28 Nov 4, 2024
505199e
[backend] wip
savacano28 Nov 5, 2024
c603460
[backend] wip
savacano28 Nov 5, 2024
c45b10a
[backend] wip
savacano28 Nov 5, 2024
61c579b
[backend] wip
savacano28 Nov 5, 2024
61f7d47
[backend] wip
savacano28 Nov 5, 2024
f6bc24b
[backend] wip
savacano28 Nov 5, 2024
d955a58
[backend] wip
savacano28 Nov 5, 2024
653b6e6
[backend] wip
savacano28 Nov 5, 2024
b45c47b
[backend] wip
savacano28 Nov 5, 2024
3bd0635
[backend] wip
savacano28 Nov 5, 2024
9195d2e
[backend] wip
savacano28 Nov 5, 2024
5c9fe53
[backend] wip
savacano28 Nov 5, 2024
da0acd6
[backend] wip
savacano28 Nov 5, 2024
f6f6bb0
[backend] wip
savacano28 Nov 6, 2024
b73ebb2
[backend] wip
savacano28 Nov 6, 2024
7fdc683
[backend] wip
savacano28 Nov 6, 2024
0ddba7a
[backend] wip
savacano28 Nov 6, 2024
ce2367a
[backend] wip
savacano28 Nov 6, 2024
c9d2207
[backend] wip
savacano28 Nov 6, 2024
5dd3fbb
[backend] wip
savacano28 Nov 6, 2024
3486506
[backend] wip
savacano28 Nov 6, 2024
91ccb1d
[backend] wip
savacano28 Nov 6, 2024
d153fdc
[backend] wip
savacano28 Nov 6, 2024
0acde5c
[backend] wip
savacano28 Nov 6, 2024
d14eb1d
[backend] wip
savacano28 Nov 6, 2024
294ee76
[backend] wip
savacano28 Nov 6, 2024
e307021
[backend] wip
savacano28 Nov 6, 2024
4a1a720
[backend] wip
savacano28 Nov 6, 2024
1c6c232
[backend] wip
savacano28 Nov 6, 2024
9af4cb6
[backend] wip
savacano28 Nov 7, 2024
87f2425
[backend] wip
savacano28 Nov 7, 2024
15ad5b2
[backend] wip
savacano28 Nov 7, 2024
417670e
[backend] wip
savacano28 Nov 7, 2024
642bbc9
[backend] wip
savacano28 Nov 7, 2024
d08c686
[backend] wip
savacano28 Nov 7, 2024
c025b5e
[backend] wip
savacano28 Nov 7, 2024
aa026ee
[backend] wip
savacano28 Nov 7, 2024
88009b5
[backend] wip
savacano28 Nov 10, 2024
02d2e18
[backend] wip
savacano28 Nov 10, 2024
c8fdf0a
[backend] wip
savacano28 Nov 10, 2024
22bd18e
[backend] wip
savacano28 Nov 10, 2024
c01860b
[backend] wip
savacano28 Nov 10, 2024
6b86fbc
[backend] wip
savacano28 Nov 10, 2024
ea88146
[backend] wip
savacano28 Nov 10, 2024
4ac4b69
[backend] wip
savacano28 Nov 11, 2024
589cd40
[backend] wip
savacano28 Nov 11, 2024
17a92d0
[backend] wip
savacano28 Nov 11, 2024
3a983e6
[backend] wip
savacano28 Nov 11, 2024
da5d796
[backend] wip
savacano28 Nov 11, 2024
bdc137e
[backend] wip
savacano28 Nov 11, 2024
c3ae437
[backend] wip
savacano28 Nov 11, 2024
eaf2153
[backend] wip
savacano28 Nov 11, 2024
ed10e68
[backend] wip
savacano28 Nov 11, 2024
9799872
[backend] wip
savacano28 Nov 11, 2024
faef2e5
[backend] wip
savacano28 Nov 11, 2024
d5ed08d
[backend] wip
savacano28 Nov 11, 2024
0293bf8
[backend] wip
savacano28 Nov 11, 2024
eaaefda
[backend] wip
savacano28 Nov 11, 2024
afca53f
[backend] wip
savacano28 Nov 11, 2024
d20263d
[backend] clean
savacano28 Nov 11, 2024
496ecd1
[backend] clean
savacano28 Nov 11, 2024
d7eb0ba
[backend] clean
savacano28 Nov 11, 2024
1e703de
[backend] clean
savacano28 Nov 11, 2024
9209b8f
[backend] clean
savacano28 Nov 11, 2024
836bb0a
[backend] clean
savacano28 Nov 11, 2024
55acb16
[backend] clean
savacano28 Nov 12, 2024
425471d
[backend] clean
savacano28 Nov 12, 2024
ec9aec2
[backend] clean
savacano28 Nov 12, 2024
3e4602b
[backend] clean
savacano28 Nov 12, 2024
4ca70bb
[backend] Pr changes
savacano28 Nov 14, 2024
4595411
[backend] Pr changes
savacano28 Nov 14, 2024
80fd1d7
[backend] Pr changes
savacano28 Nov 14, 2024
19e849f
[backend] Pr changes
savacano28 Nov 14, 2024
37d18b3
[backend] Pr changes
savacano28 Nov 14, 2024
d37519c
[backend] Pr changes
savacano28 Nov 14, 2024
84242a0
[backend] Pr changes
savacano28 Nov 14, 2024
29e6d58
[backend] Pr changes
savacano28 Nov 14, 2024
bf98358
[backend] Pr changes
savacano28 Nov 14, 2024
f47aa83
[backend] Pr changes
savacano28 Nov 14, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions openbas-api/src/main/java/io/openbas/opencti/OpenCTIApi.java
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
import io.openbas.aop.LogExecutionTime;
import io.openbas.rest.exercise.form.ExerciseSimple;
import io.openbas.service.ScenarioService;
import io.openbas.telemetry.Tracing;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.media.Content;
import io.swagger.v3.oas.annotations.media.Schema;
Expand Down Expand Up @@ -42,6 +43,7 @@ public class OpenCTIApi {
})
@LogExecutionTime
@GetMapping(OPENCTI_URI + "/exercises/latest/{externalReferenceId}")
@Tracing(name = "Get latest exercise by external reference", layer = "api", operation = "GET")
public ExerciseSimple latestExerciseByExternalReference(
@PathVariable @NotBlank final String externalReferenceId) {
return scenarioService.latestExerciseByExternalReference(externalReferenceId);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ public List<AssetGroup> assetGroups() {
@LogExecutionTime
@PostMapping(ASSET_GROUP_URI + "/search")
@PreAuthorize("isObserver()")
@Tracing(name = "Get a page of assetgroups", layer = "api", operation = "POST")
public Page<AssetGroupOutput> assetGroups(
@RequestBody @Valid SearchPaginationInput searchPaginationInput) {
return this.assetGroupCriteriaBuilderService.assetGroupPagination(searchPaginationInput);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,11 @@
import io.openbas.inject_expectation.InjectExpectationService;
import io.openbas.rest.atomic_testing.form.AtomicTestingInput;
import io.openbas.rest.atomic_testing.form.AtomicTestingUpdateTagsInput;
import io.openbas.rest.atomic_testing.form.InjectResultDTO;
import io.openbas.rest.atomic_testing.form.InjectResultOutput;
import io.openbas.rest.atomic_testing.form.InjectResultOverviewOutput;
import io.openbas.rest.helper.RestBehavior;
import io.openbas.rest.inject.output.AtomicTestingOutput;
import io.openbas.service.AtomicTestingService;
import io.openbas.telemetry.Tracing;
import io.openbas.utils.pagination.SearchPaginationInput;
import jakarta.validation.Valid;
import jakarta.validation.constraints.NotBlank;
Expand All @@ -34,31 +35,35 @@ public class AtomicTestingApi extends RestBehavior {
@LogExecutionTime
@PostMapping("/search")
@Transactional(readOnly = true)
public Page<AtomicTestingOutput> findAllAtomicTestings(
@Tracing(name = "Get a page of atomic testings", layer = "api", operation = "POST")
public Page<InjectResultOutput> findAllAtomicTestings(
@RequestBody @Valid final SearchPaginationInput searchPaginationInput) {
return atomicTestingService.findAllAtomicTestings(searchPaginationInput);
}

@LogExecutionTime
@GetMapping("/{injectId}")
public InjectResultDTO findAtomicTesting(@PathVariable String injectId) {
@Tracing(name = "Get a atomic testing", layer = "api", operation = "GET")
public InjectResultOverviewOutput findAtomicTesting(@PathVariable String injectId) {
return atomicTestingService.findById(injectId);
}

@PostMapping()
@Transactional(rollbackFor = Exception.class)
public InjectResultDTO createAtomicTesting(@Valid @RequestBody AtomicTestingInput input) {
public InjectResultOverviewOutput createAtomicTesting(
@Valid @RequestBody AtomicTestingInput input) {
return this.atomicTestingService.createOrUpdate(input, null);
}

@PostMapping("/{atomicTestingId}")
public InjectResultDTO duplicateAtomicTesting(@PathVariable final String atomicTestingId) {
public InjectResultOverviewOutput duplicateAtomicTesting(
@PathVariable final String atomicTestingId) {
return atomicTestingService.getDuplicateAtomicTesting(atomicTestingId);
}

@PutMapping("/{injectId}")
@Transactional(rollbackFor = Exception.class)
public InjectResultDTO updateAtomicTesting(
public InjectResultOverviewOutput updateAtomicTesting(
@PathVariable @NotBlank final String injectId,
@Valid @RequestBody final AtomicTestingInput input) {
return atomicTestingService.createOrUpdate(input, injectId);
Expand Down Expand Up @@ -86,7 +91,7 @@ public List<InjectExpectation> findTargetResult(

@PutMapping("/{injectId}/tags")
@Transactional(rollbackFor = Exception.class)
public InjectResultDTO updateAtomicTestingTags(
public InjectResultOverviewOutput updateAtomicTestingTags(
@PathVariable @NotBlank final String injectId,
@Valid @RequestBody final AtomicTestingUpdateTagsInput input) {
return atomicTestingService.updateAtomicTestingTags(injectId, input);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,10 @@
import java.util.ArrayList;
import java.util.List;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;

@Setter
@Getter
@NoArgsConstructor
public class AtomicTestingInput {

@JsonProperty("inject_title")
Expand Down Expand Up @@ -39,7 +37,7 @@
private List<InjectDocumentInput> documents = new ArrayList<>();

@JsonProperty("inject_all_teams")
private boolean allTeams = false;
private boolean allTeams;

Check warning on line 40 in openbas-api/src/main/java/io/openbas/rest/atomic_testing/form/AtomicTestingInput.java

View check run for this annotation

Codecov / codecov/patch

openbas-api/src/main/java/io/openbas/rest/atomic_testing/form/AtomicTestingInput.java#L40

Added line #L40 was not covered by tests

@JsonProperty("inject_tags")
private List<String> tagIds = new ArrayList<>();
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
package io.openbas.rest.atomic_testing.form;

import com.fasterxml.jackson.annotation.JsonProperty;
import jakarta.validation.constraints.NotBlank;
import lombok.Builder;
import lombok.Getter;
import lombok.Setter;

@Setter

Check warning on line 9 in openbas-api/src/main/java/io/openbas/rest/atomic_testing/form/AttackPatternSimple.java

View check run for this annotation

Codecov / codecov/patch

openbas-api/src/main/java/io/openbas/rest/atomic_testing/form/AttackPatternSimple.java#L9

Added line #L9 was not covered by tests
@Getter
@Builder

Check warning on line 11 in openbas-api/src/main/java/io/openbas/rest/atomic_testing/form/AttackPatternSimple.java

View check run for this annotation

Codecov / codecov/patch

openbas-api/src/main/java/io/openbas/rest/atomic_testing/form/AttackPatternSimple.java#L11

Added line #L11 was not covered by tests
savacano28 marked this conversation as resolved.
Show resolved Hide resolved
public class AttackPatternSimple {

@JsonProperty("attack_pattern_id")
@NotBlank
private String id;

Check warning on line 16 in openbas-api/src/main/java/io/openbas/rest/atomic_testing/form/AttackPatternSimple.java

View check run for this annotation

Codecov / codecov/patch

openbas-api/src/main/java/io/openbas/rest/atomic_testing/form/AttackPatternSimple.java#L16

Added line #L16 was not covered by tests

@JsonProperty("attack_pattern_name")
@NotBlank
private String name;

Check warning on line 20 in openbas-api/src/main/java/io/openbas/rest/atomic_testing/form/AttackPatternSimple.java

View check run for this annotation

Codecov / codecov/patch

openbas-api/src/main/java/io/openbas/rest/atomic_testing/form/AttackPatternSimple.java#L20

Added line #L20 was not covered by tests

@JsonProperty("attack_pattern_external_id")
@NotBlank
private String externalId;

Check warning on line 24 in openbas-api/src/main/java/io/openbas/rest/atomic_testing/form/AttackPatternSimple.java

View check run for this annotation

Codecov / codecov/patch

openbas-api/src/main/java/io/openbas/rest/atomic_testing/form/AttackPatternSimple.java#L24

Added line #L24 was not covered by tests
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
package io.openbas.rest.atomic_testing.form;

import com.fasterxml.jackson.annotation.JsonProperty;
import jakarta.validation.constraints.NotBlank;
import lombok.Builder;
import lombok.Getter;
import lombok.Setter;

@Setter

Check warning on line 9 in openbas-api/src/main/java/io/openbas/rest/atomic_testing/form/InjectExpectationSimple.java

View check run for this annotation

Codecov / codecov/patch

openbas-api/src/main/java/io/openbas/rest/atomic_testing/form/InjectExpectationSimple.java#L9

Added line #L9 was not covered by tests
@Getter
@Builder

Check warning on line 11 in openbas-api/src/main/java/io/openbas/rest/atomic_testing/form/InjectExpectationSimple.java

View check run for this annotation

Codecov / codecov/patch

openbas-api/src/main/java/io/openbas/rest/atomic_testing/form/InjectExpectationSimple.java#L11

Added line #L11 was not covered by tests
public class InjectExpectationSimple {

@JsonProperty("inject_expectation_id")
@NotBlank
private String id;

Check warning on line 16 in openbas-api/src/main/java/io/openbas/rest/atomic_testing/form/InjectExpectationSimple.java

View check run for this annotation

Codecov / codecov/patch

openbas-api/src/main/java/io/openbas/rest/atomic_testing/form/InjectExpectationSimple.java#L16

Added line #L16 was not covered by tests

@JsonProperty("inject_expectation_name")
private String name;

Check warning on line 19 in openbas-api/src/main/java/io/openbas/rest/atomic_testing/form/InjectExpectationSimple.java

View check run for this annotation

Codecov / codecov/patch

openbas-api/src/main/java/io/openbas/rest/atomic_testing/form/InjectExpectationSimple.java#L19

Added line #L19 was not covered by tests
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
package io.openbas.rest.atomic_testing.form;

import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonProperty;
import io.openbas.utils.AtomicTestingUtils.ExpectationResultsByType;
import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.constraints.NotBlank;
import jakarta.validation.constraints.NotNull;
import java.time.Instant;
import java.util.ArrayList;
import java.util.List;
import lombok.Getter;
import lombok.Setter;

@Setter

Check warning on line 15 in openbas-api/src/main/java/io/openbas/rest/atomic_testing/form/InjectResultOutput.java

View check run for this annotation

Codecov / codecov/patch

openbas-api/src/main/java/io/openbas/rest/atomic_testing/form/InjectResultOutput.java#L15

Added line #L15 was not covered by tests
@Getter
public class InjectResultOutput {

Check warning on line 17 in openbas-api/src/main/java/io/openbas/rest/atomic_testing/form/InjectResultOutput.java

View check run for this annotation

Codecov / codecov/patch

openbas-api/src/main/java/io/openbas/rest/atomic_testing/form/InjectResultOutput.java#L17

Added line #L17 was not covered by tests

@Schema(description = "Id of inject")
@JsonProperty("inject_id")
@NotBlank
private String id;

Check warning on line 22 in openbas-api/src/main/java/io/openbas/rest/atomic_testing/form/InjectResultOutput.java

View check run for this annotation

Codecov / codecov/patch

openbas-api/src/main/java/io/openbas/rest/atomic_testing/form/InjectResultOutput.java#L22

Added line #L22 was not covered by tests

@Schema(description = "Title of inject")
@JsonProperty("inject_title")
@NotBlank
private String title;

Check warning on line 27 in openbas-api/src/main/java/io/openbas/rest/atomic_testing/form/InjectResultOutput.java

View check run for this annotation

Codecov / codecov/patch

openbas-api/src/main/java/io/openbas/rest/atomic_testing/form/InjectResultOutput.java#L27

Added line #L27 was not covered by tests

@Schema(description = "Timestamp when the inject was last updated")
@JsonProperty("inject_updated_at")
@NotNull
private Instant updatedAt;

Check warning on line 32 in openbas-api/src/main/java/io/openbas/rest/atomic_testing/form/InjectResultOutput.java

View check run for this annotation

Codecov / codecov/patch

openbas-api/src/main/java/io/openbas/rest/atomic_testing/form/InjectResultOutput.java#L32

Added line #L32 was not covered by tests

@Schema(description = "Type of inject")
@JsonProperty("inject_type")
private String injectType;

Check warning on line 36 in openbas-api/src/main/java/io/openbas/rest/atomic_testing/form/InjectResultOutput.java

View check run for this annotation

Codecov / codecov/patch

openbas-api/src/main/java/io/openbas/rest/atomic_testing/form/InjectResultOutput.java#L36

Added line #L36 was not covered by tests

@Schema(description = "Injector contract")
@JsonProperty("inject_injector_contract")
private InjectorContractSimple injectorContract;

Check warning on line 40 in openbas-api/src/main/java/io/openbas/rest/atomic_testing/form/InjectResultOutput.java

View check run for this annotation

Codecov / codecov/patch

openbas-api/src/main/java/io/openbas/rest/atomic_testing/form/InjectResultOutput.java#L40

Added line #L40 was not covered by tests

@Schema(description = "Status")
@JsonProperty("inject_status")
private InjectStatusSimple status;

Check warning on line 44 in openbas-api/src/main/java/io/openbas/rest/atomic_testing/form/InjectResultOutput.java

View check run for this annotation

Codecov / codecov/patch

openbas-api/src/main/java/io/openbas/rest/atomic_testing/form/InjectResultOutput.java#L44

Added line #L44 was not covered by tests

@JsonIgnore private String[] teamIds;
@JsonIgnore private String[] assetIds;
@JsonIgnore private String[] assetGroupIds;

Check warning on line 48 in openbas-api/src/main/java/io/openbas/rest/atomic_testing/form/InjectResultOutput.java

View check run for this annotation

Codecov / codecov/patch

openbas-api/src/main/java/io/openbas/rest/atomic_testing/form/InjectResultOutput.java#L46-L48

Added lines #L46 - L48 were not covered by tests

// -- COMPUTED ATTRIBUTES --

@Schema(description = "Result of expectations")

Check warning on line 52 in openbas-api/src/main/java/io/openbas/rest/atomic_testing/form/InjectResultOutput.java

View check run for this annotation

Codecov / codecov/patch

openbas-api/src/main/java/io/openbas/rest/atomic_testing/form/InjectResultOutput.java#L52

Added line #L52 was not covered by tests
@JsonProperty("inject_expectation_results")
@NotNull
private List<ExpectationResultsByType> expectationResultByTypes = new ArrayList<>();

Check warning on line 55 in openbas-api/src/main/java/io/openbas/rest/atomic_testing/form/InjectResultOutput.java

View check run for this annotation

Codecov / codecov/patch

openbas-api/src/main/java/io/openbas/rest/atomic_testing/form/InjectResultOutput.java#L55

Added line #L55 was not covered by tests

@JsonProperty("inject_targets")
private List<TargetSimple> targets = new ArrayList<>();

Check warning on line 58 in openbas-api/src/main/java/io/openbas/rest/atomic_testing/form/InjectResultOutput.java

View check run for this annotation

Codecov / codecov/patch

openbas-api/src/main/java/io/openbas/rest/atomic_testing/form/InjectResultOutput.java#L57-L58

Added lines #L57 - L58 were not covered by tests
}
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
package io.openbas.rest.atomic_testing.form;

import static java.time.Instant.now;

import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.databind.node.ObjectNode;
import io.openbas.database.model.*;
import io.openbas.utils.AtomicTestingMapper.ExpectationResultsByType;
import io.openbas.database.model.InjectStatusCommandLine;
import io.openbas.utils.AtomicTestingUtils.ExpectationResultsByType;
import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.constraints.NotBlank;
import jakarta.validation.constraints.NotNull;
import java.time.Instant;
import java.util.ArrayList;
Expand All @@ -19,75 +18,82 @@
@Setter
@Getter
@Builder
public class InjectResultDTO {
public class InjectResultOverviewOutput {

@Schema(description = "Id")
@Schema(description = "Id of inject")
@JsonProperty("inject_id")
@NotNull
@NotBlank
private String id;

@Schema(description = "Title")
@Schema(description = "Title of inject")
@JsonProperty("inject_title")
@NotNull
@NotBlank
private String title;

@Schema(description = "Description")
@Schema(description = "Description of inject")
@JsonProperty("inject_description")
@NotNull
private String description;

@Schema(description = "Content of inject")
@JsonProperty("inject_content")
private ObjectNode content;

@Schema(description = "Command lines for inject")
@JsonProperty("inject_commands_lines")
private InjectStatusCommandLine commandsLines;

@JsonProperty("inject_expectations")
private List<InjectExpectation> expectations;

@Schema(description = "Type of inject")
@JsonProperty("inject_type")
private String type;

@Schema(description = "Kill Chain Phases")
@JsonProperty("inject_kill_chain_phases")
@NotNull
private List<KillChainPhase> killChainPhases;
@Schema(description = "Tags")
@JsonProperty("injects_tags")
private List<String> tagIds;

@Schema(description = "Attack Patterns")
@JsonProperty("inject_attack_patterns")
@NotNull
private List<AttackPattern> attackPatterns;
@Schema(description = "Documents")
@JsonProperty("injects_documents")
private List<String> documentIds;

@Schema(description = "Full contract")
@JsonProperty("inject_injector_contract")
@NotNull
private InjectorContract injectorContract;
private InjectorContractSimple injectorContract;

@Schema(description = "status")
@JsonProperty("inject_status")
private InjectStatus status;
private InjectStatusOutput status;

@Schema(
description = "Specifies the categories of targetResults for atomic testing.",
example = "assets, asset groups, teams, players")
@JsonProperty("inject_targets")
@NotNull
private List<InjectTargetWithResult> targets;
@Schema(description = "Expectations")
@JsonProperty("inject_expectations")
private List<InjectExpectationSimple> expectations;

@Schema(description = "Kill chain phases")
@JsonProperty("inject_kill_chain_phases")
private List<KillChainPhaseSimple> killChainPhases;

@Schema(description = "Attack pattern")
@JsonProperty("inject_attack_patterns")
private List<AttackPatternSimple> attackPatterns;

@Schema(description = "Indicates whether the inject is ready for use")
@JsonProperty("inject_ready")
private boolean isReady;

@Schema(description = "Timestamp when the inject was last updated")
@JsonProperty("inject_updated_at")
private Instant updatedAt;

// -- COMPUTED ATTRIBUTES --

@Default
@Schema(description = "Result of expectations")
savacano28 marked this conversation as resolved.
Show resolved Hide resolved
@JsonProperty("inject_expectation_results")
@NotNull
private List<ExpectationResultsByType> expectationResultByTypes = new ArrayList<>();

@JsonProperty("injects_tags")
private List<String> tagIds;

@JsonProperty("injects_documents")
private List<String> documents;

@JsonProperty("inject_ready")
private Boolean isReady;

@JsonProperty("inject_updated_at")
private Instant updatedAt = now();
@Default
@Schema(description = "Results of expectations for each target")
@JsonProperty("inject_targets")
@NotNull
private List<InjectTargetWithResult> targets = new ArrayList<>();
}
Loading