Skip to content
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

Built out ability to validate meta field names from xml files against filters using ExtractionTest #203

Open
wants to merge 6 commits into
base: main
Choose a base branch
from

Conversation

sambish5
Copy link
Collaborator

@sambish5 sambish5 commented Mar 7, 2022

This is in reference to NationalSecurityAgency/burrito-grande#968.
This change to ExtractionTest allows for xml meta fields to be compared to filters to validate that meta names exist within filters.

Instruction updated below.
#203 (comment)

@cfkoehler cfkoehler self-requested a review March 10, 2022 18:39
@burritoqueen burritoqueen self-requested a review March 17, 2022 23:12
@sambish5
Copy link
Collaborator Author

sambish5 commented Mar 28, 2022

Updated the validation of the paramaters against the passed in filters. The filters have to be passed through the answer .xml. An example of this is included within TestValidateFieldExtractionTest.xml, but I will describe it here as well.

Two things must be included in the .xml to indicate what filters and meta field names you want checked:

  1. In the section of the .xml, you must include:
    https://github.com/NationalSecurityAgency/emissary/pull/203/files#diff-7a0c74cff2741ef86493f708e8367d5d753b374c7cee46d75a661ad4731901abR3-R6
    (For Burrito filters, it needs to be formatted as <filter#>com.burrito.output.filters.LogFilter<filter#>)
    These allow the filters to be found through an InputStream.

  2. For the individual meta field, you must include valdiateField="true" within the meta tag. If this is set to false or not included, the name will not be validated.

@jpdahlke jpdahlke added this to the v8.0.0 milestone Apr 8, 2022
src/main/java/emissary/test/core/ExtractionTest.java Outdated Show resolved Hide resolved
src/main/java/emissary/test/core/ExtractionTest.java Outdated Show resolved Hide resolved
* @param key the current meta key name to validate against LogFilter
* @param tname the current test name
*/
protected void validateFieldInFilter(String key, String tname) {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sonar recommends breaking this method up to reduce complexity. Parts can possible be abstracted out into helper methods.
Not a blocker but something to be aware of.

src/main/java/emissary/test/core/ExtractionTest.java Outdated Show resolved Hide resolved
src/main/java/emissary/test/core/ExtractionTest.java Outdated Show resolved Hide resolved
src/main/java/emissary/test/core/ExtractionTest.java Outdated Show resolved Hide resolved
src/test/java/emissary/test/core/TestExtractionTest.java Outdated Show resolved Hide resolved
@sambish5 sambish5 force-pushed the emissary-logfilterfields-968 branch from 5d1c065 to bcbb4ce Compare July 22, 2022 17:38
@cfkoehler cfkoehler added the major Change will go out in a major version increase label Dec 15, 2022
@dev-mlb dev-mlb added the rebase Things have happened and now a rebase is needed label Feb 13, 2024
@dev-mlb dev-mlb removed the request for review from burritoqueen February 13, 2024 16:21
@jpdahlke jpdahlke removed this from the v8.0.0 milestone Apr 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
major Change will go out in a major version increase rebase Things have happened and now a rebase is needed
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants