{"id":16836860,"url":"https://github.com/mpl/basicauth","last_synced_at":"2025-06-11T12:33:28.884Z","repository":{"id":28007821,"uuid":"31502331","full_name":"mpl/basicauth","owner":"mpl","description":"HTTP basic access authentication","archived":false,"fork":false,"pushed_at":"2023-03-21T11:19:25.000Z","size":7,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-18T03:21:08.283Z","etag":null,"topics":[],"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/mpl.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":"2015-03-01T16:28:10.000Z","updated_at":"2023-03-21T11:19:29.000Z","dependencies_parsed_at":"2025-01-24T10:36:41.988Z","dependency_job_id":null,"html_url":"https://github.com/mpl/basicauth","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/mpl%2Fbasicauth","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mpl%2Fbasicauth/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mpl%2Fbasicauth/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mpl%2Fbasicauth/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mpl","download_url":"https://codeload.github.com/mpl/basicauth/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mpl%2Fbasicauth/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":259265050,"owners_count":22831066,"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":[],"created_at":"2024-10-13T12:15:10.891Z","updated_at":"2025-06-11T12:33:28.839Z","avatar_url":"https://github.com/mpl.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# basicauth\nHTTP basic access authentication\n\nExample:\n\n\tvar up *basicauth.UserPass\n\t\n\tfunc makeHandler(fn func(http.ResponseWriter, *http.Request)) http.HandlerFunc {\n\t\treturn func(w http.ResponseWriter, r *http.Request) {\n\t\t\tdefer func() {\n\t\t\t\tif e, ok := recover().(error); ok {\n\t\t\t\t\thttp.Error(w, e.Error(), http.StatusInternalServerError)\n\t\t\t\t\treturn\n\t\t\t\t}\n\t\t\t}()\n\t\t\tif up.IsAllowed(r) {\n\t\t\t\tfn(w, r)\n\t\t\t} else {\n\t\t\t\tbasicauth.SendUnauthorized(w, r, \"montorrent\")\n\t\t\t}\n\t\t}\n\t}\n\t\n\tfunc main() {\n\t\tvar err error\n\t\tup, err = basicauth.New(\"foo:bar\")\n\t\tif err != nil {\n\t\t\tlog.Fatal(err)\n\t\t}\n\t\n\t\thttp.Handle(\"/\", makeHandler(someHandler))\n\t\thttp.ListenAndServe(*host, nil)\n\t}\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmpl%2Fbasicauth","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmpl%2Fbasicauth","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmpl%2Fbasicauth/lists"}