Validation of Topology Service Headers Codes
As part of these MRs:
We are adding custom response headers per service and response status code.
For example, if we have Topology Service config like this:
[[services.classify.response_headers]]
key = "Cache-Control"
value = "s-maxage=60"
raw_header = true
codes = ["OK"]
means that when we return response code OK
on Classify Service, then we set the headers Cache-Control=s-maxage=60
But the array of codes is just a list of strings, that can accept Typos. But the list of codes should belong to this enum Code
: https://pkg.go.dev/google.golang.org/grpc/codes
As part of this issue, we should add some validation to the list of codes, so that if we have a config that looked like this:
[[services.classify.response_headers]]
key = "Cache-Control"
value = "s-maxage=5"
raw_header = true
codes = ["NotFound", "InvalidArgument", "SDGSDFGSD"]
We should raise a validation error upon the start of the Topology Service
Edited by Omar Qunsul