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

feat: custom header validation #15

Closed
wants to merge 1 commit into from
Closed

feat: custom header validation #15

wants to merge 1 commit into from

Conversation

Simun17
Copy link
Collaborator

@Simun17 Simun17 commented Nov 6, 2024

Description

Added a new feature which allows validation of fields in the header. Header validation can be turned on on the Validator level by setting a specific variable in the config map, which requires each message to contain header schema ID and version. Otherwise, the validation fails because of missing required headers. Additionally, the header validation can be turned on/off on the single message level; it can be set by specifying the headerValidation flag to true/false. If headerValidation is set in message's header, Validator level flag is ignored.

Type of change

  • Bug fix (non-breaking change that fixes an issue)
  • New feature (non-breaking change that adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation update
  • Refactoring (improving code structure without changing external behavior)
  • Other (please explain):

Related Issue

Checklist

  • I have performed a self-review of my code
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • My code is well documented
  • I have read and understood the contribution guidelines

How Has This Been Tested?

This has been tested by setting the Validator' header validation flag to true and false. A set of messages was sent; these messages contained the same payload, but different headers. The cases that were tested are the following:

  • no new headers
  • only headerValidation header set, no headerSchemaId and headerVersionId
  • headerSchemaId and headerVersionId set, but headerValidation not set
  • headerValidation set to true/false, but missing one of headerSchemaId or headerVersionId
  • all 3 headers set
    All headers that provided sufficient info were validated correctly and in case of an error, all error messages and error codes were displayed correctly.

feat: custom header validation
@Simun17 Simun17 changed the title Feature/header validation (#1) feat: custom header validation Nov 7, 2024
@Simun17 Simun17 closed this Nov 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Feature]: Custom header validation
1 participant