Skip to content

Commit

Permalink
Add overview
Browse files Browse the repository at this point in the history
  • Loading branch information
hupe1980 committed Jun 21, 2022
1 parent dffe388 commit a45ab16
Show file tree
Hide file tree
Showing 5 changed files with 288 additions and 0 deletions.
202 changes: 202 additions & 0 deletions API.md
Original file line number Diff line number Diff line change
Expand Up @@ -443,8 +443,10 @@ Model.of(construct: IConstruct)
| <code><a href="#cdktg.Model.property.businessCriticality">businessCriticality</a></code> | <code><a href="#cdktg.BusinessCriticality">BusinessCriticality</a></code> | *No description.* |
| <code><a href="#cdktg.Model.property.title">title</a></code> | <code>string</code> | *No description.* |
| <code><a href="#cdktg.Model.property.version">version</a></code> | <code>string</code> | *No description.* |
| <code><a href="#cdktg.Model.property.businessOverview">businessOverview</a></code> | <code><a href="#cdktg.Overview">Overview</a></code> | *No description.* |
| <code><a href="#cdktg.Model.property.date">date</a></code> | <code>string</code> | *No description.* |
| <code><a href="#cdktg.Model.property.managementSummary">managementSummary</a></code> | <code>string</code> | *No description.* |
| <code><a href="#cdktg.Model.property.technicalOverview">technicalOverview</a></code> | <code><a href="#cdktg.Overview">Overview</a></code> | *No description.* |
| <code><a href="#cdktg.Model.property.synthesizer">synthesizer</a></code> | <code><a href="#cdktg.IModelSynthesizer">IModelSynthesizer</a></code> | *No description.* |

---
Expand Down Expand Up @@ -501,6 +503,16 @@ public readonly version: string;

---

##### `businessOverview`<sup>Optional</sup> <a name="businessOverview" id="cdktg.Model.property.businessOverview"></a>

```typescript
public readonly businessOverview: Overview;
```

- *Type:* <a href="#cdktg.Overview">Overview</a>

---

##### `date`<sup>Optional</sup> <a name="date" id="cdktg.Model.property.date"></a>

```typescript
Expand All @@ -521,6 +533,16 @@ public readonly managementSummary: string;

---

##### `technicalOverview`<sup>Optional</sup> <a name="technicalOverview" id="cdktg.Model.property.technicalOverview"></a>

```typescript
public readonly technicalOverview: Overview;
```

- *Type:* <a href="#cdktg.Overview">Overview</a>

---

##### `synthesizer`<sup>Required</sup> <a name="synthesizer" id="cdktg.Model.property.synthesizer"></a>

```typescript
Expand Down Expand Up @@ -2512,10 +2534,12 @@ const modelProps: ModelProps = { ... }
| <code><a href="#cdktg.ModelProps.property.businessCriticality">businessCriticality</a></code> | <code><a href="#cdktg.BusinessCriticality">BusinessCriticality</a></code> | Business criticality of the target. |
| <code><a href="#cdktg.ModelProps.property.version">version</a></code> | <code>string</code> | Version of the Threagile toolkit. |
| <code><a href="#cdktg.ModelProps.property.abuseCases">abuseCases</a></code> | <code><a href="#cdktg.AbuseCase">AbuseCase</a>[]</code> | Custom abuse cases for the report. |
| <code><a href="#cdktg.ModelProps.property.businessOverview">businessOverview</a></code> | <code><a href="#cdktg.Overview">Overview</a></code> | Individual business overview for the report. |
| <code><a href="#cdktg.ModelProps.property.date">date</a></code> | <code>string</code> | Date of the model. |
| <code><a href="#cdktg.ModelProps.property.managementSummary">managementSummary</a></code> | <code>string</code> | Individual management summary for the report. |
| <code><a href="#cdktg.ModelProps.property.questions">questions</a></code> | <code><a href="#cdktg.Question">Question</a>[]</code> | Custom questions for the report. |
| <code><a href="#cdktg.ModelProps.property.securityRequirements">securityRequirements</a></code> | <code><a href="#cdktg.SecurityRequirement">SecurityRequirement</a>[]</code> | Custom security requirements for the report. |
| <code><a href="#cdktg.ModelProps.property.technicalOverview">technicalOverview</a></code> | <code><a href="#cdktg.Overview">Overview</a></code> | Individual technical overview for the report. |
| <code><a href="#cdktg.ModelProps.property.title">title</a></code> | <code>string</code> | Title of the model. |

