Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up

A plugin for Envoy, written in Rust, that implements basic authentication and stores it in an encrypted cookie to persist across browser sessions.

License

NotificationsYou must be signed in to change notification settings

antonengelhardt/basic-auth-plugin

Repository files navigation

A 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.

Install

Install Toolchain for WASM in Rust

For developing theRust Toolchain has to be installed and the WASM target has to be enabled. E.g. for Ubuntu this can be achieved by:

# Install Build essentialsapt install build-essential# Install Rustupcurl --proto'=https' --tlsv1.2 -sSf https://sh.rustup.rs| sh# Enable WASM compilation targetcargo build --target wasm32-wasip1 --release

Run

Shortcut (make sure to havemake installed):

make run

Detailed variant

  1. Building the plugin:
cargo build --target wasm32-wasip1 --release# ormake build
  1. Testing locally with Envoy (docker anddocker-compose are needed):
docker compose up
  1. Requests to the locally running envoy with the plugin enabled:
curl localhost:10000

Configuration

The plugin is configured via theenvoy.yaml-file. The following configuration options are required:

NameTypeDescriptionExampleRequired
allowed_usersObjectA list of allowed username/password combinations.See below
cookie_nameStringName of the Session and Nonce cookie.basic-auth-session
cookie_durationu64A number of seconds that the cookie should live for.86400
aes_keyStringA base64-encoded AES-Key of 32 bits, generate withopenssl rand -base64 32g00nv8nuZfNrqc99OKUOqCCatepmscgSeX70nYq4Xdo=

Theallowed_users key expects a list of username/password combinations, like so:

allowed_users:  -username:user1password:password123

About

A plugin for Envoy, written in Rust, that implements basic authentication and stores it in an encrypted cookie to persist across browser sessions.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

[8]ページ先頭

©2009-2025 Movatter.jp