Skip to content

Commit

Permalink
Fix codestyle
Browse files Browse the repository at this point in the history
  • Loading branch information
hupe1980 committed Jun 19, 2022
1 parent efbcf93 commit e6f6244
Show file tree
Hide file tree
Showing 31 changed files with 501 additions and 497 deletions.
102 changes: 6 additions & 96 deletions .eslintrc.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions .gitattributes

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions .gitignore

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions .prettierignore

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions .prettierrc.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 12 additions & 0 deletions .projen/deps.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions .projen/files.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

67 changes: 44 additions & 23 deletions .projenrc.js
Original file line number Diff line number Diff line change
@@ -1,36 +1,57 @@
const { cdk } = require('projen');
const { cdk } = require("projen");

const project = new cdk.JsiiProject({
author: 'hupe1980',
defaultReleaseBranch: 'main',
name: 'cdktg',
description: 'Agile Threat Modeling as Code',
keywords: [
'threagile',
'cdk',
'threat modeling',
'stride',
],
author: "hupe1980",
defaultReleaseBranch: "main",
name: "cdktg",
description: "Agile Threat Modeling as Code",
keywords: ["threagile", "cdk", "threat modeling", "stride"],
vscode: true,
repositoryUrl: 'https://github.com/hupe1980/cdk-threagile.git',
license: 'MIT',
copyrightOwner: 'Frank Hübner',
repositoryUrl: "https://github.com/hupe1980/cdk-threagile.git",
license: "MIT",
copyrightOwner: "Frank Hübner",

prettier: true,

peerDeps: ['constructs'],
bundledDeps: ['axios', 'uuid', 'yaml', 'yargs', 'ts-node', 'execa@^5', 'fs-extra', 'form-data', 'adm-zip', 'dotenv'],
devDeps: ['@types/uuid', '@types/fs-extra', '@types/adm-zip', 'constructs', 'json-schema-to-typescript', '@openapitools/openapi-generator-cli'],
peerDeps: ["constructs"],
bundledDeps: [
"axios",
"uuid",
"yaml",
"yargs",
"ts-node",
"execa@^5",
"fs-extra",
"form-data",
"adm-zip",
"dotenv",
],
devDeps: [
"@types/uuid",
"@types/fs-extra",
"@types/adm-zip",
"constructs",
"json-schema-to-typescript",
"@openapitools/openapi-generator-cli",
],

publishToPypi: {
distName: 'cdktg',
module: 'cdktg',
distName: "cdktg",
module: "cdktg",
},

publishToGo: {
moduleName: 'github.com/hupe1980/cdk-threagile-go',
moduleName: "github.com/hupe1980/cdk-threagile-go",
},
});

project.setScript('specgen', 'json2ts threagile/schema.json > src/spec/threatgile.generated.ts');
project.setScript('apigen', 'openapi-generator-cli generate -i threagile/openapi.yaml -g typescript-axios -o src/api/generated --additional-properties=withNodeImports=true');
project.setScript(
"specgen",
"json2ts threagile/schema.json > src/spec/threatgile.generated.ts"
);
project.setScript(
"apigen",
"openapi-generator-cli generate -i threagile/openapi.yaml -g typescript-axios -o src/api/generated --additional-properties=withNodeImports=true"
);

project.synth();
project.synth();
3 changes: 3 additions & 0 deletions package.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 5 additions & 5 deletions src/api/threagile.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import * as fs from 'fs-extra';
import { Configuration, MetaApi, DirectApi } from './generated';
import * as fs from "fs-extra";
import { Configuration, MetaApi, DirectApi } from "./generated";

export class Threagile {
private metaApi: MetaApi;
private directApi: DirectApi;

constructor(baseURL:string) {
constructor(baseURL: string) {
const configuration = new Configuration({
basePath: baseURL,
});
Expand Down Expand Up @@ -36,7 +36,7 @@ export class Threagile {
const file = fs.createReadStream(filename);

return this.directApi.directAnalyzePost(dpi, file, {
responseType: 'arraybuffer',
responseType: "arraybuffer",
});
}
}
}
12 changes: 5 additions & 7 deletions src/asset.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { Construct } from 'constructs';
import { v4 as uuidv4 } from 'uuid';
import { Construct } from "constructs";
import { v4 as uuidv4 } from "uuid";

import { CIATriad } from './cia-triade';
import { Usage } from './usage';
import { CIATriad } from "./cia-triade";
import { Usage } from "./usage";

export interface AssetProps {
readonly description: string;
Expand Down Expand Up @@ -30,7 +30,5 @@ export abstract class Asset extends Construct {
/**
* @internal
*/
public abstract _toThreagile(): any
public abstract _toThreagile(): any;
}


2 changes: 1 addition & 1 deletion src/author.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,4 @@ export class Author {
homepage: this.homepage,
};
}
}
}
32 changes: 16 additions & 16 deletions src/cia-triade.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,25 +32,25 @@ export class CIATriad {
}

export enum Confidentiality {
PUBLIC = 'public',
INTERNAL = 'internal',
RESTRICTED = 'restricted',
CONFIDENTIAL = 'confidential',
STRICTLY_CONFIDENTIAL = 'strictly-confidential'
PUBLIC = "public",
INTERNAL = "internal",
RESTRICTED = "restricted",
CONFIDENTIAL = "confidential",
STRICTLY_CONFIDENTIAL = "strictly-confidential",
}

export enum Integrity {
ARCHIVE = 'archive',
OPERATIONAL = 'operational',
IMPORTANT = 'important',
CRITICAL = 'critical',
MISSION_CRITICAL = 'mission-critical'
ARCHIVE = "archive",
OPERATIONAL = "operational",
IMPORTANT = "important",
CRITICAL = "critical",
MISSION_CRITICAL = "mission-critical",
}

export enum Availability {
ARCHIVE = 'archive',
OPERATIONAL = 'operational',
IMPORTANT = 'important',
CRITICAL = 'critical',
MISSION_CRITICAL = 'mission-critical'
}
ARCHIVE = "archive",
OPERATIONAL = "operational",
IMPORTANT = "important",
CRITICAL = "critical",
MISSION_CRITICAL = "mission-critical",
}
Loading

0 comments on commit e6f6244

Please sign in to comment.