{"id":18291145,"url":"https://github.com/rhecosystemappeng/api-gator-dora-router","last_synced_at":"2025-08-04T17:38:22.158Z","repository":{"id":252389052,"uuid":"826714592","full_name":"RHEcosystemAppEng/api-gator-dora-router","owner":"RHEcosystemAppEng","description":"This repo contains a HTTP proxy for managing interactions between several APIGator instances for DORA regulation","archived":false,"fork":false,"pushed_at":"2024-08-12T10:44:45.000Z","size":40,"stargazers_count":0,"open_issues_count":0,"forks_count":1,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-02-15T02:15:17.848Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Go","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/RHEcosystemAppEng.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-07-10T08:32:41.000Z","updated_at":"2024-08-09T11:48:32.000Z","dependencies_parsed_at":"2024-12-22T23:33:23.048Z","dependency_job_id":null,"html_url":"https://github.com/RHEcosystemAppEng/api-gator-dora-router","commit_stats":null,"previous_names":["rhecosystemappeng/api-gator-dora-router"],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RHEcosystemAppEng%2Fapi-gator-dora-router","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RHEcosystemAppEng%2Fapi-gator-dora-router/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RHEcosystemAppEng%2Fapi-gator-dora-router/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RHEcosystemAppEng%2Fapi-gator-dora-router/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/RHEcosystemAppEng","download_url":"https://codeload.github.com/RHEcosystemAppEng/api-gator-dora-router/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247999840,"owners_count":21031044,"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":[],"created_at":"2024-11-05T14:13:21.276Z","updated_at":"2025-04-09T07:49:27.211Z","avatar_url":"https://github.com/RHEcosystemAppEng.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Exate APIGator Dora Router\nThis repository contains an HTTP proxy that receives an HTTP request from an\nAPIGator by Exate instance, forwards it to a list of APIGator instances, waits\nfor their responses, and filters the correct one to return it to the original\nrequester.\n\nThis behavior is designed to process information that may belong to other\ncountries and, depending on the laws and regulations of those countries, may be\nshared or not under specific conditions. Every APIGator instance assigned to a\ncountry must comply with the laws of the country in which it is configured.\nSince the requester is not aware of every law, this proxy will take the request,\nforward it to every APIGator instance, and retrieve the correct response if it\nexists.\n\nThis component was designed for running on container environmnets\n(K8s/Openshift) as a Stateless component.\n\n## How it works\nThe APIGatorDoraRouter follows the next steps for every incoming request:\n1. Loads the list of available APIGator instances and its properties from a INI\n   config file\n2. Receive HTTP request from the *Requester*.\n3. Forwards the HTTP request to every configured APIGator.\n    1. If there is no access token available for a specific APIGator instance,\n       or it's expired, obtains a new one and continues.\n    2. Sends the HTTP request to every APIGator instance (Multithreading)\n    3. Waits for every APIGator response.\n    4. Processes the responses looking for a correct one\n    5. Based on configuration, this router will use different strategies for\n       choosing the correct response. Check \n    6. If a correct response was found, returns its content as the response for\n       the *requester* who started the process.\n\n\n## Configuration\n### Response Evaluation method\nCurrently there are two supported ways for choosing the \"best\" response on the\nAPIGatorDoraRouter:\n1. First valid response. This method will return the first response with a\n   correct data structure. Example:\n   ```json\n   {\n     \"dataSet\": \"{\\n  \\\"employees\\\": {\\n    \\\"employee\\\": […]\\n  }\\n}\"\n   }\n\n   ```\n\n   *To choose this method, edit the `config.ini` file on `[router].score_function='basic'*\n\n2. DataSet with more fields decrypted. This method will choose the response\n   based on which one has more decrypted information by APIGator. It takes the\n   `restricted_text` field for identifying the crypted fields, and scores each\n   response. The one with higher score (less crypted data) will be returned.\n\n   *To choose this method, edit the `config.ini` file on `[router].score_function='percentage'*\n\n## Running on Local\nFor an fast try on local, use the Makefile for starting the DoraRouter:\n```sh\n# Starts on normal mode\nmake start\n\n# Starts on DEBUG mode for more verbose output\nmake start-debug\n```\n\n## Building\nEvery option for building and running this software is already defined on the\nMakefile:\n```sh\n# Building container image\nmake build-image\n\n# Pushing container image\nmake push\n```\n\n## Deployment on Openshift\nThe manifests for deploying the APIGator Dora Router on Openshift are available\non: `./manifests/deployment`\n```sh\noc new-project exate-dora-router\nCONFIG_FILE=\u003cYOUR_CONFIG_FILE ENV FILE\u003e\noc create configmap dora-router-config --from-file=$CONFIG_FILE\noc apply -f ./manifests/dora-router\n```\n\n## Code Docs\nFor generating docs about the code, use the following command:\n```sh\nmake docs\n```\n\n## Testing\nThere is a `scripts` folder on this repo which contains several scripts for\ntesting this component and its interaction with APIGator\n\nTest script for APIGator:\n```sh\n# Generic command\nbash ./scripts/test_gator.sh \u003cAPIGATOR_URL\u003e \u003cAPI_KEY\u003e \u003cCLIENT_ID\u003e \u003cCLIENT_SECRET\u003e \u003cPAYLOAD_FILE\u003e\n```\n\nTest script for APIGatorDoraRouter:\n```sh\n# Generic command\nbash ./scripts/test_router.sh \u003cROUTER_URL\u003e \u003cPAYLOAD_FILE\u003e\n\n# Example command\nbash ./scripts/test_router.sh http://localhost:8080/forward ./tests/payload_example.json\n```\n\n## Demo\nThis repo includes a script for demoing how the APIGatorDoraRouter works. Check\nthis [document](./demo/README.md) for more info.\n\n## License\nThis software is released and distributed under the [Apache 2.0\nLicense](./LICENSE).\n\n\n## Maintainers:\n* Alejandro Villegas (avillega@redhat.com)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frhecosystemappeng%2Fapi-gator-dora-router","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frhecosystemappeng%2Fapi-gator-dora-router","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frhecosystemappeng%2Fapi-gator-dora-router/lists"}