From d4e426f65f7e39128aa03b410236fa1d2a4e5abf Mon Sep 17 00:00:00 2001 From: David Ortiz Date: Wed, 28 Feb 2018 11:58:54 +0100 Subject: [PATCH 1/4] policy/manifest-schema: add summary to the properties --- gateway/src/apicast/policy/manifest-schema.json | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/gateway/src/apicast/policy/manifest-schema.json b/gateway/src/apicast/policy/manifest-schema.json index e483dda0a..e95e5f539 100644 --- a/gateway/src/apicast/policy/manifest-schema.json +++ b/gateway/src/apicast/policy/manifest-schema.json @@ -31,6 +31,16 @@ ], "minLength": 1 }, + "summary": { + "$id": "/properties/summary", + "type": "string", + "title": "The Policy Summary", + "description": "Short description of what the policy does", + "examples": [ + "Enables CORS (Cross Origin Resource Sharing) request handling." + ], + "maxLength": 75 + }, "description": { "$id": "/properties/description", "oneOf": [ From e14ce958964a6e382a010c914f7bc577a368f0bd Mon Sep 17 00:00:00 2001 From: David Ortiz Date: Wed, 28 Feb 2018 12:06:53 +0100 Subject: [PATCH 2/4] policy/manifests: do not include 'policy' in names It is redundant, all of them are policies. --- gateway/src/apicast/policy/apicast/apicast-policy.json | 2 +- gateway/src/apicast/policy/caching/apicast-policy.json | 2 +- gateway/src/apicast/policy/cors/apicast-policy.json | 2 +- gateway/src/apicast/policy/echo/apicast-policy.json | 2 +- gateway/src/apicast/policy/headers/apicast-policy.json | 2 +- gateway/src/apicast/policy/soap/apicast-policy.json | 2 +- gateway/src/apicast/policy/upstream/apicast-policy.json | 2 +- gateway/src/apicast/policy/url_rewriting/apicast-policy.json | 2 +- 8 files changed, 8 insertions(+), 8 deletions(-) diff --git a/gateway/src/apicast/policy/apicast/apicast-policy.json b/gateway/src/apicast/policy/apicast/apicast-policy.json index ef9c49f29..6c0c38dab 100644 --- a/gateway/src/apicast/policy/apicast/apicast-policy.json +++ b/gateway/src/apicast/policy/apicast/apicast-policy.json @@ -1,6 +1,6 @@ { "$schema": "http://apicast.io/policy-v1/schema#manifest#", - "name": "APIcast policy", + "name": "APIcast", "description": "Main functionality of APIcast.", "version": "builtin", "configuration": { diff --git a/gateway/src/apicast/policy/caching/apicast-policy.json b/gateway/src/apicast/policy/caching/apicast-policy.json index 440163ea6..39ec4992b 100644 --- a/gateway/src/apicast/policy/caching/apicast-policy.json +++ b/gateway/src/apicast/policy/caching/apicast-policy.json @@ -1,6 +1,6 @@ { "$schema": "http://apicast.io/policy-v1/schema#manifest#", - "name": "Caching policy", + "name": "Caching", "description": ["Configures a cache for the authentication calls against the 3scale ", "backend. This policy support three kinds of caching: \n", diff --git a/gateway/src/apicast/policy/cors/apicast-policy.json b/gateway/src/apicast/policy/cors/apicast-policy.json index 705e8eae1..f16e4fab5 100644 --- a/gateway/src/apicast/policy/cors/apicast-policy.json +++ b/gateway/src/apicast/policy/cors/apicast-policy.json @@ -1,6 +1,6 @@ { "$schema": "http://apicast.io/policy-v1/schema#manifest#", - "name": "CORS policy", + "name": "CORS", "description": "This policy enables CORS (Cross Origin Resource Sharing) request handling.", "version": "builtin", "configuration": { diff --git a/gateway/src/apicast/policy/echo/apicast-policy.json b/gateway/src/apicast/policy/echo/apicast-policy.json index 727543d1d..e5da5ec7a 100644 --- a/gateway/src/apicast/policy/echo/apicast-policy.json +++ b/gateway/src/apicast/policy/echo/apicast-policy.json @@ -1,6 +1,6 @@ { "$schema": "http://apicast.io/policy-v1/schema#manifest#", - "name": "Echo policy", + "name": "Echo", "description": ["This policy prints the request back to the client and optionally sets ", "a status code."], diff --git a/gateway/src/apicast/policy/headers/apicast-policy.json b/gateway/src/apicast/policy/headers/apicast-policy.json index 6e0124956..83bba10a3 100644 --- a/gateway/src/apicast/policy/headers/apicast-policy.json +++ b/gateway/src/apicast/policy/headers/apicast-policy.json @@ -1,6 +1,6 @@ { "$schema": "http://apicast.io/policy-v1/schema#manifest#", - "name": "Headers policy", + "name": "Headers", "description": ["This policy allows to include custom headers that will be sent to the ", "upstream as well as modify or delete the ones included in the original ", diff --git a/gateway/src/apicast/policy/soap/apicast-policy.json b/gateway/src/apicast/policy/soap/apicast-policy.json index eb1484eb0..9a5f4522c 100644 --- a/gateway/src/apicast/policy/soap/apicast-policy.json +++ b/gateway/src/apicast/policy/soap/apicast-policy.json @@ -1,6 +1,6 @@ { "$schema": "http://apicast.io/policy-v1/schema#manifest#", - "name": "SOAP policy", + "name": "SOAP", "description": ["This policy adds support for a very small subset of SOAP. \n", "It expects a SOAP action URI in the SOAPAction header or the Content-Type ", diff --git a/gateway/src/apicast/policy/upstream/apicast-policy.json b/gateway/src/apicast/policy/upstream/apicast-policy.json index c97abec67..e2288a1e7 100644 --- a/gateway/src/apicast/policy/upstream/apicast-policy.json +++ b/gateway/src/apicast/policy/upstream/apicast-policy.json @@ -1,6 +1,6 @@ { "$schema": "http://apicast.io/policy-v1/schema#manifest#", - "name": "Upstream policy", + "name": "Upstream", "description": "This policy allows to modify the host of a request based on its path.", "version": "builtin", "configuration": { diff --git a/gateway/src/apicast/policy/url_rewriting/apicast-policy.json b/gateway/src/apicast/policy/url_rewriting/apicast-policy.json index 6f8ea21fe..32d4fa3bb 100644 --- a/gateway/src/apicast/policy/url_rewriting/apicast-policy.json +++ b/gateway/src/apicast/policy/url_rewriting/apicast-policy.json @@ -1,6 +1,6 @@ { "$schema": "http://apicast.io/policy-v1/schema#manifest#", - "name": "URL rewriting policy", + "name": "URL rewriting", "description": ["This policy allows to modify the path of a request. ", "The operations supported are sub and gsub based on ngx.re.sub and ", From 22b72c0198bf14987e27f178f17aae6b135fd7f5 Mon Sep 17 00:00:00 2001 From: David Ortiz Date: Wed, 28 Feb 2018 12:33:06 +0100 Subject: [PATCH 3/4] policy/manifests: include summaries Also, expand a bit descriptions that were as short as a summary. --- gateway/src/apicast/policy/apicast/apicast-policy.json | 6 +++++- gateway/src/apicast/policy/caching/apicast-policy.json | 1 + gateway/src/apicast/policy/cors/apicast-policy.json | 6 +++++- gateway/src/apicast/policy/echo/apicast-policy.json | 1 + gateway/src/apicast/policy/headers/apicast-policy.json | 1 + gateway/src/apicast/policy/soap/apicast-policy.json | 1 + gateway/src/apicast/policy/upstream/apicast-policy.json | 6 +++++- .../src/apicast/policy/url_rewriting/apicast-policy.json | 1 + 8 files changed, 20 insertions(+), 3 deletions(-) diff --git a/gateway/src/apicast/policy/apicast/apicast-policy.json b/gateway/src/apicast/policy/apicast/apicast-policy.json index 6c0c38dab..e9ed1bc53 100644 --- a/gateway/src/apicast/policy/apicast/apicast-policy.json +++ b/gateway/src/apicast/policy/apicast/apicast-policy.json @@ -1,7 +1,11 @@ { "$schema": "http://apicast.io/policy-v1/schema#manifest#", "name": "APIcast", - "description": "Main functionality of APIcast.", + "summary": "Main functionality of APIcast to work with the 3scale API manager.", + "description": + ["Main functionality of APIcast to work with the 3scale API ", + "manager. This includes matching of mapping rules, authorization, ", + "reporting, etc."], "version": "builtin", "configuration": { "type": "object", diff --git a/gateway/src/apicast/policy/caching/apicast-policy.json b/gateway/src/apicast/policy/caching/apicast-policy.json index 39ec4992b..12a45ead8 100644 --- a/gateway/src/apicast/policy/caching/apicast-policy.json +++ b/gateway/src/apicast/policy/caching/apicast-policy.json @@ -1,6 +1,7 @@ { "$schema": "http://apicast.io/policy-v1/schema#manifest#", "name": "Caching", + "summary": "Controls how to cache authorizations returned by the 3scale backend.", "description": ["Configures a cache for the authentication calls against the 3scale ", "backend. This policy support three kinds of caching: \n", diff --git a/gateway/src/apicast/policy/cors/apicast-policy.json b/gateway/src/apicast/policy/cors/apicast-policy.json index f16e4fab5..0e64f2206 100644 --- a/gateway/src/apicast/policy/cors/apicast-policy.json +++ b/gateway/src/apicast/policy/cors/apicast-policy.json @@ -1,7 +1,11 @@ { "$schema": "http://apicast.io/policy-v1/schema#manifest#", "name": "CORS", - "description": "This policy enables CORS (Cross Origin Resource Sharing) request handling.", + "summary": "Enables CORS (Cross Origin Resource Sharing) request handling.", + "description": + ["This policy enables CORS (Cross Origin Resource Sharing) request ", + "handling. It allows to define CORS headers such as ", + "Access-Control-Allow-Headers, Access-Control-Allow-Methods, etc."], "version": "builtin", "configuration": { "type": "object", diff --git a/gateway/src/apicast/policy/echo/apicast-policy.json b/gateway/src/apicast/policy/echo/apicast-policy.json index e5da5ec7a..7055aafdc 100644 --- a/gateway/src/apicast/policy/echo/apicast-policy.json +++ b/gateway/src/apicast/policy/echo/apicast-policy.json @@ -1,6 +1,7 @@ { "$schema": "http://apicast.io/policy-v1/schema#manifest#", "name": "Echo", + "summary": "Prints the request back to the client and optionally sets a status code.", "description": ["This policy prints the request back to the client and optionally sets ", "a status code."], diff --git a/gateway/src/apicast/policy/headers/apicast-policy.json b/gateway/src/apicast/policy/headers/apicast-policy.json index 83bba10a3..739685115 100644 --- a/gateway/src/apicast/policy/headers/apicast-policy.json +++ b/gateway/src/apicast/policy/headers/apicast-policy.json @@ -1,6 +1,7 @@ { "$schema": "http://apicast.io/policy-v1/schema#manifest#", "name": "Headers", + "summary": "Allows to include custom headers.", "description": ["This policy allows to include custom headers that will be sent to the ", "upstream as well as modify or delete the ones included in the original ", diff --git a/gateway/src/apicast/policy/soap/apicast-policy.json b/gateway/src/apicast/policy/soap/apicast-policy.json index 9a5f4522c..02c899c45 100644 --- a/gateway/src/apicast/policy/soap/apicast-policy.json +++ b/gateway/src/apicast/policy/soap/apicast-policy.json @@ -1,6 +1,7 @@ { "$schema": "http://apicast.io/policy-v1/schema#manifest#", "name": "SOAP", + "summary": "Adds support for a small subset of SOAP.", "description": ["This policy adds support for a very small subset of SOAP. \n", "It expects a SOAP action URI in the SOAPAction header or the Content-Type ", diff --git a/gateway/src/apicast/policy/upstream/apicast-policy.json b/gateway/src/apicast/policy/upstream/apicast-policy.json index e2288a1e7..45ffaaea3 100644 --- a/gateway/src/apicast/policy/upstream/apicast-policy.json +++ b/gateway/src/apicast/policy/upstream/apicast-policy.json @@ -1,7 +1,11 @@ { "$schema": "http://apicast.io/policy-v1/schema#manifest#", "name": "Upstream", - "description": "This policy allows to modify the host of a request based on its path.", + "summary": "Allows to modify the host of a request based on its path.", + "description": + ["This policy allows to modify the host of a request based on its path. ", + "It accepts regular expressions that, when matched against the path, ", + "replace it with a given string."], "version": "builtin", "configuration": { "type": "object", diff --git a/gateway/src/apicast/policy/url_rewriting/apicast-policy.json b/gateway/src/apicast/policy/url_rewriting/apicast-policy.json index 32d4fa3bb..a7b3f2f54 100644 --- a/gateway/src/apicast/policy/url_rewriting/apicast-policy.json +++ b/gateway/src/apicast/policy/url_rewriting/apicast-policy.json @@ -1,6 +1,7 @@ { "$schema": "http://apicast.io/policy-v1/schema#manifest#", "name": "URL rewriting", + "summary": "Allows to modify the path of a request.", "description": ["This policy allows to modify the path of a request. ", "The operations supported are sub and gsub based on ngx.re.sub and ", From 58d88d860486c3a3a1c5bb0e562699536be40a24 Mon Sep 17 00:00:00 2001 From: David Ortiz Date: Wed, 28 Feb 2018 12:47:16 +0100 Subject: [PATCH 4/4] CHANGELOG: add entry log for summary property in policy manifests --- CHANGELOG.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 9d223e16e..1da810f75 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,10 @@ and this project adheres to [Semantic Versioning](http://semver.org/). ## [Unreleased] +## Added + +- New property `summary` in the policy manifests [PR #633](https://github.com/3scale/apicast/pull/633) + ## Fixed - Error loading policy chain configuration JSON with null value [PR #626](https://github.com/3scale/apicast/pull/626)