diff --git a/README.md b/README.md index 150045ce..33b020f3 100644 --- a/README.md +++ b/README.md @@ -313,7 +313,7 @@ spec: Team: ($expectedTeam) ``` -Finally, we can always access the current resource, policy and rule being evaluated using the builtin `$resource`, `$policy` and `$rule` bindings. No protection is made to prevent you from overriding those bindings though. +Finally, we can always access the current payload, policy and rule being evaluated using the builtin `$payload`, `$policy` and `$rule` bindings. No protection is made to prevent you from overriding those bindings though. #### Escaping projection diff --git a/pkg/json-engine/engine.go b/pkg/json-engine/engine.go index f5b5ef2a..08fe4cc8 100644 --- a/pkg/json-engine/engine.go +++ b/pkg/json-engine/engine.go @@ -37,7 +37,7 @@ func New() engine.Engine[JsonEngineRequest, JsonEngineResponse] { var requests []request bindings := jpbinding.NewBindings() for _, resource := range r.Resources { - bindings = bindings.Register("$resource", jpbinding.NewBinding(resource)) + bindings = bindings.Register("$payload", jpbinding.NewBinding(resource)) for _, policy := range r.Policies { bindings = bindings.Register("$policy", jpbinding.NewBinding(policy)) for _, rule := range policy.Spec.Rules { diff --git a/website/docs/jp.md b/website/docs/jp.md index 28ac9f46..80ec0656 100644 --- a/website/docs/jp.md +++ b/website/docs/jp.md @@ -6,7 +6,7 @@ The current resource, policy and rule are always available using the following b | Binding | Usage | |---|---| -| `$resource` | Current resource being analysed | +| `$payload` | Current payload being analysed | | `$policy` | Current policy being executed | | `$rule` | Current rule being evaluated | diff --git a/website/docs/policies/explicit-bindings.md b/website/docs/policies/explicit-bindings.md index 8b30b5db..499c7996 100644 --- a/website/docs/policies/explicit-bindings.md +++ b/website/docs/policies/explicit-bindings.md @@ -83,4 +83,4 @@ spec: Team: ($expectedTeam) ``` -Finally, we can always access the current resource, policy and rule being evaluated using the builtin `$resource`, `$policy` and `$rule` bindings. No protection is made to prevent you from overriding those bindings though. +Finally, we can always access the current payload, policy and rule being evaluated using the builtin `$payload`, `$policy` and `$rule` bindings. No protection is made to prevent you from overriding those bindings though.