-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #70 from simonec73/dev
Dev 2.1.5
- Loading branch information
Showing
160 changed files
with
3,272 additions
and
1,552 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
using ThreatsManager.Interfaces; | ||
|
||
[assembly: ExtensionsContainer("2.1.4")] | ||
[assembly: ExtensionsContainer("2.1.5")] |
56 changes: 56 additions & 0 deletions
56
Samples/SampleExtensions/Reporting/EntitiesSheetProvider.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
using ThreatsManager.Extensions.Reporting; | ||
using ThreatsManager.Interfaces; | ||
using ThreatsManager.Interfaces.ObjectModel; | ||
using ThreatsManager.Utilities; | ||
|
||
namespace SampleExtensions.Reporting | ||
{ | ||
/// <summary> | ||
/// Summmary Sheet Providers add sheets to the Excel Summary. | ||
/// This example is designed to add a table with the list of all entities defined in the threat model. | ||
/// </summary> | ||
[Extension("14BF4591-C8C6-4971-A324-AC966ECFB389", "Entities Sheet Provider", 100, ExecutionMode.Business)] | ||
public class EntitiesSheetProvider : ISummarySheetProvider | ||
{ | ||
/// <summary> | ||
/// The name of the sheet to be created in Excel. | ||
/// </summary> | ||
public string Name => "Entities"; | ||
|
||
/// <summary> | ||
/// Method called to get the rows of the table. | ||
/// </summary> | ||
/// <param name="model">Threat Model containing the information used to generate the sheet.</param> | ||
/// <returns>The data to be used to create the sheet.</returns> | ||
/// <remarks>TMS checks that every row has the same number of items. If not, it does not create the sheet. | ||
/// The first row contains the header.</remarks> | ||
public IEnumerable<IEnumerable<string>> GetRows(IThreatModel model) | ||
{ | ||
IEnumerable<IEnumerable<string>> result = null; | ||
|
||
// Let's first get the list of items to be created. | ||
// This list could be sorted as required. | ||
var entities = model?.Entities?.ToArray(); | ||
|
||
if (entities?.Any() ?? false) | ||
{ | ||
var table = new List<IEnumerable<string>>(); | ||
|
||
// The first row contains the header. | ||
table.Add(new[] { "Name", "Entity Type", "Description" }); | ||
|
||
// Enumeration of the entities. | ||
foreach ( var entity in entities) | ||
{ | ||
table.Add(new[] { entity.Name, entity.GetEntityType().GetEnumLabel(), entity.Description }); | ||
} | ||
|
||
result = table; | ||
} | ||
|
||
return result; | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,18 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<packages> | ||
<package id="Newtonsoft.Json" version="13.0.3" targetFramework="net472" /> | ||
<package id="PostSharp.Patterns.Aggregation.Redist" version="2024.0.5" targetFramework="net481" /> | ||
<package id="PostSharp.Patterns.Common.Redist" version="2024.0.5" targetFramework="net481" /> | ||
<package id="PostSharp.Patterns.Model.Redist" version="2024.0.5" targetFramework="net481" /> | ||
<package id="PostSharp.Patterns.Threading.Redist" version="2024.0.5" targetFramework="net481" /> | ||
<package id="PostSharp.Redist" version="2024.0.5" targetFramework="net481" /> | ||
<package id="System.ComponentModel.Composition" version="7.0.0" targetFramework="net472" /> | ||
<package id="System.Drawing.Common" version="7.0.0" targetFramework="net472" /> | ||
<package id="System.IO.Packaging" version="7.0.0" targetFramework="net481" /> | ||
<package id="PostSharp.Patterns.Aggregation.Redist" version="2024.0.6" targetFramework="net481" /> | ||
<package id="PostSharp.Patterns.Common.Redist" version="2024.0.6" targetFramework="net481" /> | ||
<package id="PostSharp.Patterns.Model.Redist" version="2024.0.6" targetFramework="net481" /> | ||
<package id="PostSharp.Patterns.Threading.Redist" version="2024.0.6" targetFramework="net481" /> | ||
<package id="PostSharp.Redist" version="2024.0.6" targetFramework="net481" /> | ||
<package id="System.ComponentModel.Composition" version="8.0.0" targetFramework="net481" /> | ||
<package id="System.Drawing.Common" version="8.0.3" targetFramework="net481" /> | ||
<package id="System.IO.Packaging" version="8.0.0" targetFramework="net481" /> | ||
<package id="System.Text.Encoding" version="4.3.0" targetFramework="net472" /> | ||
<package id="ThreatsManager.AutoGenRules" version="2.1.4" targetFramework="net481" /> | ||
<package id="ThreatsManager.AutoThreatGeneration" version="2.1.4" targetFramework="net481" /> | ||
<package id="ThreatsManager.Interfaces" version="2.1.4" targetFramework="net481" /> | ||
<package id="ThreatsManager.Utilities" version="2.1.4" targetFramework="net481" /> | ||
<package id="ThreatsManager.AutoGenRules" version="2.1.5" targetFramework="net481" /> | ||
<package id="ThreatsManager.AutoThreatGeneration" version="2.1.5" targetFramework="net481" /> | ||
<package id="ThreatsManager.Extensions.Client" version="2.1.5" targetFramework="net481" /> | ||
<package id="ThreatsManager.Interfaces" version="2.1.5" targetFramework="net481" /> | ||
<package id="ThreatsManager.Utilities" version="2.1.5" targetFramework="net481" /> | ||
</packages> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
using ThreatsManager.Interfaces; | ||
|
||
[assembly: ExtensionsContainer("2.1.4")] | ||
[assembly: ExtensionsContainer("2.1.5")] |
Oops, something went wrong.