{"id":19049557,"url":"https://github.com/crhntr/gitsmart","last_synced_at":"2025-09-07T04:31:40.106Z","repository":{"id":130824601,"uuid":"281301985","full_name":"crhntr/gitsmart","owner":"crhntr","description":"[WIP] An http.Handler type thing that works well with go-git.","archived":true,"fork":false,"pushed_at":"2023-02-25T03:14:35.000Z","size":40,"stargazers_count":1,"open_issues_count":2,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-09-01T09:18:14.527Z","etag":null,"topics":["git","go","golang"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/crhntr.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":"2020-07-21T05:15:16.000Z","updated_at":"2025-01-01T05:44:08.000Z","dependencies_parsed_at":"2023-05-28T16:45:47.359Z","dependency_job_id":null,"html_url":"https://github.com/crhntr/gitsmart","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/crhntr/gitsmart","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/crhntr%2Fgitsmart","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/crhntr%2Fgitsmart/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/crhntr%2Fgitsmart/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/crhntr%2Fgitsmart/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/crhntr","download_url":"https://codeload.github.com/crhntr/gitsmart/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/crhntr%2Fgitsmart/sbom","scorecard":{"id":308603,"data":{"date":"2025-08-11","repo":{"name":"github.com/crhntr/gitsmart","commit":"b02e027ee199d364f867356743609cf2c200c6d0"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":1.7,"checks":[{"name":"Code-Review","score":0,"reason":"Found 0/11 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":"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":"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":"Maintained","score":0,"reason":"project is archived","details":["Warn: Repository is archived."],"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"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":"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":"Pinned-Dependencies","score":-1,"reason":"no dependencies found","details":null,"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":"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":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Info: FSF or OSI recognized license: MIT License: 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":"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":"Vulnerabilities","score":0,"reason":"24 existing vulnerabilities detected","details":["Warn: Project is vulnerable to: GO-2024-2456 / GHSA-449p-3h89-pw88","Warn: Project is vulnerable to: GO-2024-2466 / GHSA-mw99-9chc-xw7r","Warn: Project is vulnerable to: GO-2025-3367 / GHSA-r9px-m959-cxf4","Warn: Project is vulnerable to: GO-2025-3368 / GHSA-v725-9546-7q7m","Warn: Project is vulnerable to: GO-2021-0227 / GHSA-3vm4-22fp-5rfm","Warn: Project is vulnerable to: GO-2022-0968 / GHSA-gwc9-m7rh-j2ww","Warn: Project is vulnerable to: GO-2021-0356 / GHSA-8c26-wmh5-6g9v","Warn: Project is vulnerable to: GO-2024-2961","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-0236 / GHSA-h86h-8ppg-mxmh","Warn: Project is vulnerable to: GO-2021-0238 / GHSA-83g2-8m93-v3w7","Warn: Project is vulnerable to: GO-2022-0288","Warn: Project is vulnerable to: GO-2022-0969 / GHSA-69cg-p879-7622","Warn: Project is vulnerable to: GO-2022-1144 / GHSA-xrjj-mj9h-534m","Warn: Project is vulnerable to: GO-2023-1571 / GHSA-vvpx-j8f3-3w6h","Warn: Project is vulnerable to: GO-2023-1988 / GHSA-2wrh-6pvc-2jm9","Warn: Project is vulnerable to: GO-2023-2102 / GHSA-4374-p667-p6c8","Warn: Project is vulnerable to: GHSA-qppj-fm5r-hxr3","Warn: Project is vulnerable to: GO-2024-2687 / GHSA-4v7x-pqxf-cx7m","Warn: Project is vulnerable to: GO-2024-3333","Warn: Project is vulnerable to: GO-2025-3503 / GHSA-qxp5-gwg8-xv66","Warn: Project is vulnerable to: GO-2025-3595 / GHSA-vvgc-356p-c3xw"],"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-17T22:42:21.189Z","repository_id":130824601,"created_at":"2025-08-17T22:42:21.189Z","updated_at":"2025-08-17T22:42:21.189Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":273996596,"owners_count":25204472,"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-09-07T02:00:09.463Z","response_time":67,"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":["git","go","golang"],"created_at":"2024-11-08T23:11:16.158Z","updated_at":"2025-09-07T04:31:39.847Z","avatar_url":"https://github.com/crhntr.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# GitSmart (very early WIP)\n\nAn http.Handler type thing that works well with go-git.\nThe name is based on the name of the more robust/modern HTTP protocal used in the Git plumbing/tranfer stuff.\n\n## Notes\n\n- Introductory notes on git Plumbing https://git-scm.com/book/en/v2/Git-Internals-Plumbing-and-Porcelain\n  - Intro to transfer protocols: https://git-scm.com/book/en/v2/Git-Internals-Transfer-Protocols\n- Somewhat deeper documentation of the git \"Smart HTTP\" protocol https://github.com/git/git/blob/master/Documentation/technical/http-protocol.txt\n  - Some of the symbols in the specification are documented here: https://github.com/git/git/blob/master/Documentation/technical/protocol-common.txt\n\n## Design \n\nI would like the API to be something like this.\n\n```go\npackage gitsmart\n\nimport (\n\t\"net/http\"\n\t\n    \"github.com/go-git/go-git/v5/plumbing\"\n    \n    \"github.com/crhntr/gitsmart\"\n)\n\ntype Database interface {\n    Session() interface {\n        StartTransaction()\n        AbortTransaction()\n        CommitTransaction()\n    }   \n}\n\nfunc MyGitHandler(db Database) http.HandlerFunc {\n\treturn func(res http.ResponseWriter, req *http.Request) {\n        s := db.Session()\n        \ts.StartTransaction()\n        \n        \tuserAuth, err := loadUserAuthorizationFromWebToken(req)\n        \tif err != nil {\n        \t\thttp.Error(res, \"repository not found\", http.StatusNotAuthorized)\n        \t\treturn\n        \t}\n        \n        \t// note any store that implements github.com/go-git/go-git/v5/plumbing/storer would be permitted.\n        \tstore, err := loadGitStore(db, req.URL.Path)\n        \tif err != nil {\n        \t\thttp.Error(res, \"repository not found\", http.StatusNotFound)\n        \t\treturn\n        \t}\n        \n        \terr = Handle(res, req, store,\n        \t\t// Handler functionality can be modified with functional options\n        \t\t// see: https://dave.cheney.net/2014/10/17/functional-options-for-friendly-apis\n        \t\t//\n        \t\t// For example, we can implement our own access control for individual branches...\n        \t\t// or maybe even more fine grained control over git objects\n        \t\tgitsmart.BeforeBranchUpdate(CheckIfUserCanUpdateBranch(\u0026userAuth)),\n        \t\t//\n        \t\t// Another example, because we know our store can handle transactional updates, the\n        \t\t// Handler can be notified to broadcast that functionality to clients.\n        \t\tgitsmart.BroadcastTransactionalCapability,\n        \t)\n        \n        \tif err != nil {\n        \t\ts.AbortTransaction()\n        \t\treturn\n        \t}\n        \n        \ts.CommitTransaction()\n    }\n}\n\nfunc CheckIfUserCanUpdateBranch(user *UserAuth) gitsmart.BeforeBranchUpdateFunc {\n\treturn func(ref *plumbing.Reference) error {\n\t\treturn nil /* check if user allowed to edit reference otherwise return an error */\n\t}\n}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcrhntr%2Fgitsmart","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcrhntr%2Fgitsmart","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcrhntr%2Fgitsmart/lists"}