apache / trafficcontrol

Apache Traffic Control is an Open Source implementation of a Content Delivery Network
https://trafficcontrol.apache.org/
Apache License 2.0
1.06k stars 340 forks source link

TO Go: signatureType required for POST deliveryservice #2802

Closed dangogh closed 5 years ago

dangogh commented 5 years ago

when creating a new deliveryservice thru the API POST, signatureType is required. If not present or null, a database access error occurs -- not a friendly error message.

I'm guessing the PUT endpoint has the same issue. The handler needs to validate that field

rawlinp commented 5 years ago

Where is signatureType coming from? Is that a new required field and therefore an API-breaker?

rob05c commented 5 years ago

Do you mean signing_algorithm, which is a deliveryservice_signature_type type in the database?

It shouldn't be required, and a db error shouldn't occur, the db allows nulls there.

It's new in API 1.3, so we can't require it in 1.2. But, we shouldn't be, and it should be defaulted here: https://github.com/apache/trafficcontrol/blob/master/lib/go-tc/deliveryservices.go#L389

If Sanitize() isn't being called correctly on the input of a POST or PUT, that's a bug.

dangogh commented 5 years ago

no longer a problem in 3.0.x