Skip to content

Commit

Permalink
chore(secret-scan): Formatted files
Browse files Browse the repository at this point in the history
  • Loading branch information
rajdip-b committed Oct 15, 2024
1 parent 783c411 commit 5884833
Show file tree
Hide file tree
Showing 54 changed files with 1,576 additions and 1,514 deletions.
6 changes: 2 additions & 4 deletions apps/cli/src/commands/environment/create.environment.ts
Original file line number Diff line number Diff line change
Expand Up @@ -56,10 +56,8 @@ export class CreateEnvironment extends BaseCommand {
data: environment,
error,
success
} = await ControllerInstance
.getInstance()
.environmentController.createEnvironment(
{name, description, projectSlug},
} = await ControllerInstance.getInstance().environmentController.createEnvironment(
{ name, description, projectSlug },
this.headers
)

Expand Down
11 changes: 5 additions & 6 deletions apps/cli/src/commands/environment/delete.environment.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,12 +34,11 @@ export class DeleteEnvironment extends BaseCommand {

Logger.info('Deleting Environment...')

const { success, error } = await ControllerInstance
.getInstance()
.environmentController.deleteEnvironment(
{ id: environmentId },
this.headers
)
const { success, error } =
await ControllerInstance.getInstance().environmentController.deleteEnvironment(
{ id: environmentId },
this.headers
)

if (success) {
Logger.info('Environment deleted successfully')
Expand Down
6 changes: 2 additions & 4 deletions apps/cli/src/commands/environment/update.environment.ts
Original file line number Diff line number Diff line change
Expand Up @@ -55,10 +55,8 @@ export class UpdateEnvironment extends BaseCommand {
success,
error,
data: environment
} = await ControllerInstance
.getInstance().
environmentController.updateEnvironment(
{name, description, slug: environmentSlug},
} = await ControllerInstance.getInstance().environmentController.updateEnvironment(
{ name, description, slug: environmentSlug },
this.headers
)

Expand Down
5 changes: 2 additions & 3 deletions apps/web/src/components/hero/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -44,9 +44,8 @@ function Hero(): React.JSX.Element {
launch
</p>
</div>
))
setEmail('');

))
setEmail('')
} catch (error) {
// eslint-disable-next-line no-console -- chill
console.error(error)
Expand Down
4 changes: 3 additions & 1 deletion packages/secret-scan/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,9 @@
"scripts": {
"genKey": "tsx src/generateKey.ts",
"build": "tsup",
"test": "mocha"
"test": "mocha",
"format": "prettier --write \"src/**/*.ts\" \"test/**/*.ts\"",
"lint": "eslint \"{src,tests}/**/*.ts\" --fix"
},
"publishConfig": {
"access": "public"
Expand Down
12 changes: 7 additions & 5 deletions packages/secret-scan/src/rules/age.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,25 +10,27 @@ export default function age(): RegExp[] {

const testcase: TestCase[] = [
{
input: 'AGE-SECRET-KEY-17TWAXMPDQAJV0RH43E5FJH5F0LUTFR3JTCM999XEF70QA57SZGXFJ3NQZK',
input:
'AGE-SECRET-KEY-17TWAXMPDQAJV0RH43E5FJH5F0LUTFR3JTCM999XEF70QA57SZGXFJ3NQZK',
expected: true
},
{
input: 'AGE-SECRET-KEY-1QZRY9X8GF2TVDW0S3JN54KHCE6MUA7L1QZRY9X8GF2TVDW0S3JN54KHCE6MUA7L1QZRY9X8GF2TVDW0S3JN54KHCE6MUA7L',
input:
'AGE-SECRET-KEY-1QZRY9X8GF2TVDW0S3JN54KHCE6MUA7L1QZRY9X8GF2TVDW0S3JN54KHCE6MUA7L1QZRY9X8GF2TVDW0S3JN54KHCE6MUA7L',
expected: false
},
{
input: 'AGE-SECRET-KEY-1QZRY9X8GF2TVDW0S3JN54KHCE6MUA7L',
expected: false
},
{
input: "AGE-SECRET-KEY",
input: 'AGE-SECRET-KEY',
expected: false
},
{
input: "AGE",
input: 'AGE',
expected: false
}
]

age.testcases = testcase
age.testcases = testcase
2 changes: 1 addition & 1 deletion packages/secret-scan/src/rules/airtable.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,4 +31,4 @@ const testcase: TestCase[] = [
}
]

airtable.testcases = testcase
airtable.testcases = testcase
48 changes: 24 additions & 24 deletions packages/secret-scan/src/rules/asana.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,33 +2,33 @@
import type { TestCase } from '@/types'

export default function asana(): RegExp[] {
return [
// Asana API key regex
/asana(?:[0-9]{16}|[a-zA-Z0-9]{32})/i
]
return [
// Asana API key regex
/asana(?:[0-9]{16}|[a-zA-Z0-9]{32})/i
]
}

const testcase: TestCase[] = [
{
input: 'asana7127506407697088',
expected: true
},
{
input: 'asanauqojiVXgDOUXY33pSof0IHG0wQAInfRX',
expected: true
},
{
input: 'asana',
expected: false
},
{
input: 'asana123',
expected: false
},
{
input: 'asanahsdiu3nniwoien',
expected: false
}
{
input: 'asana7127506407697088',
expected: true
},
{
input: 'asanauqojiVXgDOUXY33pSof0IHG0wQAInfRX',
expected: true
},
{
input: 'asana',
expected: false
},
{
input: 'asana123',
expected: false
},
{
input: 'asanahsdiu3nniwoien',
expected: false
}
]

asana.testcases = testcase
112 changes: 56 additions & 56 deletions packages/secret-scan/src/rules/atlassian.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,65 +2,65 @@
import type { TestCase } from '@/types'

export default function atlassian(): RegExp[] {
return [
// Atlassian API key starts with atlassian, confluence and jira
/(?:atlassian|confluence|jira)[a-zA-Z0-9]{24}/i
]
return [
// Atlassian API key starts with atlassian, confluence and jira
/(?:atlassian|confluence|jira)[a-zA-Z0-9]{24}/i
]
}

const testcase: TestCase[] = [
{
input: 'confluenceojqhLdXTkuq6evzHPAxG4Gec',
expected: true
},
{
input: 'jirai2rfog2lrLrchssWRvvqcAak',
expected: true
},
{
input: 'jiraStCBHh8bkPREl880xgj2c5Pr',
expected: true
},
{
input: 'atlassianruJGQgh186T1VsJj92Zevl4g',
expected: true
},
{
input: 'confluencePVupYYBa4jwjTLGPbH0uc6re',
expected: true
},
{
input: 'atlassianfokyIISToCvOLu37Ghwgmg9B',
expected: true
},
{
input: 'confluencebzql7VAKbEZIa4sPHe9oAd8x',
expected: true
},
{
input: 'jiraYEsx1YgYlJhx7PZWiL45BnuP',
expected: true
},
{
input: 'jiraZsWvU6UYKj40x1JT7L8k3kFS',
expected: true
},
{
input: 'confluence27GqJEFNkhUqkNLti86QUBX0',
expected: true
},
{
input: 'atlassian',
expected: false
},
{
input: 'confluence',
expected: false
},
{
input: 'jira',
expected: false
}
{
input: 'confluenceojqhLdXTkuq6evzHPAxG4Gec',
expected: true
},
{
input: 'jirai2rfog2lrLrchssWRvvqcAak',
expected: true
},
{
input: 'jiraStCBHh8bkPREl880xgj2c5Pr',
expected: true
},
{
input: 'atlassianruJGQgh186T1VsJj92Zevl4g',
expected: true
},
{
input: 'confluencePVupYYBa4jwjTLGPbH0uc6re',
expected: true
},
{
input: 'atlassianfokyIISToCvOLu37Ghwgmg9B',
expected: true
},
{
input: 'confluencebzql7VAKbEZIa4sPHe9oAd8x',
expected: true
},
{
input: 'jiraYEsx1YgYlJhx7PZWiL45BnuP',
expected: true
},
{
input: 'jiraZsWvU6UYKj40x1JT7L8k3kFS',
expected: true
},
{
input: 'confluence27GqJEFNkhUqkNLti86QUBX0',
expected: true
},
{
input: 'atlassian',
expected: false
},
{
input: 'confluence',
expected: false
},
{
input: 'jira',
expected: false
}
]

atlassian.testcases = testcase
Loading

0 comments on commit 5884833

Please sign in to comment.