-
Notifications
You must be signed in to change notification settings - Fork 215
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fixes in required fields and default testid for frontend #680
Merged
Merged
Changes from 7 commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
003b16c
Fixed info key required fields check
Ark2307 5592893
Fixed frontend bugs
Ark2307 4f8a2cb
Merge branch 'master' into hotfix/fix_subcategory_bug_in_editor
notshivansh b1ca6b6
update fields
notshivansh 357ff75
resolved changes
Ark2307 6facad5
Merge branch 'develop' into hotfix/fix_subcategory_bug_in_editor
Ark2307 7df28b9
adding action error messages
Ark2307 37df6b8
Reverting error message to original
Ark2307 25410f9
More descriptive error messages
Ark2307 d62e53c
Merge branch 'develop' into hotfix/fix_subcategory_bug_in_editor
Ark2307 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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 |
---|---|---|
|
@@ -9,11 +9,14 @@ | |
import com.akto.dao.context.Context; | ||
import com.akto.dao.test_editor.TestConfigYamlParser; | ||
import com.akto.dao.test_editor.YamlTemplateDao; | ||
import com.akto.dao.test_editor.info.InfoParser; | ||
import com.akto.dao.testing.TestingRunResultDao; | ||
import com.akto.dto.AccountSettings; | ||
import com.akto.dto.ApiInfo; | ||
import com.akto.dto.CustomAuthType; | ||
import com.akto.dto.User; | ||
import com.akto.dto.test_editor.Category; | ||
import com.akto.dto.test_editor.Info; | ||
import com.akto.dto.test_editor.TestConfig; | ||
import com.akto.dto.test_editor.TestLibrary; | ||
import com.akto.dto.test_editor.YamlTemplate; | ||
|
@@ -32,6 +35,7 @@ | |
import com.akto.testing.TestExecutor; | ||
import com.akto.util.Constants; | ||
import com.akto.util.enums.GlobalEnums; | ||
import com.akto.util.enums.GlobalEnums.YamlTemplateSource; | ||
import com.akto.utils.GithubSync; | ||
import com.fasterxml.jackson.databind.ObjectMapper; | ||
import com.fasterxml.jackson.dataformat.yaml.YAMLFactory; | ||
|
@@ -102,7 +106,23 @@ public String saveTestEditorFile() { | |
Map<String, Object> config = mapper.readValue(content, Map.class); | ||
Object info = config.get("info"); | ||
if (info == null) { | ||
addActionError("Error in template: info key absent"); | ||
addActionError("info is null"); | ||
return ERROR.toUpperCase(); | ||
} | ||
|
||
// adding all necessary fields check for info in editor | ||
InfoParser parser = new InfoParser(); | ||
Info convertedInfo = parser.parse(info); | ||
|
||
if (convertedInfo.getName() == null || convertedInfo.getDescription() == null | ||
|| convertedInfo.getDetails() == null || convertedInfo.getCategory() == null | ||
|| convertedInfo.getSeverity() == null || convertedInfo.getSubCategory() == null) { | ||
addActionError("info information is not complete."); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. make this error message more descriptive, this is unclear |
||
return ERROR.toUpperCase(); | ||
} | ||
|
||
Category category = convertedInfo.getCategory(); | ||
if (category.getName() == null || category.getDisplayName() == null || category.getShortName() == null) { | ||
return ERROR.toUpperCase(); | ||
} | ||
|
||
|
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
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.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
revert this to original