{"id":16930123,"url":"https://github.com/kayagokalp/git2_auth","last_synced_at":"2025-03-21T03:23:36.014Z","repository":{"id":163687795,"uuid":"610338097","full_name":"kayagokalp/git2_auth","owner":"kayagokalp","description":"A small library to provide easy to use callback handler to authenticate with git2-rs","archived":false,"fork":false,"pushed_at":"2023-03-07T18:32:54.000Z","size":8,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-01-26T00:11:18.009Z","etag":null,"topics":["authentication","git","git2-rs","libgit2","rust","ssh"],"latest_commit_sha":null,"homepage":"","language":"Rust","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/kayagokalp.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":"2023-03-06T15:16:33.000Z","updated_at":"2023-03-07T18:32:41.000Z","dependencies_parsed_at":null,"dependency_job_id":"13577aa2-2c51-4833-ba5b-f7b955431a0d","html_url":"https://github.com/kayagokalp/git2_auth","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kayagokalp%2Fgit2_auth","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kayagokalp%2Fgit2_auth/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kayagokalp%2Fgit2_auth/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kayagokalp%2Fgit2_auth/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/kayagokalp","download_url":"https://codeload.github.com/kayagokalp/git2_auth/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244729163,"owners_count":20500203,"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":["authentication","git","git2-rs","libgit2","rust","ssh"],"created_at":"2024-10-13T20:40:56.809Z","updated_at":"2025-03-21T03:23:35.987Z","avatar_url":"https://github.com/kayagokalp.png","language":"Rust","readme":"# git2_auth\n\nAn authentication handler to be used with `git2_rs`. An example usage can be seen below. I used the following repos:\n\n- [Cargo](https://github.com/rust-lang/cargo/blob/f72f8a87c8c6ec05a3706ef9987899cd105db622/src/cargo/sources/git/utils.rs#L450-L718)\n- [git2_credentials](https://github.com/davidB/git2_credentials)\n\n## TODO\n\n- [ ] User defined ssh handlers\n- [ ] User provided username trials\n\n## Example Usage\n\n```rust\n// Setup remote callbacks\nlet mut callback = git2::RemoteCallbacks::new();\nlet config = git2::Config::open_default().unwrap();\n// Setup authentication handler\nlet mut auth_handler = AuthHandler::default_with_config(config);\ncallback.credentials(move |url, username, allowed| {\n    auth_handler.handle_callback(url, username, allowed)\n});\n// Create fetch options\nlet mut fetch_options = git2::FetchOptions::new();\nfetch_options\n    .remote_callbacks(callback)\n    .download_tags(git2::AutotagOption::All)\n    .update_fetchhead(true);\n// Clone the repo\ngit2::build::RepoBuilder::new()\n    .branch(\"master\")\n    .fetch_options(fetch_options)\n    .clone(\"git@github.com:kayagokalp/git2_auth.git\", dir.as_ref())\n    .unwrap();\n```\n\n## License\n\n[MIT](https://choosealicense.com/licenses/mit/)\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkayagokalp%2Fgit2_auth","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkayagokalp%2Fgit2_auth","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkayagokalp%2Fgit2_auth/lists"}