I have an internal API that would fetch and return a fileresult. However, this API does not have any concept of authentication/role/permission checks and cannot be modified to do so.
I would like to create an web API endpoint on an existing ASP.NET Core 2 Web API to do permission check, make a call to this internal API and return the fileresult back to a web client.
Would it be possible to get the wrapper API endpoint to just pass whatever it fetches as a file result without having to reconstruct the response (e.g., specify file name, content type, etc)? The files could be images, pdfs, document. I would prefer that this wrapper API only do permission check and make a call to the internal API endpoint using some sort of fileId and not need to know about the content length or type.