From 2598cc2540f0e44b52dc7c2d8d85f6a36e0efc57 Mon Sep 17 00:00:00 2001 From: An Tran Date: Fri, 7 Feb 2025 11:30:53 +1000 Subject: [PATCH] [conditional] Remove apicast-policy.json Previously, the Conditional policy appeared in the portal UI but users could not select the nested policy, making it unuseable. It turned out that it was difficult to display the nested policy chain in the UI, so removed it from the UI entirely --- CHANGELOG.md | 1 + .../src/apicast/policy/conditional/README.md | 7 +- .../policy/conditional/apicast-policy.json | 92 ------------------- 3 files changed, 5 insertions(+), 95 deletions(-) delete mode 100644 gateway/src/apicast/policy/conditional/apicast-policy.json diff --git a/CHANGELOG.md b/CHANGELOG.md index f5dd5cc9c..837b8920f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -24,6 +24,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/). - Fixed APIcast panic when parsing invalid base64 encoded value [PR #1505](https://github.com/3scale/APIcast/pull/1505) [THEESCALE-11435](https://issues.redhat.com/browse/THREESCALE-11435) - Remove "$id" from the policy schema [PR #1525](https://github.com/3scale/APIcast/pull/1525) [THEESCALE-11610](https://issues.redhat.com/browse/THREESCALE-11610) - Fixed Financial-grade API (FAPI) policy not showing up in the admin portal [PR #1528](https://github.com/3scale/APIcast/pull/1528) [THREESCALE-11620](https://issues.redhat.com/browse/THREESCALE-11620) +- Remove Conditional Policy from the UI [PR #1534](https://github.com/3scale/APIcast/pull/1534) [THREESCALE-6116](https://issues.redhat.com/browse/THREESCALE-6116) ### Added diff --git a/gateway/src/apicast/policy/conditional/README.md b/gateway/src/apicast/policy/conditional/README.md index 36a7d4c95..b5b3325f4 100644 --- a/gateway/src/apicast/policy/conditional/README.md +++ b/gateway/src/apicast/policy/conditional/README.md @@ -4,6 +4,10 @@ - [**Conditions**](#conditions) - [**Example config**](#example-config) +## NOTE +This is policy is not available in the admin portal UI, however, you still be +able to configure it via 3scale [Product CR](https://github.com/3scale/3scale-operator/blob/master/doc/product-reference.md#user-content-policyconfigspec) + ## Description The conditional policy is a bit different from the rest because it contains a @@ -87,9 +91,6 @@ the one above plus the value of the `Backend` header: } ``` -To know more about the details of what is exactly supported please check the -[policy config schema](apicast-policy.json). - These are the variables supported in liquid: * uri * host diff --git a/gateway/src/apicast/policy/conditional/apicast-policy.json b/gateway/src/apicast/policy/conditional/apicast-policy.json deleted file mode 100644 index b75cec4e8..000000000 --- a/gateway/src/apicast/policy/conditional/apicast-policy.json +++ /dev/null @@ -1,92 +0,0 @@ -{ - "$schema": "http://apicast.io/policy-v1.1/schema#manifest#", - "name": "Conditional Policy [Tech preview]", - "summary": "Executes a policy chain conditionally.", - "description": [ - "Evaluates a condition, and when it's true, it calls its policy chain. ", - "This policy cannot be configured from the 3scale Admin Portal." - ], - "version": "builtin", - "configuration": { - "type": "object", - "definitions": { - "operation": { - "type": "object", - "properties": { - "left": { - "type": "string" - }, - "op": { - "type": "string", - "enum": ["==", "!="] - }, - "right": { - "type": "string" - }, - "left_type": { - "description": "How to evaluate 'left'", - "type": "string", - "default": "plain", - "oneOf": [ - { - "enum": ["plain"], - "title": "Evaluate 'left' as plain text." - }, - { - "enum": ["liquid"], - "title": "Evaluate 'left' as liquid." - } - ] - }, - "right_type": { - "description": "How to evaluate 'right'", - "type": "string", - "default": "plain", - "oneOf": [ - { - "enum": ["plain"], - "title": "Evaluate 'right' as plain text." - }, - { - "enum": ["liquid"], - "title": "Evaluate 'right' as liquid." - } - ] - } - }, - "required": ["left", "op", "right"] - }, - "condition": { - "type": "object", - "description": "Condition to be evaluated", - "properties": { - "operations": { - "type": "array", - "items": { - "$ref": "#/definitions/operation" - }, - "minItems": 1 - }, - "combine_op": { - "type": "string", - "enum": ["and", "or"], - "default": "and" - } - } - } - }, - "properties": { - "condition": { - "$ref": "#/definitions/condition" - }, - "policy_chain": { - "description": "The policy chain to execute when the condition is true", - "type": "array", - "items": { - "type": "object" - } - } - }, - "required": ["condition"] - } -}