---
Expand Down Expand Up @@ -2568,6 +2592,18 @@ Custom abuse cases for the report.

---

##### `businessOverview`<sup>Optional</sup> <a name="businessOverview" id="cdktg.ModelProps.property.businessOverview"></a>

```typescript
public readonly businessOverview: Overview;
```

- *Type:* <a href="#cdktg.Overview">Overview</a>

Individual business overview for the report.

---

##### `date`<sup>Optional</sup> <a name="date" id="cdktg.ModelProps.property.date"></a>

```typescript
Expand Down Expand Up @@ -2616,6 +2652,18 @@ Custom security requirements for the report.

---

##### `technicalOverview`<sup>Optional</sup> <a name="technicalOverview" id="cdktg.ModelProps.property.technicalOverview"></a>

```typescript
public readonly technicalOverview: Overview;
```

- *Type:* <a href="#cdktg.Overview">Overview</a>

Individual technical overview for the report.

---

##### `title`<sup>Optional</sup> <a name="title" id="cdktg.ModelProps.property.title"></a>

```typescript
Expand Down Expand Up @@ -2667,6 +2715,45 @@ public readonly justification: string;

---

### OverviewProps <a name="OverviewProps" id="cdktg.OverviewProps"></a>

#### Initializer <a name="Initializer" id="cdktg.OverviewProps.Initializer"></a>

```typescript
import { OverviewProps } from 'cdktg'

const overviewProps: OverviewProps = { ... }
```

#### Properties <a name="Properties" id="Properties"></a>

| **Name** | **Type** | **Description** |
| --- | --- | --- |
| <code><a href="#cdktg.OverviewProps.property.description">description</a></code> | <code>string</code> | *No description.* |
| <code><a href="#cdktg.OverviewProps.property.images">images</a></code> | <code><a href="#cdktg.Image">Image</a>[]</code> | *No description.* |

---

##### `description`<sup>Required</sup> <a name="description" id="cdktg.OverviewProps.property.description"></a>

```typescript
public readonly description: string;
```

- *Type:* string

---

##### `images`<sup>Optional</sup> <a name="images" id="cdktg.OverviewProps.property.images"></a>

```typescript
public readonly images: Image[];
```

- *Type:* <a href="#cdktg.Image">Image</a>[]

---

### ProjectProps <a name="ProjectProps" id="cdktg.ProjectProps"></a>

#### Initializer <a name="Initializer" id="cdktg.ProjectProps.Initializer"></a>
Expand Down Expand Up @@ -4176,6 +4263,67 @@ public readonly vpn: boolean;
---


### Image <a name="Image" id="cdktg.Image"></a>

#### Initializers <a name="Initializers" id="cdktg.Image.Initializer"></a>

```typescript
import { Image } from 'cdktg'

new Image(filePath: string, title: string)
```

| **Name** | **Type** | **Description** |
| --- | --- | --- |
| <code><a href="#cdktg.Image.Initializer.parameter.filePath">filePath</a></code> | <code>string</code> | *No description.* |
| <code><a href="#cdktg.Image.Initializer.parameter.title">title</a></code> | <code>string</code> | *No description.* |

---

##### `filePath`<sup>Required</sup> <a name="filePath" id="cdktg.Image.Initializer.parameter.filePath"></a>

- *Type:* string

---

##### `title`<sup>Required</sup> <a name="title" id="cdktg.Image.Initializer.parameter.title"></a>

- *Type:* string

---



#### Properties <a name="Properties" id="Properties"></a>

| **Name** | **Type** | **Description** |
| --- | --- | --- |
| <code><a href="#cdktg.Image.property.filePath">filePath</a></code> | <code>string</code> | *No description.* |
| <code><a href="#cdktg.Image.property.title">title</a></code> | <code>string</code> | *No description.* |

---

##### `filePath`<sup>Required</sup> <a name="filePath" id="cdktg.Image.property.filePath"></a>

```typescript
public readonly filePath: string;
```

- *Type:* string

---

##### `title`<sup>Required</sup> <a name="title" id="cdktg.Image.property.title"></a>

```typescript
public readonly title: string;
```

- *Type:* string

---


### InScope <a name="InScope" id="cdktg.InScope"></a>

#### Initializers <a name="Initializers" id="cdktg.InScope.Initializer"></a>
Expand Down Expand Up @@ -4474,6 +4622,60 @@ public readonly justification: string;
---


