mirror of
https://codeberg.org/pfzetto/axum-oidc
synced 2025-12-09 22:55:17 +01:00
feat: automated integration test for example/basic
Adds automated CI integration tests to the basic example. The integration tests launch and configure a keycloak server, launch the example and test its functionality with a headless browser.
This commit is contained in:
parent
c9f63180b3
commit
e62aba722c
7 changed files with 402 additions and 80 deletions
22
examples/basic/README.md
Normal file
22
examples/basic/README.md
Normal file
|
|
@ -0,0 +1,22 @@
|
|||
This example is a basic web application to demonstrate the features of the `axum-oidc`-crate.
|
||||
It has three endpoints:
|
||||
- `/logout` - Logout of the current session using `OIDC RP-Initiated Logout`.
|
||||
- `/foo` - A handler that only can be accessed when logged in.
|
||||
- `/bar` - A handler that can be accessed logged out and logged in. It will greet the user with their name if they are logged in.
|
||||
|
||||
# Running the Example
|
||||
## Dependencies
|
||||
You will need a running OpenID Connect capable issuer like [Keycloak](https://www.keycloak.org/getting-started/getting-started-docker) and a valid client for the issuer.
|
||||
|
||||
You can take a look at the `tests/`-folder to see how the automated keycloak deployment for the integration tests work.
|
||||
|
||||
## Setup Environment
|
||||
Create a `.env`-file that contains the following keys:
|
||||
```
|
||||
APP_URL=http://127.0.0.1:8080
|
||||
ISSUER=<your-issuer>
|
||||
CLIENT_ID=<your-client-id>
|
||||
CLIENT_SECRET=<your-client-secret>
|
||||
```
|
||||
## Run the application
|
||||
`RUST_LOG=debug cargo run`
|
||||
Loading…
Add table
Add a link
Reference in a new issue