{"id":13703074,"url":"https://github.com/stone-payments/kong-plugin-template-transformer","last_synced_at":"2026-06-05T08:31:08.305Z","repository":{"id":33821713,"uuid":"128990988","full_name":"stone-payments/kong-plugin-template-transformer","owner":"stone-payments","description":" Kong API Gateway plugin to transform requests with Lua templates","archived":false,"fork":false,"pushed_at":"2026-05-26T18:19:43.000Z","size":362,"stargazers_count":1,"open_issues_count":5,"forks_count":0,"subscribers_count":11,"default_branch":"main","last_synced_at":"2026-05-26T20:13:41.759Z","etag":null,"topics":["api-gateway","kong","kong-plugin","lua","satisfacao-do-cliente","sec-alianca-paymentsschemes","sec-owner-brunosantos","sec-squad-apigateway","sec-tribo-apisfinanceiras"],"latest_commit_sha":null,"homepage":"","language":"Lua","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/stone-payments.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":".github/CODEOWNERS","security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2018-04-10T20:27:13.000Z","updated_at":"2026-05-26T18:19:48.000Z","dependencies_parsed_at":"2023-11-27T18:28:25.186Z","dependency_job_id":"ba566e45-e378-4384-adce-3c8104252b3a","html_url":"https://github.com/stone-payments/kong-plugin-template-transformer","commit_stats":null,"previous_names":[],"tags_count":30,"template":false,"template_full_name":null,"purl":"pkg:github/stone-payments/kong-plugin-template-transformer","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stone-payments%2Fkong-plugin-template-transformer","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stone-payments%2Fkong-plugin-template-transformer/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stone-payments%2Fkong-plugin-template-transformer/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stone-payments%2Fkong-plugin-template-transformer/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/stone-payments","download_url":"https://codeload.github.com/stone-payments/kong-plugin-template-transformer/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stone-payments%2Fkong-plugin-template-transformer/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33937661,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-05T02:00:06.157Z","response_time":120,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["api-gateway","kong","kong-plugin","lua","satisfacao-do-cliente","sec-alianca-paymentsschemes","sec-owner-brunosantos","sec-squad-apigateway","sec-tribo-apisfinanceiras"],"created_at":"2024-08-02T21:00:49.947Z","updated_at":"2026-06-05T08:31:08.289Z","avatar_url":"https://github.com/stone-payments.png","language":"Lua","funding_links":[],"categories":["Transformations"],"sub_categories":[],"readme":"# Kong-plugin-template-transformer\n\n[![Build Status](https://travis-ci.org/stone-payments/kong-plugin-template-transformer.svg?branch=master)](https://travis-ci.org/stone-payments/kong-plugin-template-transformer)\n\nThis is a Kong middleware to transform requests / responses, using pre-configured templates. This plugin has been tested to work along with kong \u003e= 2.6.x, for a legacy version of this plugin, please check [this link](https://github.com/stone-payments/kong-plugin-template-transformer/tree/legacy/v0).\n\n## The Problem\n\nWhen using Kong, you can create routes that proxy to an upstream. The problem lies when the upstream has an ugly response/request contract. Sometimes the [kong bundled request transformer](https://docs.konghq.com/hub/kong-inc/request-transformer/) is not enough. This plugin was created for those situations, it can apply a [template](https://github.com/bungle/lua-resty-template) to JSON requests and responses, transforming them pretty much however you like.\n\n## Project Structure\n\nThe plugin folder should contain at least a `schema.lua` and a `handler.lua`, alongside with a `spec` folder and a `.rockspec` file specifying the current version of the package.\n\n## Writing Templates\n\nWe use [lua-resty-template](https://github.com/bungle/lua-resty-template) to write templates. It's also **very important** that you don't leave any `\\t` in the files. We also only support JSON requests and responses for now.\n\n## Examples\n\nInside `kong-plugin-template-transformer/template-transformer/validator/json/examples` you'll find some examples for json templates and request files.\n\n## Rockspec Format\n\nThe `.rockspec` file should follow [LuaRocks' conventions](https://github.com/luarocks/luarocks/wiki/Rockspec-format)\n\n## Configuration\n\n### Enabling the plugin on a Route\n\nConfigure this plugin on a Route with:\n\n```bash\ncurl -X POST http://kong:8001/routes/{route_id}/plugins \\\n    --data \"name=kong-plugin-template-transformer\"  \\\n    --data \"config.request_template=http://new-url.com\"\n    --data \"config.response_template=http://new-url.com\"\n    --data \"config.hidden_fields=http://new-url.com\"\n```\n\n- route_id: the id of the Route that this plugin configuration will target.\n- config.request_template: Optional, the template to be applied before proxying to the upstream.\n- config.response_template: Optional, the template to be applied before returning to the client.\n- config.hidden_fields: Optional, a list of request or response fields that you do not want Kong to save them in a log file.\n\n## Developing\n\n### In docker\n\n```bash\ndocker build . -t kong-plugin-template-transformer-dev\ndocker run -it -v ${PWD}/template-transformer:/template-transformer kong-plugin-template-transformer-dev bash\n```\n\n## Credits\n\nmade with :heart: by Stone Payments\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstone-payments%2Fkong-plugin-template-transformer","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fstone-payments%2Fkong-plugin-template-transformer","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstone-payments%2Fkong-plugin-template-transformer/lists"}