{"id":20632673,"url":"https://github.com/acm-uiuc/groot-api-gateway","last_synced_at":"2025-04-15T19:03:35.059Z","repository":{"id":31031804,"uuid":"34590384","full_name":"acm-uiuc/groot-api-gateway","owner":"acm-uiuc","description":"API Gateway for the Groot project written in Arbor","archived":false,"fork":false,"pushed_at":"2018-11-13T06:18:27.000Z","size":174,"stargazers_count":12,"open_issues_count":3,"forks_count":2,"subscribers_count":37,"default_branch":"master","last_synced_at":"2025-03-28T23:51:16.092Z","etag":null,"topics":["api-gateway","arbor","groot","proxy"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/acm-uiuc.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}},"created_at":"2015-04-25T23:33:53.000Z","updated_at":"2022-02-28T04:00:11.000Z","dependencies_parsed_at":"2022-08-24T12:10:33.409Z","dependency_job_id":null,"html_url":"https://github.com/acm-uiuc/groot-api-gateway","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/acm-uiuc%2Fgroot-api-gateway","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/acm-uiuc%2Fgroot-api-gateway/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/acm-uiuc%2Fgroot-api-gateway/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/acm-uiuc%2Fgroot-api-gateway/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/acm-uiuc","download_url":"https://codeload.github.com/acm-uiuc/groot-api-gateway/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":249135822,"owners_count":21218365,"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","arbor","groot","proxy"],"created_at":"2024-11-16T14:17:00.145Z","updated_at":"2025-04-15T19:03:35.026Z","avatar_url":"https://github.com/acm-uiuc.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# GROOT\n\n[![Build Status](https://travis-ci.org/acm-uiuc/groot-api-gateway.svg?branch=master)](https://travis-ci.org/acm-uiuc/groot-api-gateway)\n\nThis repo contains the API Gateway written in Fall of 2015\nIt provides the following capabilities:\n  * Easy registration of services\n  * Universal Authentication for the entire application - via an external authentication provided (Atlassian crowd)\n  * Proxying API calls\n  * Managing inter-service communication\n\nWhen registering as service specify the data encoding and when requesting a resource though groot make the request using json.\n\n[![Join the chat at https://acm-uiuc.slack.com/messages/C6XGZD212/](https://img.shields.io/badge/slack-groot-724D71.svg)](https://acm-uiuc.slack.com/messages/C6XGZD212/)\n\n\n\n\n## RUNNING GROOT\n\nAdd the API spec in a new file (ex. todo.go) in the services package\n\nThere is a set of proxy api calls defined by the Arbor framework which the API Gateway is written in. \n\nAS OF 4/24/17\n```go\n/**\n *  Pass the http Request from the client and the ResponseWriter it expects\n *  Pass the target url of the backend service (not the url the client called)\n *  Pass the format of the service\n *  Pass a authorization token (optional)\n *  Will call the service and return the result to the client.\n **/\n arbor.GET(w http.ResponseWriter, url string, format string, token string, r *http.Request)\n```\n```go\n /**\n  *  Pass the http Request from the client and the ResponseWriter it expects\n  *  Pass the target url of the backend service (not the url the client called)\n  *  Passes the encoded json(only format currently supported) to the service.\n  *  Pass a authorization token (optional)\n  *  Will call the service and return the result to the client.\n  **/\n  arbor.POST(w http.ResponseWriter, url string, format string, token string, r *http.Request)\n```\n```go\n /**\n  *  Pass the http Request from the client and the ResponseWriter it expects\n  *  Pass the target url of the backend service (not the url the client called)\n  *  Passes the encoded json(only format currently supported) to the service.\n  *  Pass a authorization token (optional)\n  *  Will call the service and return the result to the client.\n  **/\n  arbor.PUT(w http.ResponseWriter, url string, format string, token string, r *http.Request)\n```\n```go\n/**\n *  Pass the http Request from the client and the ResponseWriter it expects\n *  Pass the target url of the backend service (not the url the client called)\n *  Pass a authorization token (optional)\n *  Will call the service and return the result to the client.\n **/\n arbor.DELETE(w http.ResponseWriter, url string, format string, token string, r *http.Request)\n```\n\nAll secret data should be kept in a file called config.go in the config directory\n\nMake sure you have go dependencey management installed \n\n```\ngo get github.com/golang/dep/...\n```\n\nInstall Dependencies [First time setup]\n\n```sh\ndep ensure \n```\n\nCompile the service \n\n```sh\n./build.sh\n```\n\n## CLI \n```sh\ngroot-api-gateway [-r | --register-client client_name] [-c | --check-registration token] [-u | --unsecured]\n```\n\n-r | --register-client *client_name*\n\u003e registers a client, generates a token\n\n-c | --check-registration *token*\n\u003e checks if a token is valid and returns name of client\n\n-u | --unsecured\n\u003e runs groot without the security layer \n\n*without args* \n\u003e runs groot with the security layer\n\n\n## Docker\n\n#### Creating a client key:\n```\ndocker-compose run groot-api-gateway ./build/groot-api-gateway -r \u003cclient_name\u003e\n```\n\n#### Checking a client key: \n```\ndocker-compose run groot-api-gateway ./build/groot-api-gateway -c \u003cclient_key\u003e\n```\n\n#### Config Values\nTo allow all services to work with the docker network, make sure to set these values in `config.go`:\n```go\n//Service hosts\nconst CreditsURL = \"http://groot-credits-service:8765\"\nconst EventsURL = \"http://groot-events-service:8002\"\nconst GigsURL = \"http://groot-gigs-service:8964\"\nconst GroupsURL = \"http://groot-groups-service:9001\"\nconst HardwareURL = \"http://groot:4523/api/v1.0\"\nconst MemesURL = \"http://groot-meme-service:42069\"\nconst MerchURL = \"http://groot-merch-service:6969\"\nconst QuotesURL = \"http://groot-quotes-service:9494\"\nconst RecruiterURL = \"http://groot-recruiters-service:4567\"\nconst UsersURL = \"http://groot-users-service:8001\"\n\n//Arbor configurations\nfunc LoadArborConfig() {\n    security.AccessLogLocation = \"/var/groot-api-gateway/access.log\"\n    security.ClientRegistryLocation = \"/var/groot-api-gateway/clients.db\"\n    proxy.AccessControlPolicy = \"*\"\n}\n```\n\n## License\n\nThis project is licensed under the University of Illinois/NCSA Open Source License. For a full copy of this license take a look at the LICENSE file. \n\nWhen contributing new files to this project, preappend the following header to the file as a comment: \n\n```\nCopyright © 2017, ACM@UIUC\n\nThis file is part of the Groot Project.  \n \nThe Groot Project is open source software, released under the University of Illinois/NCSA Open Source License. \nYou should have received a copy of this license in a file with the distribution.\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Facm-uiuc%2Fgroot-api-gateway","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Facm-uiuc%2Fgroot-api-gateway","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Facm-uiuc%2Fgroot-api-gateway/lists"}