From 7eaf103ba85f5c742d561f499aed392c2dea9639 Mon Sep 17 00:00:00 2001 From: Sharad Regoti Date: Wed, 18 Dec 2024 13:32:32 +0530 Subject: [PATCH 1/5] Fixes --- .../plugins/bundles/bundle-cli.md | 21 +++++++++++-------- 1 file changed, 12 insertions(+), 9 deletions(-) diff --git a/tyk-docs/content/product-stack/tyk-gateway/advanced-configurations/plugins/bundles/bundle-cli.md b/tyk-docs/content/product-stack/tyk-gateway/advanced-configurations/plugins/bundles/bundle-cli.md index e9224960d0..2ce7e18877 100644 --- a/tyk-docs/content/product-stack/tyk-gateway/advanced-configurations/plugins/bundles/bundle-cli.md +++ b/tyk-docs/content/product-stack/tyk-gateway/advanced-configurations/plugins/bundles/bundle-cli.md @@ -57,17 +57,22 @@ To create plugin bundles you will need the following: A suggested directory structure is shown below for Golang, Javascript and Python bundles in the tabs below. -In this case, the `manifest.json` will reference the Python files located in the plugins subdirectory, ensuring the +In this case, the `manifest.json` will reference the Python files located in the `bundle-directory`, ensuring the Python plugin source files are organized relative to the manifest. The Tyk Gateway will load and execute these Python plugins based on the paths defined in the `manifest.json` file. +{{< note success >}} +**Note** + +Subdirectory are not supported in the `bundle-directory` +{{< /note >}} + {{< tabs_start >}} {{< tab_start "Golang" >}} ```bash /bundle-directory ├── manifest.json # Manifest file with plugin references -└── /plugins # Subdirectory containing compiled plugin - └── plugin.so # Compiled Golang plugin +└── plugin.so # Compiled Golang plugin ``` {{< tab_end >}} {{< tab_start "Javascript" >}} @@ -75,9 +80,8 @@ plugins based on the paths defined in the `manifest.json` file. ```bash /bundle-directory ├── manifest.json # Manifest file with plugin references -└── /plugins # Subdirectory containing source files - ├── plugin1.js # First JavaScript plugin source file - └── plugin2.js # Second JavaScript plugin source file +├── plugin1.js # First JavaScript plugin source file +└── plugin2.js # Second JavaScript plugin source file ``` {{< tab_end >}} @@ -87,9 +91,8 @@ plugins based on the paths defined in the `manifest.json` file. ```bash /bundle-directory ├── manifest.json # Manifest file with plugin references -└── /plugins # Subdirectory containing source files - ├── plugin1.py # First Python plugin source file - └── plugin2.py # Second Python plugin source file +├── plugin1.py # First Python plugin source file +└── plugin2.py # Second Python plugin source file ``` {{< tab_end >}} From 0696f01ec31680aab4c17910d97b555cb7179b69 Mon Sep 17 00:00:00 2001 From: Sharad Regoti Date: Wed, 18 Dec 2024 13:40:18 +0530 Subject: [PATCH 2/5] Fixes --- .../advanced-configurations/plugins/bundles/bundle-cli.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tyk-docs/content/product-stack/tyk-gateway/advanced-configurations/plugins/bundles/bundle-cli.md b/tyk-docs/content/product-stack/tyk-gateway/advanced-configurations/plugins/bundles/bundle-cli.md index 2ce7e18877..da1a3f2c08 100644 --- a/tyk-docs/content/product-stack/tyk-gateway/advanced-configurations/plugins/bundles/bundle-cli.md +++ b/tyk-docs/content/product-stack/tyk-gateway/advanced-configurations/plugins/bundles/bundle-cli.md @@ -57,7 +57,7 @@ To create plugin bundles you will need the following: A suggested directory structure is shown below for Golang, Javascript and Python bundles in the tabs below. -In this case, the `manifest.json` will reference the Python files located in the `bundle-directory`, ensuring the +In this case, the `manifest.json` will reference the Python files located in the `bundle-directory`, ensure Python plugin source files are organized relative to the manifest. The Tyk Gateway will load and execute these Python plugins based on the paths defined in the `manifest.json` file. From 451b0877556431a4ae8acde417f9eb9df4e002a1 Mon Sep 17 00:00:00 2001 From: Sharad Regoti Date: Tue, 7 Jan 2025 19:04:33 +0530 Subject: [PATCH 3/5] Incorporated Suggestions --- .../plugins/bundles/bundle-cli.md | 99 ++++++++++++++++++- 1 file changed, 95 insertions(+), 4 deletions(-) diff --git a/tyk-docs/content/product-stack/tyk-gateway/advanced-configurations/plugins/bundles/bundle-cli.md b/tyk-docs/content/product-stack/tyk-gateway/advanced-configurations/plugins/bundles/bundle-cli.md index da1a3f2c08..25870914bb 100644 --- a/tyk-docs/content/product-stack/tyk-gateway/advanced-configurations/plugins/bundles/bundle-cli.md +++ b/tyk-docs/content/product-stack/tyk-gateway/advanced-configurations/plugins/bundles/bundle-cli.md @@ -57,10 +57,6 @@ To create plugin bundles you will need the following: A suggested directory structure is shown below for Golang, Javascript and Python bundles in the tabs below. -In this case, the `manifest.json` will reference the Python files located in the `bundle-directory`, ensure -Python plugin source files are organized relative to the manifest. The Tyk Gateway will load and execute these Python -plugins based on the paths defined in the `manifest.json` file. - {{< note success >}} **Note** @@ -99,6 +95,101 @@ Subdirectory are not supported in the `bundle-directory` {{< tabs_end >}} +The `manifest.json` will reference the files located in the `bundle-directory`, ensure plugin source files are organized relative to the manifest. The Tyk Gateway will load and execute these +plugins based on the paths defined in the `manifest.json` file. + +Sample `manifest.json` is shown below for Golang, Javascript and Python bundles in the tabs below. + +{{< tabs_start >}} {{< tab_start "Golang" >}} + +```json +{ + "file_list": [ + "plugin.so" + ], + "custom_middleware": { + "pre": [ + { + "name": "PreMiddleware", + "path": "./plugin.so" + } + ], + "post": [ + { + "name": "PostMiddleware", + "path": "./plugin.so" + } + ], + "driver": "goplugin" + }, + "checksum": "", + "signature": "" +} + +``` + +{{< tab_end >}} {{< tab_start "Javascript" >}} + +```json +{ + "file_list": [ + "plugin1.js", + "plugin2.js" + ], + "custom_middleware": { + "pre": [ + { + "name": "PreMiddleware", + "path": "./plugin1.js" + } + ], + "post": [ + { + "name": "PostMiddleware", + "path": "./plugin2.js" + } + ], + "driver": "otto" + }, + "checksum": "", + "signature": "" +} +``` + +{{< tab_end >}} + +{{< tab_start "Python" >}} + +```json +{ + "file_list": [ + "plugin1.py", + "plugin2.py" + ], + "custom_middleware": { + "pre": [ + { + "name": "PreMiddleware", + "path": "./plugin1.py" + } + ], + "post": [ + { + "name": "PostMiddleware", + "path": "./plugin2.py" + } + ], + "driver": "python" + }, + "checksum": "", + "signature": "" +} +``` + +{{< tab_end >}} + +{{< tabs_end >}} + --- ## Creating a plugin bundle From 5a8b6630d6c8bd669ad3a0b8bc9860498cca3069 Mon Sep 17 00:00:00 2001 From: Master Date: Wed, 8 Jan 2025 10:46:19 +0530 Subject: [PATCH 4/5] Update tyk-docs/content/product-stack/tyk-gateway/advanced-configurations/plugins/bundles/bundle-cli.md Co-authored-by: Tit Petric --- .../advanced-configurations/plugins/bundles/bundle-cli.md | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/tyk-docs/content/product-stack/tyk-gateway/advanced-configurations/plugins/bundles/bundle-cli.md b/tyk-docs/content/product-stack/tyk-gateway/advanced-configurations/plugins/bundles/bundle-cli.md index 25870914bb..182bd44d34 100644 --- a/tyk-docs/content/product-stack/tyk-gateway/advanced-configurations/plugins/bundles/bundle-cli.md +++ b/tyk-docs/content/product-stack/tyk-gateway/advanced-configurations/plugins/bundles/bundle-cli.md @@ -95,8 +95,7 @@ Subdirectory are not supported in the `bundle-directory` {{< tabs_end >}} -The `manifest.json` will reference the files located in the `bundle-directory`, ensure plugin source files are organized relative to the manifest. The Tyk Gateway will load and execute these -plugins based on the paths defined in the `manifest.json` file. +The `manifest.json` will reference the files located in the `bundle-directory`, ensure plugin source files are organized relative to the manifest. The Tyk Gateway will load and execute these plugins based on the paths defined in the `manifest.json` file. Sample `manifest.json` is shown below for Golang, Javascript and Python bundles in the tabs below. From 6b62502bf8ee72e0c51e1d0ce6b62d34922d8ec6 Mon Sep 17 00:00:00 2001 From: Master Date: Wed, 8 Jan 2025 10:46:36 +0530 Subject: [PATCH 5/5] Update tyk-docs/content/product-stack/tyk-gateway/advanced-configurations/plugins/bundles/bundle-cli.md Co-authored-by: Tit Petric --- .../advanced-configurations/plugins/bundles/bundle-cli.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tyk-docs/content/product-stack/tyk-gateway/advanced-configurations/plugins/bundles/bundle-cli.md b/tyk-docs/content/product-stack/tyk-gateway/advanced-configurations/plugins/bundles/bundle-cli.md index 182bd44d34..e4617135c0 100644 --- a/tyk-docs/content/product-stack/tyk-gateway/advanced-configurations/plugins/bundles/bundle-cli.md +++ b/tyk-docs/content/product-stack/tyk-gateway/advanced-configurations/plugins/bundles/bundle-cli.md @@ -60,7 +60,8 @@ A suggested directory structure is shown below for Golang, Javascript and Python {{< note success >}} **Note** -Subdirectory are not supported in the `bundle-directory` +Sub-directories (folders) are not supported inside the `bundle-directory` location. + {{< /note >}} {{< tabs_start >}} {{< tab_start "Golang" >}}