mirror of
https://github.com/open-policy-agent/opa.git
synced 2026-08-13 03:42:35 -06:00
a2a4b5d4bd
Earlier with bundle persistence enabled, the bundle plugin would save the bundle object to disk. In scenarios where the downloaded bundle has multiple data files, OPA would first read the bundle and merge data in the bundle under the bundle.Bundle struct's Data field. Then before persisting the bundle to disk, the bundle plugin would use the bundle writer to write the bundle to the provided output stream. The result of this is that all the data files in the original bundle are consolidated into one data.json file. Now if signature verification is enabled, it will fail since the files includes in the bundle's signature will not match the ones in the persisted bundle. This commit resolves this issue by persiting the bytes of downloaded bundle to disk which then loaded from disk maintain the same structure as the original. Fixes: #3472 Signed-off-by: Ashutosh Narkar <anarkar4387@gmail.com>