Skip to content

Commit

Permalink
Merge branch 'master' of https://github.com/hbarsaiyan/akto into feat…
Browse files Browse the repository at this point in the history
…ure/new-sample-endpoints
  • Loading branch information
hbarsaiyan committed Apr 10, 2024
2 parents 5a9fa8d + e61f05e commit 478535f
Show file tree
Hide file tree
Showing 17 changed files with 307 additions and 71 deletions.
12 changes: 1 addition & 11 deletions .github/workflows/beamerAndDiscord.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,17 +40,7 @@ jobs:
line = line.split('by', 1)[0].strip()
release_notes += f'<li>{line[1:]}</li>'
release_notes += '</ul>'
release_notes2 = '<p>More...</p>'
release_notes2 += '<ul></ul>'
release_notes2 += '<p>'
release_notes2 += '<a href=https://discord.com/invite/Wpc6xVME4s >'
release_notes2 += '</a>'
release_notes2 += '</p>'
release_notes2 += '<ul>'
release_notes2 += '<a href=https://discord.com/invite/Wpc6xVME4s ></a>'
release_notes2 += '<li><a href=https://discord.com/invite/Wpc6xVME4s ></a><a href=https://discord.com/invite/Wpc6xVME4s >Join Discord </a>to know more</li>'
release_notes2 += '<li>Star Akto on <a href=https://github.com/akto-api-security/akto>Github</a></li>'
release_notes2 += '</ul>'
release_notes2 = '<p></p>Have questions? Ask on <a href=https://discord.com/invite/Wpc6xVME4s >Discord</a> or our <a href=https://community.akto.io >Community page</a>'
release_notes = release_notes+release_notes2

Expand Down
5 changes: 0 additions & 5 deletions .github/workflows/prod.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,6 @@ jobs:
wget -O fintech.json https://raw.githubusercontent.com/akto-api-security/akto/master/pii-types/fintech.json
wget -O filetypes.json https://raw.githubusercontent.com/akto-api-security/akto/master/pii-types/filetypes.json
- name: Prepare Dashboard UI
working-directory: ./apps/dashboard/
run: npm install && export RELEASE_VERSION=${{github.event.inputs.release_version}} && npm run build
- name: Prepare Dashboard polaris UI
working-directory: ./apps/dashboard/web/polaris_web
run: npm install && export RELEASE_VERSION=${{github.event.inputs.release_version}} && npm run build
Expand All @@ -51,8 +48,6 @@ jobs:
aws-secret-access-key: ${{secrets.AWS_SECRET_ACCESS_KEY}}
aws-region: ap-south-1

- name: Deploy static site to S3 bucket
run: aws s3 sync ./apps/dashboard/web/dist s3://dashboard-on-cdn/web/${{github.event.inputs.release_version}}/dist --delete
- name: Deploy polaris site to S3 bucket
run: aws s3 sync ./apps/dashboard/web/polaris_web/web/dist s3://dashboard-on-cdn/polaris_web/${{github.event.inputs.release_version}}/dist --delete
- run: mvn package -Dakto-image-tag=${{ github.event.inputs.release_version }} -Dakto-build-time=$(eval "date +%s") -Dakto-release-version=${{github.event.inputs.release_version}}
Expand Down
5 changes: 0 additions & 5 deletions .github/workflows/releaseOnlyUI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,6 @@ jobs:
- uses: actions/setup-node@v2
with:
node-version: '17'
- name: Prepare Dashboard UI
working-directory: ./apps/dashboard/
run: npm install && export RELEASE_VERSION=${{github.event.inputs.release_version}} && npm run build
- name: Prepare Dashboard polaris UI
working-directory: ./apps/dashboard/web/polaris_web
run: npm install && export RELEASE_VERSION=${{github.event.inputs.release_version}} && npm run build
Expand All @@ -43,7 +40,5 @@ jobs:
aws-secret-access-key: ${{secrets.AWS_SECRET_ACCESS_KEY}}
aws-region: ap-south-1

- name: Deploy static site to S3 bucket
run: aws s3 sync ./apps/dashboard/web/dist s3://dashboard-on-cdn/web/${{github.event.inputs.release_version}}/dist --delete
- name: Deploy polaris site to S3 bucket
run: aws s3 sync ./apps/dashboard/web/polaris_web/web/dist s3://dashboard-on-cdn/polaris_web/${{github.event.inputs.release_version}}/dist --delete
5 changes: 0 additions & 5 deletions .github/workflows/staging.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,6 @@ jobs:
wget -O general.json https://raw.githubusercontent.com/akto-api-security/pii-types/master/general.json
wget -O fintech.json https://raw.githubusercontent.com/akto-api-security/akto/master/pii-types/fintech.json
wget -O filetypes.json https://raw.githubusercontent.com/akto-api-security/akto/master/pii-types/filetypes.json
- name: Prepare Dashboard UI
working-directory: ./apps/dashboard/
run: npm install && export RELEASE_VERSION=${{steps.docker_tag.outputs.IMAGE_TAG}} && npm run build
- name: Prepare Dashboard polaris UI
working-directory: ./apps/dashboard/web/polaris_web
run: npm install && export RELEASE_VERSION=${{steps.docker_tag.outputs.IMAGE_TAG}} && npm run build
Expand All @@ -47,8 +44,6 @@ jobs:
aws-secret-access-key: ${{secrets.AWS_SECRET_ACCESS_KEY}}
aws-region: ap-south-1

- name: Deploy static site to S3 bucket
run: aws s3 sync ./apps/dashboard/web/dist s3://dashboard-on-cdn/web/${{steps.docker_tag.outputs.IMAGE_TAG}}/dist --delete
- name: Deploy polaris site to S3 bucket
run: aws s3 sync ./apps/dashboard/web/polaris_web/web/dist s3://dashboard-on-cdn/polaris_web/${{steps.docker_tag.outputs.IMAGE_TAG}}/dist --delete

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -449,6 +449,10 @@ public String fetchTestingRunResultSummary() {
String testingRunResultSummaryHexId;
List<TestingRunResult> testingRunResults;
private boolean fetchOnlyVulnerable;
public enum QueryMode {
VULNERABLE, SECURED, SKIPPED_EXEC_NEED_CONFIG, SKIPPED_EXEC_NO_ACTION, SKIPPED_EXEC, ALL;
}
private QueryMode queryMode;

public String fetchTestingRunResults() {
ObjectId testingRunResultSummaryId;
Expand All @@ -461,12 +465,28 @@ public String fetchTestingRunResults() {

List<Bson> testingRunResultFilters = new ArrayList<>();

if (fetchOnlyVulnerable) {
testingRunResultFilters.add(Filters.eq(TestingRunResult.VULNERABLE, true));
}

testingRunResultFilters.add(Filters.eq(TestingRunResult.TEST_RUN_RESULT_SUMMARY_ID, testingRunResultSummaryId));

if (queryMode == null) {
if (fetchOnlyVulnerable) {
testingRunResultFilters.add(Filters.eq(TestingRunResult.VULNERABLE, true));
}
} else {
switch (queryMode) {
case VULNERABLE:
testingRunResultFilters.add(Filters.eq(TestingRunResult.VULNERABLE, true));
break;
case SKIPPED_EXEC:
testingRunResultFilters.add(Filters.eq(TestingRunResult.VULNERABLE, false));
testingRunResultFilters.add(Filters.in(TestingRunResultDao.ERRORS_KEY, TestResult.TestError.getErrorsToSkipTests()));
break;
case SECURED:
testingRunResultFilters.add(Filters.eq(TestingRunResult.VULNERABLE, false));
testingRunResultFilters.add(Filters.nin(TestingRunResultDao.ERRORS_KEY, TestResult.TestError.getErrorsToSkipTests()));
break;
}
}

this.testingRunResults = TestingRunResultDao.instance
.fetchLatestTestingRunResult(Filters.and(testingRunResultFilters));

Expand Down Expand Up @@ -1013,6 +1033,10 @@ public void setFetchOnlyVulnerable(boolean fetchOnlyVulnerable) {
this.fetchOnlyVulnerable = fetchOnlyVulnerable;
}

public void setQueryMode(QueryMode queryMode) {
this.queryMode = queryMode;
}

public Map<String, Set<String>> getMetadataFilters() {
return metadataFilters;
}
Expand Down
102 changes: 102 additions & 0 deletions apps/dashboard/web/polaris_web/package-lock.json

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

2 changes: 2 additions & 0 deletions apps/dashboard/web/polaris_web/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,9 @@
"@testing-library/jest-dom": "^5.16.5",
"@testing-library/react": "^13.4.0",
"@testing-library/user-event": "^13.5.0",
"assert": "^2.1.0",
"axios": "^1.4.0",
"buffer": "^6.0.3",
"dayjs": "^1.11.5",
"deep-diff": "^1.0.2",
"file-saver": "^2.0.5",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ function ApiChangesTable(props) {
selected={selected}
onSelect={handleSelectedTab}
mode={IndexFiltersMode.Default}
headings={tableDataObj.headers}
headings={tableDataObj.headings}
useNewRow={true}
condensedHeight={true}
tableTabs={tableTabs}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,14 @@ const endpointResourceName = {
plural: 'API endpoints',
};

const methodObj = [{
text: 'Method',
value: 'method',
filterKey: 'method',
showFilter: true,
textValue: 'method',
}]

const endpointSortOptions = [
{ label: 'Method', value: 'method asc', directionLabel: 'A-Z', sortKey: 'method' },
{ label: 'Method', value: 'method desc', directionLabel: 'Z-A', sortKey: 'method' },
Expand Down Expand Up @@ -180,13 +188,15 @@ const apiChangesData = {
getData(key){
if(key === 'param'){
const obj = {
headers: newParametersHeaders,
headers: [...newParametersHeaders, ...methodObj],
headings: newParametersHeaders,
resourceName: parameterResourceName,
sortOptions: parameterSortOptions,
}
return obj;
}else{
const obj = {
headings: endpointHeadings,
headers: endpointHeadings,
resourceName: endpointResourceName,
sortOptions: endpointSortOptions,
Expand Down
Loading

0 comments on commit 478535f

Please sign in to comment.