mirror of
https://github.com/open-policy-agent/opa.git
synced 2026-08-13 03:42:35 -06:00
26cd8e59ec
These changes refactor the storage layer to use storage.Path instead of ast.Ref for Read/Write/Begin/Unmount/Mount operations. Previously, the storage layer used ast.Ref values to refer to locations in storage. Use of ast.Ref introduced unnecessary complexity for storage plugins as they had to be aware of various details (e.g., array indices specified as ast.Number/float64 values, potentially nested references, etc.) that were unnecessary given that ast.Ref values passed to the storage layer were intended represent JSON pointers. These changes also remove the need for storage plugins to be aware of where they are mounted. That is, the paths passed to the read call will be relative to the mount point. The remaining dependencies on the ast package from the storage package are for (1) indexing and (2) policy storage. It may be possible to further decouple these packages by revisiting how indexing is done and treating policies as blobs. Fixes #159