Closed caipre closed 2 months ago
@caipre try it like this. AllowedRiskSeverity is a string on the input currently.
curl -XPOST -H'content-type: application/json' -d '{"Policy":{"Name":"High","AllowedRiskSeverity":"Negligible,Low,Medium"}}' http://localhost:31700/v1/policies
A policy with
AllowedRiskSeverity
as a list fails to create:The value is treated as a list when listing an image's vulnerabilities: https://github.com/target/portauthority/blob/f2513f0b45301c054188f90d45de229efd96aaa4/api/v1/routes.go#L962
Maybe there's some marshaling required here: https://github.com/target/portauthority/blob/master/pkg/datastore/pgsql/policy.go#L60 ? My golang isn't too strong. Will try to look more into this tomorrow.