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

WRP Validator Integration #424

Open
denopink opened this issue Oct 17, 2024 · 0 comments
Open

WRP Validator Integration #424

denopink opened this issue Oct 17, 2024 · 0 comments
Assignees

Comments

@denopink
Copy link
Contributor

denopink commented Oct 17, 2024

Overview

  • Introduced in v0.9.6, we're currently on v0.10.7
  • Validators are disabled by default
  • Scytale's code interprets configured validator failures as something to either
    • log a info/warning message and continue with the request or
    • log an error and return a 400
  • Only cd has validator enabled machines (i.e. scytale)
Available validators:
  • always_invalid
    • doesn't validate anything about the message and always returns an error
  • always_valid
    • doesn't validate anything about the message and always returns nil
  • utf8
    • validates that it contains UTF-8 strings
  • msg_type
    • validates the message's Type
  • source
    • validates the message's Source
  • destination
    • validates the message's Destination
  • simple_res_req
    • validates the message's Type is of SimpleRequestResponseMessageType
  • simple_event
    • validates the message's Type is of SimpleEventMessageType
  • spans
    • validates the message's Spans
      • `An array of arrays of timing values as a list in the format: "parent" (string), "name" (string), "start time" (int), "duration" (int), "status" (int)

Integration Details

Integration Details

WRP validators are configured with the following (regardless of the application code) yaml:

# wrpValidators defines the wrp validators used to validate incoming wrp messages.
# (Optional)
# Available validator types: always_invalid, always_valid, utf8, msg_type, source, destination, simple_res_req, simple_event, spans
# Available validator levels: info, warning, error
# Validators can be disabled with `disable: true`, it is false by default
wrpValidators:
  - type: utf8
    level: warning
    disable: true
  - type: source
    level: error

Key points:

  • no validator is included by default
  • a level is assigned to a given validator (default value is unknown and it's consider invalid): info, warning, error
  • during a validation failure, the application code determines how the validator level is interpret

Currently, only cd has validator enabled scytales . This is the validator config:

wrpValidators:
  - type: utf8
    level: error
  - type: msg_type
    level: error
  - type: destination
    level: warning
  - type: source
    level: warning
  • utf8 and msg_type validation errors are logged as errors and scytale returns a 400
  • destination and source validation errors are logged as warnings (scytale continues with the request)

Pending Questions

  1. For destination do want to allow destinations without dns: identifiers to go through?
  2. Which validators should scytale use?
  3. For the selected validators, what level should be used?
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants