{"id":20112847,"url":"https://github.com/cloudacademy/voteapp-api-go","last_synced_at":"2025-08-20T16:18:20.888Z","repository":{"id":77791756,"uuid":"203471340","full_name":"cloudacademy/voteapp-api-go","owner":"cloudacademy","description":"Go based API for Programming Language Voting Application","archived":false,"fork":false,"pushed_at":"2023-02-23T11:45:12.000Z","size":26218,"stargazers_count":18,"open_issues_count":1,"forks_count":44,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-05-06T11:35:24.202Z","etag":null,"topics":["api","cloudacademy","go","golang","gorilla-mux","mongodb"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/cloudacademy.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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":"2019-08-20T23:46:20.000Z","updated_at":"2024-06-29T03:35:32.000Z","dependencies_parsed_at":"2023-04-30T04:36:21.725Z","dependency_job_id":null,"html_url":"https://github.com/cloudacademy/voteapp-api-go","commit_stats":null,"previous_names":[],"tags_count":16,"template":false,"template_full_name":null,"purl":"pkg:github/cloudacademy/voteapp-api-go","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cloudacademy%2Fvoteapp-api-go","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cloudacademy%2Fvoteapp-api-go/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cloudacademy%2Fvoteapp-api-go/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cloudacademy%2Fvoteapp-api-go/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/cloudacademy","download_url":"https://codeload.github.com/cloudacademy/voteapp-api-go/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cloudacademy%2Fvoteapp-api-go/sbom","scorecard":{"id":292297,"data":{"date":"2025-08-11","repo":{"name":"github.com/cloudacademy/voteapp-api-go","commit":"f8208359726bac1bc567abd8ad210d78f9d4b699"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":2.5,"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":"Dangerous-Workflow","score":10,"reason":"no dangerous workflow patterns detected","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":"Token-Permissions","score":0,"reason":"detected GitHub workflow tokens with excessive permissions","details":["Warn: no topLevel permission defined: .github/workflows/go.yml:1","Info: no jobLevel write permissions found"],"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":8,"reason":"binaries present in source code","details":["Warn: binary detected: releases/api-linux64:1","Warn: binary detected: releases/api-osx-amd64:1"],"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":"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":"License","score":0,"reason":"license file not detected","details":["Warn: project does not have a license file"],"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":0,"reason":"Project has not signed or included provenance with any releases.","details":["Warn: release artifact 1.2.2 not signed: https://api.github.com/repos/cloudacademy/voteapp-api-go/releases/90946285","Warn: release artifact 1.2.1 not signed: https://api.github.com/repos/cloudacademy/voteapp-api-go/releases/87339154","Warn: release artifact 1.2.0 not signed: https://api.github.com/repos/cloudacademy/voteapp-api-go/releases/87337349","Warn: release artifact 1.1.11 not signed: https://api.github.com/repos/cloudacademy/voteapp-api-go/releases/87336795","Warn: release artifact 1.1.10 not signed: https://api.github.com/repos/cloudacademy/voteapp-api-go/releases/87336508","Warn: release artifact 1.2.2 does not have provenance: https://api.github.com/repos/cloudacademy/voteapp-api-go/releases/90946285","Warn: release artifact 1.2.1 does not have provenance: https://api.github.com/repos/cloudacademy/voteapp-api-go/releases/87339154","Warn: release artifact 1.2.0 does not have provenance: https://api.github.com/repos/cloudacademy/voteapp-api-go/releases/87337349","Warn: release artifact 1.1.11 does not have provenance: https://api.github.com/repos/cloudacademy/voteapp-api-go/releases/87336795","Warn: release artifact 1.1.10 does not have provenance: https://api.github.com/repos/cloudacademy/voteapp-api-go/releases/87336508"],"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"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"}},{"name":"Pinned-Dependencies","score":2,"reason":"dependency not pinned by hash detected -- score normalized to 2","details":["Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/go.yml:17: update your workflow using https://app.stepsecurity.io/secureworkflow/cloudacademy/voteapp-api-go/go.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/go.yml:23: update your workflow using https://app.stepsecurity.io/secureworkflow/cloudacademy/voteapp-api-go/go.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/go.yml:40: update your workflow using https://app.stepsecurity.io/secureworkflow/cloudacademy/voteapp-api-go/go.yml/master?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/go.yml:50: update your workflow using https://app.stepsecurity.io/secureworkflow/cloudacademy/voteapp-api-go/go.yml/master?enable=pin","Warn: containerImage not pinned by hash: Dockerfile:1: pin your Docker image by updating alpine:latest to alpine:latest@sha256:4bcff63911fcb4448bd4fdacec207030997caf25e9bea4045fa6c8c44de311d1","Info:   0 out of   3 GitHub-owned GitHubAction dependencies pinned","Info:   0 out of   1 third-party GitHubAction dependencies pinned","Info:   0 out of   1 containerImage dependencies pinned","Info:   1 out of   1 goCommand 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":"Vulnerabilities","score":6,"reason":"4 existing vulnerabilities detected","details":["Warn: Project is vulnerable to: GO-2023-2402 / GHSA-45x7-px36-x8w8","Warn: Project is vulnerable to: GO-2024-3321 / GHSA-v778-237x-gjrc","Warn: Project is vulnerable to: GO-2025-3487 / GHSA-hcg3-q754-cr77","Warn: Project is vulnerable to: GO-2022-1059 / GHSA-69ch-w2m2-3vjp"],"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}}]},"last_synced_at":"2025-08-17T18:34:40.205Z","repository_id":77791756,"created_at":"2025-08-17T18:34:40.205Z","updated_at":"2025-08-17T18:34:40.205Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":271347021,"owners_count":24743745,"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","status":"online","status_checked_at":"2025-08-20T02:00:09.606Z","response_time":69,"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","cloudacademy","go","golang","gorilla-mux","mongodb"],"created_at":"2024-11-13T18:22:41.540Z","updated_at":"2025-08-20T16:18:20.850Z","avatar_url":"https://github.com/cloudacademy.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"![Build Status](https://github.com/cloudacademy/voteapp-api-go/actions/workflows/go.yml/badge.svg) \n![GitHub release (latest SemVer)](https://img.shields.io/github/v/release/cloudacademy/voteapp-api-go)\n\n# Background\nProvides a CRUD based API written in Go. The API is designed to read and write into a MongoDB backend database.\n\n# API endpoints\nThe API provides the following endpoints:\n```\nGET /ok\nGET /cpu\nGET /version\nGET /languages\nGET /languages/{name}\nGET /languages/{name}/vote\nPOST /languages/{name}\nDELETE /languages/{name}\n```\n\n# API GETs with curl and jq\nThe API can be used to perform GETs with **curl** and **jq** like so:\n```\ncurl -s http://localhost:8080/languages | jq .\ncurl -s http://localhost:8080/languages/{name} | jq .\ncurl -s http://localhost:8080/languages/{name}/vote | jq .\n```\n\n# API POSTs with curl\nThe API can be used to perform POSTs with **curl** like so:\n```\ncurl http://localhost:8080/languages/{name} \\\n--header \"Content-Type: application/json\" \\\n--request POST \\\n--data-binary @- \u003c\u003cBODY\n{\n    \"Usecase\": \"system, web, server-side\",\n    \"Rank\": 5,\n    \"Compiled\": false,\n    \"Homepage\": \"https://www.php.net/\",\n    \"Download\": \"https://www.php.net/downloads.php\",\n    \"Votes\": 0\n}\nBODY\n```\n\n# API DELETEs with curl and jq\nThe API can be used to perform DELETEs with **curl** like so:\n```\ncurl -s -X DELETE http://localhost:8080/languages/{name}\n```\n\n# Linux Compiling\nThe API can be compiled using the following commands:\n```\n#ensure to be in the same dir as the **main.go** file\ngo get -v -t -d ./...\nCGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -o api\n```\n\n# API MongoDB Database\nThe API is designed to read/write into a MongoDB 4.2.x database. The MongoDB database should be setup and populated using the following commands performed within the mongo shell:\n```\nuse langdb;\n\ndb.createUser({user: \"admin\",\npwd: \"password\",\nroles:[{role: \"userAdmin\" , db:\"langdb\"}]\n});\n\ndb.languages.insert({\"name\" : \"csharp\", \"codedetail\" : { \"usecase\" : \"system, web, server-side\", \"rank\" : 5, \"compiled\" : false, \"homepage\" : \"https://dotnet.microsoft.com/learn/csharp\", \"download\" : \"https://dotnet.microsoft.com/download/\", \"votes\" : 0}});\ndb.languages.insert({\"name\" : \"python\", \"codedetail\" : { \"usecase\" : \"system, web, server-side\", \"rank\" : 3, \"script\" : false, \"homepage\" : \"https://www.python.org/\", \"download\" : \"https://www.python.org/downloads/\", \"votes\" : 0}});\ndb.languages.insert({\"name\" : \"javascript\", \"codedetail\" : { \"usecase\" : \"web, client-side\", \"rank\" : 7, \"script\" : false, \"homepage\" : \"https://en.wikipedia.org/wiki/JavaScript\", \"download\" : \"n/a\", \"votes\" : 0}});\ndb.languages.insert({\"name\" : \"go\", \"codedetail\" : { \"usecase\" : \"system, web, server-side\", \"rank\" : 12, \"compiled\" : true, \"homepage\" : \"https://golang.org\", \"download\" : \"https://golang.org/dl/\", \"votes\" : 0}});\ndb.languages.insert({\"name\" : \"java\", \"codedetail\" : { \"usecase\" : \"system, web, server-side\", \"rank\" : 1, \"compiled\" : true, \"homepage\" : \"https://www.java.com/en/\", \"download\" : \"https://www.java.com/en/download/\", \"votes\" : 0}});\ndb.languages.insert({\"name\" : \"nodejs\", \"codedetail\" : { \"usecase\" : \"system, web, server-side\", \"rank\" : 20, \"script\" : false, \"homepage\" : \"https://nodejs.org/en/\", \"download\" : \"https://nodejs.org/en/download/\", \"votes\" : 0}});\n\nshow collections;\n\ndb.languages.find();\n```\n\n# API Environment Vars\nThe API looks for the following defined environment variables:\n```\nMONGO_CONN_STR=mongodb://localhost:27017/langdb\nMONGO_USERNAME=admin\nMONGO_PASSWORD=password\n```\n**Note**: The environment variables `MONGO_USERNAME` and `MONGO_USERNAME` don't need to be specified if authentication is disabled or not configured on the MongoDB service.\n\n# API Startup\nThe API can be started directly using the **main.go** file like so\n```\nMONGO_CONN_STR=mongodb://localhost:27017/langdb MONGO_USERNAME=admin MONGO_PASSWORD=password go run main.go\n```\nor by using the binary:\n```\nMONGO_CONN_STR=mongodb://localhost:27017/langdb MONGO_USERNAME=admin MONGO_PASSWORD=password ./api\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcloudacademy%2Fvoteapp-api-go","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcloudacademy%2Fvoteapp-api-go","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcloudacademy%2Fvoteapp-api-go/lists"}