{"id":4259534,"name":"github.com/lauslim12/basic","ecosystem":"go","description":"Package basic provides plug and play, generic, secure, easy to use, customizable, and painless Basic Authentication for Go's HTTP handlers.\nThis package tries its best to implement all specifications in a customizable way as specified in\n[RFC 7617](https://datatracker.ietf.org/doc/html/rfc7617), the newest version of Basic Authentication which obsoletes\n[RFC 2617](https://datatracker.ietf.org/doc/html/rfc2617).\n\nBasic Authentication itself is a simple and secure way to protect your API endpoints. However, for it to be completely secure,\nyou have to augment the authentication by using SSL/TLS. You may use hashes / encryption in advance, but I think it's not necessary.\nSSL/TLS provides excellent security as long as you can trust your Certificate Authority and can ensure your connections are end-to-end\nencrypted, no sniffers or spoofers whatsoever.\n\nIn order to use this package, you have to instantiate a new `BasicAuth` instance before hooking it to a handler.\nYou can set various configurations, such as the authenticator function, charset (if using non-standard, other than UTF-8 charset),\ninvalid credentials response, invalid scheme response, custom realm, and static users if applicable. If you want to do anything\nwith the `*http.Request` struct, it is recommended for you to process it in a previous custom middleware before implementing your\nauthentication with this library. This package tries its best to be as generic as possible, so you can definitely use any web framework or\ncustomized handlers as long as it conforms to the main interface (`http.Handler`).\n\nAs a note about the `BasicAuth` attributes, you may use the authenticator function in order to perform a more\nsophisticated authentication logic, such as pulling your user based on their username from the database. Another thing to note is that\nyou can pass `nil` or `make(map[string]string)` to the `Users` attribute if you do not need static credentials. Finally, the\n`WWW-Authenticate` header is only sent if both `Charset` and `Realm` are set. `Users` attribute is a 1-to-1 mapping of username\nand password.\n\nSee example in `example/main.go`.","homepage":"https://github.com/lauslim12/basic","licenses":"MIT","normalized_licenses":["MIT"],"repository_url":"https://github.com/lauslim12/basic","keywords_array":[],"namespace":"github.com/lauslim12","versions_count":6,"first_release_published_at":"2022-03-24T07:12:58.000Z","latest_release_published_at":"2023-01-15T13:39:49.000Z","latest_release_number":"v1.0.5","last_synced_at":"2026-03-28T07:57:12.841Z","created_at":"2022-04-13T00:45:18.228Z","updated_at":"2026-03-28T07:57:12.842Z","registry_url":"https://pkg.go.dev/github.com/lauslim12/basic","install_command":"go get github.com/lauslim12/basic","documentation_url":"https://pkg.go.dev/github.com/lauslim12/basic#section-documentation","metadata":{},"repo_metadata":{"uuid":"473493468","full_name":"lauslim12/basic","owner":"lauslim12","description":"Plug and play, generic, secure, and customizable Basic Authentication library for Go's HTTP handlers. No dependencies and conforms to RFC 7617.","archived":false,"fork":false,"pushed_at":"2023-01-15T13:40:27.000Z","size":38,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2023-03-05T14:22:33.432Z","etag":null,"topics":["api","basic-authentication","go","http","library","rfc7617"],"latest_commit_sha":null,"homepage":"https://pkg.go.dev/github.com/lauslim12/basic","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,"logo_url":null,"metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2022-03-24T07:06:31.000Z","updated_at":"2022-05-26T14:55:05.000Z","dependencies_parsed_at":"2023-02-09T22:15:49.633Z","dependency_job_id":null,"html_url":"https://github.com/lauslim12/basic","commit_stats":null,"repository_url":"http://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lauslim12%2Fbasic","tags_url":"http://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lauslim12%2Fbasic/tags","manifests_url":"http://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lauslim12%2Fbasic/manifests","owner_url":"http://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/lauslim12","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":108921946,"host_url":"http://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"http://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"http://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names"}},"repo_metadata_updated_at":"2023-03-21T19:58:54.194Z","dependent_packages_count":0,"downloads":null,"downloads_period":null,"dependent_repos_count":0,"rankings":{"downloads":null,"dependent_repos_count":9.345852080216646,"dependent_packages_count":6.999148183520997,"stargazers_count":10.884508724104611,"forks_count":8.968987819809952,"average":9.049624201913051},"purl":"pkg:golang/github.com/lauslim12/basic","advisories":[],"docker_usage_url":"https://docker.ecosyste.ms/usage/go/github.com/lauslim12/basic","docker_dependents_count":null,"docker_downloads_count":null,"usage_url":"https://repos.ecosyste.ms/usage/go/github.com/lauslim12/basic","dependent_repositories_url":"https://repos.ecosyste.ms/api/v1/usage/go/github.com/lauslim12/basic/dependencies","status":null,"funding_links":[],"critical":null,"issue_metadata":{"last_synced_at":"2023-05-19T04:51:19.231Z","issues_count":1,"pull_requests_count":5,"avg_time_to_close_issue":1524.0,"avg_time_to_close_pull_request":56.8,"issues_closed_count":1,"pull_requests_closed_count":5,"pull_request_authors_count":1,"issue_authors_count":1,"avg_comments_per_issue":4.0,"avg_comments_per_pull_request":0.0,"merged_pull_requests_count":5,"bot_issues_count":0,"bot_pull_requests_count":0,"past_year_issues_count":1,"past_year_pull_requests_count":1,"past_year_avg_time_to_close_issue":1524.0,"past_year_avg_time_to_close_pull_request":80.0,"past_year_issues_closed_count":1,"past_year_pull_requests_closed_count":1,"past_year_pull_request_authors_count":1,"past_year_issue_authors_count":1,"past_year_avg_comments_per_issue":4.0,"past_year_avg_comments_per_pull_request":0.0,"past_year_bot_issues_count":0,"past_year_bot_pull_requests_count":0,"past_year_merged_pull_requests_count":1},"versions_url":"https://packages.ecosyste.ms/api/v1/registries/proxy.golang.org/packages/github.com%2Flauslim12%2Fbasic/versions","version_numbers_url":"https://packages.ecosyste.ms/api/v1/registries/proxy.golang.org/packages/github.com%2Flauslim12%2Fbasic/version_numbers","dependent_packages_url":"https://packages.ecosyste.ms/api/v1/registries/proxy.golang.org/packages/github.com%2Flauslim12%2Fbasic/dependent_packages","related_packages_url":"https://packages.ecosyste.ms/api/v1/registries/proxy.golang.org/packages/github.com%2Flauslim12%2Fbasic/related_packages","codemeta_url":"https://packages.ecosyste.ms/api/v1/registries/proxy.golang.org/packages/github.com%2Flauslim12%2Fbasic/codemeta","maintainers":[]}