### Overview <a name="Overview" id="cdktg.Overview"></a>

#### Initializers <a name="Initializers" id="cdktg.Overview.Initializer"></a>

```typescript
import { Overview } from 'cdktg'

new Overview(props: OverviewProps)
```

| **Name** | **Type** | **Description** |
| --- | --- | --- |
| <code><a href="#cdktg.Overview.Initializer.parameter.props">props</a></code> | <code><a href="#cdktg.OverviewProps">OverviewProps</a></code> | *No description.* |

---

##### `props`<sup>Required</sup> <a name="props" id="cdktg.Overview.Initializer.parameter.props"></a>

- *Type:* <a href="#cdktg.OverviewProps">OverviewProps</a>

---



#### Properties <a name="Properties" id="Properties"></a>

| **Name** | **Type** | **Description** |
| --- | --- | --- |
| <code><a href="#cdktg.Overview.property.description">description</a></code> | <code>string</code> | *No description.* |
| <code><a href="#cdktg.Overview.property.images">images</a></code> | <code><a href="#cdktg.Image">Image</a>[]</code> | *No description.* |

---

##### `description`<sup>Required</sup> <a name="description" id="cdktg.Overview.property.description"></a>

```typescript
public readonly description: string;
```

- *Type:* string

---

##### `images`<sup>Optional</sup> <a name="images" id="cdktg.Overview.property.images"></a>

```typescript
public readonly images: Image[];
```

- *Type:* <a href="#cdktg.Image">Image</a>[]

---


### Risk <a name="Risk" id="cdktg.Risk"></a>

#### Initializers <a name="Initializers" id="cdktg.Risk.Initializer"></a>
Expand Down
1 change: 1 addition & 0 deletions src/author.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ export interface AuthorProps {
readonly name: string;
readonly homepage?: string;
}

export class Author {
public readonly name: string;
public readonly homepage?: string;
Expand Down
1 change: 1 addition & 0 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ export * from "./communication";
export * from "./data-asset";
export * from "./manifest";
export * from "./model";
export * from "./overview";
export * from "./project";
export * from "./scope";
export * from "./security-requirement";
Expand Down
26 changes: 26 additions & 0 deletions src/model.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import { AbuseCase } from "./abuse-case";

import { Author } from "./author";
import { DataAsset } from "./data-asset";
import { Overview } from "./overview";
import { RiskCategory } from "./risk-category";
import { RiskTracking, RiskTrackingProps } from "./rist-tracking";
import { SecurityRequirement } from "./security-requirement";
Expand Down Expand Up @@ -50,6 +51,16 @@ export interface ModelProps {
*/
readonly businessCriticality: BusinessCriticality;

/**
* Individual business overview for the report
*/
readonly businessOverview?: Overview;

/**
* Individual technical overview for the report
*/
readonly technicalOverview?: Overview;

/**
* Custom questions for the report
*/
Expand Down Expand Up @@ -96,6 +107,8 @@ export class Model extends Construct {
public readonly date?: string;
public readonly author: Author;
public readonly managementSummary?: string;
public readonly businessOverview?: Overview;
public readonly technicalOverview?: Overview;
public readonly businessCriticality: BusinessCriticality;

public synthesizer: IModelSynthesizer;
Expand All @@ -119,6 +132,17 @@ export class Model extends Construct {
this.managementSummary = props.managementSummary;
this.businessCriticality = props.businessCriticality;

this.businessOverview = props.businessOverview;
if (
this.businessOverview &&
this.businessOverview.images &&
this.businessOverview.images.length > 0
) {
this.businessOverview.images.forEach((i) => i._bind(this));
}

this.technicalOverview = props.technicalOverview;

this.questions = new Map<string, string>();
props.questions?.forEach((q) => {
this.addQuestion(q.text, q.answer);
Expand Down Expand Up @@ -246,6 +270,8 @@ export class Model extends Construct {
data: this.date,
author: this.author._toThreagile(),
management_summary_comment: this.managementSummary,
business_overview: this.businessOverview?._toThreagile(),
technical_overview: this.technicalOverview?._toThreagile(),
business_criticality: this.businessCriticality,
questions: Object.fromEntries(this.questions),
abuse_cases: Object.fromEntries(this.abuseCases),
Expand Down
Loading

0 comments on commit a45ab16

Please sign in to comment.