{"id":37152017,"url":"https://github.com/gmirsky/test-rest-api","last_synced_at":"2026-01-14T17:57:25.985Z","repository":{"id":162278143,"uuid":"154365094","full_name":"gmirsky/test-rest-api","owner":"gmirsky","description":"Test ReST API","archived":false,"fork":false,"pushed_at":"2022-03-08T22:18:39.000Z","size":3460,"stargazers_count":0,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2024-11-15T04:43:03.164Z","etag":null,"topics":["container","docker","docker-image","golang","gorilla","mux","rest-api"],"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/gmirsky.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":"2018-10-23T16:56:09.000Z","updated_at":"2024-03-02T11:43:37.000Z","dependencies_parsed_at":null,"dependency_job_id":"f9e25c8d-cbdc-4f64-82a8-bdf509e3c02c","html_url":"https://github.com/gmirsky/test-rest-api","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/gmirsky/test-rest-api","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gmirsky%2Ftest-rest-api","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gmirsky%2Ftest-rest-api/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gmirsky%2Ftest-rest-api/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gmirsky%2Ftest-rest-api/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/gmirsky","download_url":"https://codeload.github.com/gmirsky/test-rest-api/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gmirsky%2Ftest-rest-api/sbom","scorecard":{"id":430796,"data":{"date":"2025-08-11","repo":{"name":"github.com/gmirsky/test-rest-api","commit":"28fd8d3c11e66cf960d20cd1667fc27b55a91e69"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":2.8,"checks":[{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Token-Permissions","score":-1,"reason":"No tokens found","details":null,"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"Dangerous-Workflow","score":-1,"reason":"no workflows found","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Code-Review","score":0,"reason":"Found 0/30 approved changesets -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"SAST","score":0,"reason":"no SAST tool detected","details":["Warn: no pull requests merged into dev branch"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"Vulnerabilities","score":10,"reason":"0 existing vulnerabilities detected","details":null,"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Info: FSF or OSI recognized license: Apache License 2.0: LICENSE:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Pinned-Dependencies","score":0,"reason":"dependency not pinned by hash detected -- score normalized to 0","details":["Warn: containerImage not pinned by hash: Dockerfile:1: pin your Docker image by updating golang:1.17.8-alpine to golang:1.17.8-alpine@sha256:95abb5d5c780126d12a63401acddc9fe0748fab7c5bd498f9961ed5736393049","Warn: containerImage not pinned by hash: Dockerfile:13: pin your Docker image by updating golang:1.17.8-alpine to golang:1.17.8-alpine@sha256:95abb5d5c780126d12a63401acddc9fe0748fab7c5bd498f9961ed5736393049","Warn: goCommand not pinned by hash: Dockerfile:3-5","Warn: goCommand not pinned by hash: Dockerfile:8-11","Info:   0 out of   2 goCommand dependencies pinned","Info:   0 out of   2 containerImage dependencies pinned"],"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'master'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}}]},"last_synced_at":"2025-08-19T03:16:57.482Z","repository_id":162278143,"created_at":"2025-08-19T03:16:57.482Z","updated_at":"2025-08-19T03:16:57.482Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28429085,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-14T16:38:47.836Z","status":"ssl_error","status_checked_at":"2026-01-14T16:34:59.695Z","response_time":107,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":["container","docker","docker-image","golang","gorilla","mux","rest-api"],"created_at":"2026-01-14T17:57:25.340Z","updated_at":"2026-01-14T17:57:25.977Z","avatar_url":"https://github.com/gmirsky.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"#  test-rest-api\n\nA simple golang TEST ReST API that utilizes gorilla/mux and returns the host or\ncontainer name and IP address to aid in load balancer verification and debugging.\n\nThis TEST Rest API is also useful for Docker/Kubernetes teaching demonstrations\nallowing the user to demonstrate that each instance of the container has a\nseparate and distinct host name and IP address.\n\nThis API uses gorilla/mux, a powerful URL router and dispatcher for golang.\nSee: http://www.gorillatoolkit.org/pkg/mux for more information.\n\nThis container is built using the official golang Alpine container as a base.\n\n## Build the Application\n\nTo run the application, first build the application with the following command:\n\n`go build`\n\nPlease insure that you have gorilla/mux installed in your golang environment.\nRefer to the golang documentation for more information on installing golang\nmodules.\n\n## Run the Application\n\nThen execute the build with the following command:\n\n`./test-rest-api`\n\n## Test the Application\n\nTo test out the container listening on port 8080, use these URLs:\n```sh\ncurl http://localhost:8080/about\ncurl http://localhost:8080/test\ncurl http://localhost:8080/hostname\ncurl http://localhost:8080/hello/Vanapagan\n```\n\nThe random value for \"Code\" will change with each execution to help you insure\nyou are not seeing cached results in your browser.\n\n## Build the Docker Image\n\nTo build the image with the application run:\n\n`docker build -f Dockerfile . -t testrestapi:latest`\n\n## Run the Docker image\n\nTo run the image, execute the following commands to create the containers:\n\n`docker run --rm -d --name testrest8080 -p 8080:8080 testrestapi:latest`\n\n`docker run --rm -d --name testrest8081 -p 8081:8080 testrestapi:latest`\n\n## Test the Docker containers\n\nTo test out the container listening on port 8080, use these URLs:\n```sh\ncurl http://localhost:8080/about\ncurl http://localhost:8080/test\ncurl http://localhost:8080/hostname\ncurl http://localhost:8080/hello/Vanapagan\n```\n\nTo test out the container listening on port 8081, use these URLs:\n```sh\ncurl http://localhost:8081/about\ncurl http://localhost:8081/test\ncurl http://localhost:8081/hostname\ncurl http://localhost:8081/hello/Vanapagan\n```\n# Testing on Kubernetes\n\n## Create the service for the deployments\n\n`kubectl create -f test-rest-api-service.yaml`\n\n## Verify the service has been created\n\n`kubectl get services`\n\n## Create Kubernetes deployment with three (3) replicas\n\n`kubectl create -f test-rest-api-deployment.yaml`\n\n## Get the Kubernetes deployments\n\n`kubectl get deployments`\n\n## Get the pods from the deployment\n\n`kubectl get pods --show-labels`\n\n## Test the responses.\n\n`curl  xxx.xxx.xxx.xxx:8080/hostname`\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgmirsky%2Ftest-rest-api","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgmirsky%2Ftest-rest-api","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgmirsky%2Ftest-rest-api/lists"}