Data API #100
-
Hi, { Other requests direct to OPA, such as GET and POST work fine. I suspect I'm doing something daft, but can't figure out what... |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 5 replies
-
Hi Phil! When OPA get policies and data from a bundle, that bundle by default "owns" the paths (in this context, called "roots") declared by that bundle. This means that you can't modify the data from any paths provided by the bundle via the REST API. Unless paths are explicitly declared inside of the bundle, the default will be If you would like to split this apart, and have the policy be provided via a bundle, but the data via the REST API, you can do so by explicitly declare what "roots" are owned by the bundle, and publish your data on a different root. This is done via a As an example - if your policy resides under the "policy" root (i.e. your policy is declared with {
"roots": ["policy"]
} You can now modify any data that isn't under {
"my-data": {
"your-data": "here"
}
} But this would not work: {
"policy": {
"your-data": "here"
}
} Since the |
Beta Was this translation helpful? Give feedback.
-
The output of
If you provide the |
Beta Was this translation helpful? Give feedback.
The output of
opa build --help
could perhaps do a better job of explaining this, and this ticket should help when implemented, but here's the key paragraph:If you provide the
-b
(or--bundle
) flag toopa build
, the directory structure will be assumed to be that of a bundle, and your .manifest …