RedHatInsights/insights-upload

Send more info to the available MQ topic

SteveHNH opened this issue · 6 comments

Currently, we are only providing the available mq topic with the url for the payload. We should be providing the Red Hat account, and principal at the very least. Probably should also include the service name that did the validation and the MIME type as well. Maybe we could include more info in there, but for now that's what I'm thinking.

As the IPP says:

Once the upload service has made the validated payload available to other applications, it should notify all applications on the platform of the new payload, its content type, the authenticated principal who uploaded it, and the Red Hat account that principal belongs to.

Apart from the URL, the account, the principal and the MIME type are obligatory. Only the validation application name is optional.

Yes... please add the service name to the message that goes on the available mq topic. It will allow consuming services to determine if a payload/upload is something it cares about without having to retrieve the content first.

Shouldn’t that be a question of the MIME type, and not the service that did the validation? As far as I know, the service is determined by the MIME type. Is there a use case when the service name is a better source of information that the MIME type?

@Glutexo The idea behind this one was that a service may only be interested in ingesting payloads that have been verified by a particular service. To use an example, vmaas may be interested in validated payloads for advisor, but not hccm. So putting the service name that did the validation in the message, they can reliably determine whether they want to actually ingest it or not.

And is it possible that payloads with the same MIME-type would be picked up by different validators? If so, what determines which validation service would be used?

Oh. I think I found the piece that I missed. I understand it like this:

The MIME-type is only parsed by the upload service to put notify on the right service on the appropriate topic. But once the payload gets validated and put on the validation queue, the MIME is not there. That’s what the service name is good for.

But please, correct me if I am mistaken.