Gophish-export is modified to validate assessment_id input prior to processing. This corrects some errors in processing that can come from invalid or malformed input.
π Motivation and context
This change is in relation to https://github.com/cisagov/gophish-tools/issues/11 . A partial assessment_id like "RV" could be passed to gophish-export, resulting in it matching all campaigns beginning in RV (which is all campaigns for all assessments). A regex validator was added to validate that the assessment_id matches the known format of assessments.
Closes #11
π§ͺ Testing
Gophish-export was run with assessment_id = "RV" and confirmed that an error message was shown to the user, and the process would exit.
Pytest cases were added to validate that the Regex matched a valid assessment ID format, and that it would not match an invalid value.
π· Screenshots (if appropriate)
β Checklist
[x] This PR has an informative and human-readable title.
[x] Changes are limited to a single goal - eschew scope creep!
[x] All relevant type-of-change labels have been added.
π£ Description
Gophish-export is modified to validate assessment_id input prior to processing. This corrects some errors in processing that can come from invalid or malformed input.
π Motivation and context
This change is in relation to https://github.com/cisagov/gophish-tools/issues/11 . A partial assessment_id like "RV" could be passed to gophish-export, resulting in it matching all campaigns beginning in RV (which is all campaigns for all assessments). A regex validator was added to validate that the assessment_id matches the known format of assessments.
Closes #11
π§ͺ Testing
Gophish-export was run with
assessment_id = "RV"
and confirmed that an error message was shown to the user, and the process would exit.Pytest cases were added to validate that the Regex matched a valid assessment ID format, and that it would not match an invalid value.
π· Screenshots (if appropriate)
β Checklist