Skip to content

Commit

Permalink
Merge pull request #902 from akto-api-security/develop
Browse files Browse the repository at this point in the history
Develop to master
  • Loading branch information
aktoboy authored Feb 22, 2024
2 parents 8f74188 + b95b83d commit 7b31b01
Show file tree
Hide file tree
Showing 8 changed files with 184 additions and 139 deletions.
9 changes: 7 additions & 2 deletions .github/workflows/prod.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,14 @@ jobs:
- uses: actions/setup-node@v2
with:
node-version: '17'
- name: Download Akto templates zip
- name: Download Akto templates zip and PII files
working-directory: ./apps/dashboard/src/main/resources
run: wget -O test-library-master.zip https://github.com/akto-api-security/tests-library/archive/refs/heads/master.zip
run: |
wget -O tests-library-master.zip https://github.com/akto-api-security/tests-library/archive/refs/heads/master.zip
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=${{github.event.inputs.release_version}} && npm run build
Expand Down
8 changes: 6 additions & 2 deletions .github/workflows/staging.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,13 @@ jobs:
- name: Convert github branch name to be compatible with docker tag name convention and generate tag name
id: docker_tag
run: echo "IMAGE_TAG=a-$(echo ${{ github.ref_name }} | sed 's/[^a-zA-Z0-9]/-/g')" >> $GITHUB_OUTPUT
- name: Download Akto templates zip
- name: Download Akto templates zip and PII files
working-directory: ./apps/dashboard/src/main/resources
run: wget -O test-library-master.zip https://github.com/akto-api-security/tests-library/archive/refs/heads/master.zip
run: |
wget -O tests-library-master.zip https://github.com/akto-api-security/tests-library/archive/refs/heads/master.zip
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
Expand Down
13 changes: 7 additions & 6 deletions apps/dashboard/src/main/java/com/akto/action/AccountAction.java
Original file line number Diff line number Diff line change
Expand Up @@ -12,16 +12,14 @@
import com.akto.runtime.Main;
import com.akto.util.enums.GlobalEnums.YamlTemplateSource;
import com.akto.util.DashboardMode;
import com.akto.utils.GithubSync;
import com.akto.utils.TestTemplateUtils;
import com.akto.utils.billing.OrganizationUtils;
import com.akto.utils.cloud.Utils;
import com.akto.utils.cloud.serverless.aws.Lambda;
import com.akto.utils.cloud.stack.aws.AwsStack;
import com.akto.utils.cloud.stack.dto.StackState;
import com.akto.utils.platform.DashboardStackDetails;
import com.akto.utils.platform.MirroringStackDetails;
import com.amazonaws.services.autoscaling.AmazonAutoScaling;
import com.amazonaws.services.autoscaling.AmazonAutoScalingClientBuilder;
import com.amazonaws.services.autoscaling.model.RefreshPreferences;
import com.amazonaws.services.autoscaling.model.StartInstanceRefreshRequest;
import com.amazonaws.services.autoscaling.model.StartInstanceRefreshResult;
Expand Down Expand Up @@ -313,10 +311,13 @@ public void run() {
}

try {
GithubSync githubSync = new GithubSync();
byte[] repoZip = githubSync.syncRepo("akto-api-security/tests-library", "master");
byte[] testingTemplates = TestTemplateUtils.getTestingTemplates();
if(testingTemplates == null){
loggerMaker.errorAndAddToDb("Failed to load test templates", LogDb.DASHBOARD);
return;
}
loggerMaker.infoAndAddToDb(String.format("Updating akto test templates for new account: %d", newAccountId), LogDb.DASHBOARD);
InitializerListener.processTemplateFilesZip(repoZip, InitializerListener._AKTO, YamlTemplateSource.AKTO_TEMPLATES.toString(), "");
InitializerListener.processTemplateFilesZip(testingTemplates, InitializerListener._AKTO, YamlTemplateSource.AKTO_TEMPLATES.toString(), "");
} catch (Exception e) {
loggerMaker.errorAndAddToDb(e,String.format("Error while adding test editor templates for new account %d, Error: %s", newAccountId, e.getMessage()), LogDb.DASHBOARD);
}
Expand Down
Loading

0 comments on commit 7b31b01

Please sign in to comment.