This service provides login session capabilities and authenticated proxying to implement a Backend for Frontend pattern.
- Authentication
- Login through OpenID connect (e.g. Keycloak)
- Store JWT in server side session
- Provide session to a frontend through a http-only cookie
- API proxy
- Proxy requests to a backend
- Attach JWT to proxied requests
- Protect proxy requests with CSRF token
- Match request path to select different proxy targets
- File serving
- Serve files from a local directory
- Serve each directory with an index.html as a single page app
RIDSER_DANGER_ACCEPT_INVALID_CERTS
: Accept any certificate when proxying requests.
- Enter running keycloak container:
docker exec -it rust-identity-service_devcontainer-keycloak-1 /bin/bash
- Export realm
cd /opt/keycloak/ ./bin/kc.sh export --file /tmp/multcorp.json --realm multcorp --users same_file exit
- Copy export file from container to local filesystem
docker cp rust-identity-service_devcontainer-keycloak-1:/tmp/multcorp.json dev_realm.json
You can use VSCode with devcontainer extension, or run the containers yourself:
$ cd .devcontainer
docker compose up -d
docker compose exec -u ${UID}:${GID} -it ridser /bin/bash
rustup update stable
export RUST_LOG=ridser=debug,info
- Install npm dependencies in the
tests
directory - Run
npx playwright test