{"id":26164746,"url":"https://github.com/optum/kong-service-virtualization","last_synced_at":"2025-04-14T15:22:17.030Z","repository":{"id":48235764,"uuid":"144057434","full_name":"Optum/kong-service-virtualization","owner":"Optum","description":"Mock virtual API request and response pairs through Kong gateway","archived":false,"fork":false,"pushed_at":"2021-08-04T14:32:56.000Z","size":487,"stargazers_count":10,"open_issues_count":1,"forks_count":7,"subscribers_count":11,"default_branch":"master","last_synced_at":"2025-04-14T15:22:09.521Z","etag":null,"topics":["api-gateway","kong","optum"],"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/Optum.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2018-08-08T19:14:21.000Z","updated_at":"2023-07-20T15:30:35.000Z","dependencies_parsed_at":"2022-08-25T21:50:51.031Z","dependency_job_id":null,"html_url":"https://github.com/Optum/kong-service-virtualization","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Optum%2Fkong-service-virtualization","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Optum%2Fkong-service-virtualization/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Optum%2Fkong-service-virtualization/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Optum%2Fkong-service-virtualization/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Optum","download_url":"https://codeload.github.com/Optum/kong-service-virtualization/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248904658,"owners_count":21180839,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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","optum"],"created_at":"2025-03-11T15:40:04.791Z","updated_at":"2025-04-14T15:22:16.992Z","avatar_url":"https://github.com/Optum.png","language":"Lua","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Kong Service Virtualization\n## Overview\nThis plugin will enable mocking virtual API request and response pairs through Kong Gateway.\n\n## Explanation:\n\nkong-service-virtualization schema 'virtual_tests' args: \n```\n[\n     {\n           \"name\": \"TestCase1\",           \n           \"requestHttpMethod\": \"POST\",\n           \"requestHash\": \"0296217561490155228da9c17fc555cf9db82d159732f3206638c25f04a285c4\",\n           \"responseHttpStatus\": \"200\",\n           \"responseContentType\": \"application/json\",\n           \"response\": \"eyJtZXNzYWdlIjogIkEgQmlnIFN1Y2Nlc3MhIn0=\"\n    },\n    {         \n           \"name\": \"TestCase2\",           \n           \"requestHttpMethod\": \"GET\",\n           \"requestHash\": \"e2c319e4ef41706e2c0c1b266c62cad607a014c59597ba662bef6d10a0b64a32\",\n           \"responseHttpStatus\": \"200\",\n           \"responseContentType\": \"application/json\",\n           \"response\": \"eyJtZXNzYWdlIjogIkFub3RoZXIgU3VjY2VzcyEifQ==\"\n    } \n]\n```\n\nWhere TestCase1 and TestCase2 are the names of the virtual test cases and must be passed in as a header value:\n\nX-VirtualRequest: TestCase1\n\nor\n\nX-VirtualRequest: TestCase2\n\nThe 'requestHash' arg is a Sha256(HTTP Request as query parameters or HTTP Body)\nThe 'response' arg is a Base64 encoded format of the response HTTP Body.\n\nSo the above plugin equates to these sudo requests:\n\n```\nhttps://gateway.company.com/virtualtest\n\nPOST:\n{\n   \"virtual\": \"test\"\n}\nResponse : {\"message\": \"A Big Success!\"} as base64 encoded in plugin\n\nGET:\nhello=world\u0026service=virtualized\nResponse : {\"message\": \"Another Success!\"} as base4 encoded in plugin\n\n```\n\nIn the event you do not successfully match on request you will recieve a Sha256 comparison for you own personal debugging:\n```\nStatus Code: 404 Not Found\nContent-Length: 207\nContent-Type: application/json; charset=utf-8\n\n{\"message\":\"No virtual request match found, your request yeilded: 46c4b4caf0cc3a5a589cbc4e0f3cd0492985d5b889f19ebc11e5a5bd6454d20f expected 0296217561490155228da9c17fc555cf9db82d159732f3206638c25f04a285c4\"}\n```\n\nIf the test case specificed in the header does not match anything found stored within the plugin your error would be like so:\nPassing X-VirtualRequest: TestCase3 in header yeilds\n```\nStatus Code: 404 Not Found\nContent-Length: 49\nContent-Type: application/json; charset=utf-8\n\n{\"message\":\"No matching virtual request found!\"}\n```\n\n## Supported Kong Releases\nKong \u003e= 1.0\n\n## Installation\nRecommended:\n```\n$ luarocks install kong-service-virtualization\n```\n\nOptional\n```\n$ git clone https://github.com/Optum/kong-service-virtualization\n$ cd /path/to/kong/plugins/kong-service-virtualization\n$ luarocks make *.rockspec\n```\n\n## Maintainers\n[jeremyjpj0916](https://github.com/jeremyjpj0916)  \n[rsbrisci](https://github.com/rsbrisci)  \n\nFeel free to open issues, or refer to our Contribution Guidelines if you have any questions.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Foptum%2Fkong-service-virtualization","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Foptum%2Fkong-service-virtualization","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Foptum%2Fkong-service-virtualization/lists"}