-
Notifications
You must be signed in to change notification settings - Fork 584
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
13 changed files
with
16,807 additions
and
1,260 deletions.
There are no files selected for viewing
16,751 changes: 16,751 additions & 0 deletions
16,751
deepfence_frontend/apps/dashboard/api-spec-original.json
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
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
44 changes: 44 additions & 0 deletions
44
deepfence_frontend/apps/dashboard/scripts/transformAPISpec.js
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,44 @@ | ||
import fs from 'fs'; | ||
import path from 'path'; | ||
import * as prettier from 'prettier'; | ||
|
||
(async () => { | ||
const apiSpec = JSON.parse( | ||
fs.readFileSync(path.resolve('./api-spec-original.json'), 'utf8'), | ||
); | ||
|
||
// BEGIN: Transform UtilsReportFilters node_type | ||
delete apiSpec.components.schemas.UtilsReportFilters.properties.node_type.items.type; | ||
apiSpec.components.schemas.UtilsReportFilters.properties.node_type.items.enum = | ||
apiSpec.components.schemas.UtilsReportFilters.properties.node_type.enum; | ||
delete apiSpec.components.schemas.UtilsReportFilters.properties.node_type.enum; | ||
// END | ||
|
||
// BEGIN INGEST API ISSUE FIXES | ||
const routes = [ | ||
'/deepfence/ingest/cloud-resources', | ||
'/deepfence/ingest/cloud-compliance-status', | ||
'/deepfence/ingest/cloud-compliance', | ||
'/deepfence/ingest/compliance-scan-logs', | ||
'/deepfence/ingest/compliance', | ||
'/deepfence/ingest/malware', | ||
'/deepfence/ingest/malware-scan-logs', | ||
'/deepfence/ingest/secret-scan-logs', | ||
'/deepfence/ingest/secrets', | ||
'/deepfence/ingest/vulnerabilities', | ||
'/deepfence/ingest/vulnerabilities-scan-logs', | ||
]; | ||
|
||
routes.forEach((route) => { | ||
delete apiSpec.paths[route]; | ||
}); | ||
|
||
// END | ||
|
||
const prettierrc = fs.readFileSync(path.resolve('./../../.prettierrc.json'), 'utf-8'); | ||
const fileContent = await prettier.format(JSON.stringify(apiSpec), { | ||
...JSON.parse(prettierrc), | ||
parser: 'json', | ||
}); | ||
fs.writeFileSync(path.resolve('./api-spec.json'), fileContent, 'utf8'); | ||
})(); |
1 change: 0 additions & 1 deletion
1
deepfence_frontend/apps/dashboard/src/api/generated/.openapi-generator/FILES
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
103 changes: 0 additions & 103 deletions
103
deepfence_frontend/apps/dashboard/src/api/generated/apis/CloudResourcesApi.ts
This file was deleted.
Oops, something went wrong.
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
Oops, something went wrong.