add tests

This commit is contained in:
geoffsee
2025-06-17 10:38:30 -04:00
parent 90f6a0ab7e
commit d04634a99c
6 changed files with 506 additions and 21 deletions

View File

@@ -1,20 +1,18 @@
# axum-tower-sessions-edge
[![Rust](https://github.com/seemueller-io/axum-tower-sessions-edge/actions/workflows/test.yaml/badge.svg)](https://github.com/seemueller-io/axum-tower-sessions-edge/actions/workflows/test.yaml)
[![License: MIT](https://img.shields.io/badge/License-MIT-green.svg)](https://opensource.org/licenses/MIT)
> OAuth 2.0 Proxy built with Axum and Tower. Targets `wasm32-unknown-unknown`
Warning: This API may be unstable.
Proxies incoming requests for defined routes and forwards traffic to the service defined as `PROXY_TARGET`.
Configuration is modified by changing `.dev.vars`, `wrangler.jsonc`, or `secrets.json`. It's not perfect yet, but it's powerful.
Validates incoming requests for defined routes and forwards traffic to the service defined as `PROXY_TARGET`.
> Targets `wasm32-unknown-unknown`
## Features
- [OAuth 2.0](https://datatracker.ietf.org/doc/html/rfc6749)
- [Proof Key for Code Exchange (PKCE)](https://datatracker.ietf.org/doc/html/rfc7636)
- [OAuth 2.0 Token Introspection](https://datatracker.ietf.org/doc/html/rfc7662)
## Todo
- Proof compliance
- Expand configuration interface
- Zero-config development environment
## Quickstart
```bash
git clone https://github.com/seemueller-io/axum-tower-sessions-edge.git
@@ -27,7 +25,6 @@ bun install
#ZITADEL_ORG_ID="your-organization-id"
#ZITADEL_PROJECT_ID="your-project-id"
#APP_URL="http://localhost:3000"
#DEV_MODE="true"
# Update the wrangler.jsonc and replace the value of PROXY_TARGET with a worker script name.
@@ -41,7 +38,7 @@ Run your own Zitadel: `docker compose up -d`
> You will need to configure:
> - Organization
> - Project
> - Application. _Choose PKCE (with code)_
> - Application - _Choose PKCE (with code)_
### Building
@@ -57,16 +54,6 @@ cargo clean && cargo install -q worker-build && worker-build --release
cargo build --release --target wasm32-unknown-unknown
```
## Project Structure
- `src/` - Rust source code
- `api/` - API endpoints and routing
- `axum_introspector/` - Axum framework integration for token introspection
- `credentials/` - Credential management
- `oidc/` - OpenID Connect implementation
- `session_storage/` - Session storage implementations
- `utilities.rs` - Common utility functions
- `lib.rs` - Server
## Acknowledgements
This project is made possible thanks to: