{"id":19900617,"url":"https://github.com/gobuffalo/mw-basicauth","last_synced_at":"2025-05-02T23:31:07.857Z","repository":{"id":43115071,"uuid":"142870024","full_name":"gobuffalo/mw-basicauth","owner":"gobuffalo","description":"Buffalo Basic Auth Middleware","archived":false,"fork":false,"pushed_at":"2023-02-14T15:45:51.000Z","size":147,"stargazers_count":6,"open_issues_count":0,"forks_count":4,"subscribers_count":8,"default_branch":"main","last_synced_at":"2024-06-19T00:21:56.125Z","etag":null,"topics":["authentication","basic-authentication","go","gobuffalo","golang","middleware"],"latest_commit_sha":null,"homepage":null,"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/gobuffalo.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","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},"funding":{"github":"markbates","patreon":"buffalo"}},"created_at":"2018-07-30T12:06:00.000Z","updated_at":"2023-03-01T10:56:52.000Z","dependencies_parsed_at":"2024-06-19T00:03:37.095Z","dependency_job_id":"4c3117c6-81d9-42d5-8e70-b1d95d812093","html_url":"https://github.com/gobuffalo/mw-basicauth","commit_stats":null,"previous_names":[],"tags_count":11,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gobuffalo%2Fmw-basicauth","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gobuffalo%2Fmw-basicauth/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gobuffalo%2Fmw-basicauth/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gobuffalo%2Fmw-basicauth/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/gobuffalo","download_url":"https://codeload.github.com/gobuffalo/mw-basicauth/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":224341452,"owners_count":17295271,"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","basic-authentication","go","gobuffalo","golang","middleware"],"created_at":"2024-11-12T20:12:45.990Z","updated_at":"2024-11-12T20:12:46.747Z","avatar_url":"https://github.com/gobuffalo.png","language":"Go","funding_links":["https://github.com/sponsors/markbates","https://patreon.com/buffalo"],"categories":[],"sub_categories":[],"readme":"# mw-basicauth\n\n[![Standard Test](https://github.com/gobuffalo/mw-basicauth/actions/workflows/standard-go-test.yml/badge.svg)](https://github.com/gobuffalo/mw-basicauth/actions/workflows/standard-go-test.yml)\n[![Go Reference](https://pkg.go.dev/badge/github.com/gobuffalo/mw-basicauth.svg)](https://pkg.go.dev/github.com/gobuffalo/mw-basicauth)\n[![Go Report Card](https://goreportcard.com/badge/github.com/gobuffalo/mw-basicauth)](https://goreportcard.com/report/github.com/gobuffalo/mw-basicauth)\n\n[Basic HTTP Authentication](https://tools.ietf.org/html/rfc7617) Middleware\nfor [Buffalo](https://github.com/gobuffalo/buffalo)\n\n## Installation\n\n```console\n$ go get github.com/gobuffalo/mw-basicauth\n```\n\n## Usage\n\n```go\nauth := func(c buffalo.Context, u, p string) (bool, error) {\n    return (u == \"username\" \u0026\u0026 p == \"password\"), nil\n}\n\napp.Use(basicauth.Middleware(auth))\n```\n\n## Hitting protected endpoints\n\n1. Base64 Encode `username:password`, which becomes `dXNlcm5hbWU6cGFzc3dvcmQK` in the aforementioned example\n\n2. Then pass the following HTTP header along with all requests to protected endpoints: `Authorization: Basic dXNlcm5hbWU6cGFzc3dvcmQK`\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgobuffalo%2Fmw-basicauth","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgobuffalo%2Fmw-basicauth","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgobuffalo%2Fmw-basicauth/lists"}