{"id":21457884,"url":"https://github.com/antonengelhardt/basic-auth-plugin","last_synced_at":"2026-02-27T19:10:29.708Z","repository":{"id":263869953,"uuid":"889562679","full_name":"antonengelhardt/basic-auth-plugin","owner":"antonengelhardt","description":"A plugin for Envoy, written in Rust, that implements basic authentication and stores it in an encrypted cookie to persist across browser sessions.","archived":false,"fork":false,"pushed_at":"2025-01-08T14:17:19.000Z","size":34,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-10-10T14:27:14.611Z","etag":null,"topics":["authentication","basic-auth","basic-authentication","envoy","envoyproxy","proxy","proxy-wasm","proxy-wasm-rust-sdk","wasm","webassembly"],"latest_commit_sha":null,"homepage":"https://demo.basic-auth-plugin.ae02.de","language":"Rust","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/antonengelhardt.png","metadata":{"files":{"readme":"readme.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":"audit.toml","citation":null,"codeowners":".github/CODEOWNERS","security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2024-11-16T16:39:06.000Z","updated_at":"2025-01-08T14:17:22.000Z","dependencies_parsed_at":"2025-07-03T09:07:33.592Z","dependency_job_id":"8c0290d5-038f-4434-ad5a-6f8b1e0c856b","html_url":"https://github.com/antonengelhardt/basic-auth-plugin","commit_stats":null,"previous_names":["antonengelhardt/basic-auth-plugin"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/antonengelhardt/basic-auth-plugin","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/antonengelhardt%2Fbasic-auth-plugin","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/antonengelhardt%2Fbasic-auth-plugin/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/antonengelhardt%2Fbasic-auth-plugin/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/antonengelhardt%2Fbasic-auth-plugin/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/antonengelhardt","download_url":"https://codeload.github.com/antonengelhardt/basic-auth-plugin/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/antonengelhardt%2Fbasic-auth-plugin/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29909335,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-27T17:28:36.873Z","status":"ssl_error","status_checked_at":"2026-02-27T17:28:20.970Z","response_time":57,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":["authentication","basic-auth","basic-authentication","envoy","envoyproxy","proxy","proxy-wasm","proxy-wasm-rust-sdk","wasm","webassembly"],"created_at":"2024-11-23T06:16:07.693Z","updated_at":"2026-02-27T19:10:29.668Z","avatar_url":"https://github.com/antonengelhardt.png","language":"Rust","readme":"# basic-auth-plugin\n\nA proxy-wasm plugin for Envoy that implements basic authentication. Allowed users can pass through and access the service. The authorization is stored in an encrypted cookie which makes it persistent across sessions.\n\n## Install\n\n### Install Toolchain for WASM in Rust\n\nFor developing the [Rust Toolchain](https://www.rust-lang.org/tools/install) has to be installed and the WASM target has to be enabled. E.g. for Ubuntu this can be achieved by:\n\n```sh\n# Install Build essentials\napt install build-essential\n# Install Rustup\ncurl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh\n# Enable WASM compilation target\ncargo build --target wasm32-wasip1 --release\n```\n\n## Run\n\n**Shortcut** (make sure to have [make](https://www.gnu.org/software/make/) installed):\n\n```sh\nmake run\n```\n\n---\n\n### Detailed variant\n\n1. **Building the plugin:**\n\n```sh\ncargo build --target wasm32-wasip1 --release\n# or\nmake build\n```\n\n2. **Testing locally with Envoy** ([docker](https://www.docker.com/) and [docker-compose](https://docs.docker.com/compose/install/) are needed):\n\n```sh\ndocker compose up\n```\n\n3. **Requests to the locally running envoy with the plugin enabled:**\n\n```sh\ncurl localhost:10000\n```\n\n## Configuration\n\nThe plugin is configured via the `envoy.yaml`-file. The following configuration options are required:\n\n| Name | Type | Description | Example | Required |\n| ---- | ---- | ----------- | ------- | -------- |\n| `allowed_users` | Object | A list of allowed username/password combinations. | See below | ✅ |\n| `cookie_name` | String | Name of the Session and Nonce cookie. | `basic-auth-session` | ✅ |\n| `cookie_duration` | u64 | A number of seconds that the cookie should live for. | 86400 | ✅ |\n| `aes_key` | String | A base64-encoded AES-Key of 32 bits, generate with `openssl rand -base64 32` | g00nv8nuZfNrqc99OKUOqCCatepmscgSeX70nYq4Xdo= | ✅ |\n\nThe `allowed_users` key expects a list of username/password combinations, like so:\n\n```yaml\nallowed_users:\n  - username: user1\n    password: password123\n```\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fantonengelhardt%2Fbasic-auth-plugin","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fantonengelhardt%2Fbasic-auth-plugin","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fantonengelhardt%2Fbasic-auth-plugin/lists"}