Skip to content
Snippets Groups Projects

Resolve "Update Dockerfile Python versions"

Merged Maarten de Waard requested to merge 70-update-dockerfile-python-versions into master
6 files
+ 27
35
Compare changes
  • Side-by-side
  • Inline
Files
6
@@ -4,15 +4,18 @@ work together according to [OpenID Connect Standards](https://openid.net/develop
## Prerequisites
The single sign-on application needs to be up and running. Instructions on how to accomplish
that can be found in `../../README.md`.
that can be found [in the
documentation](https://docs.openappstack.net/projects/single-sign-on/en/latest/local_development.html).
### Create oAuth Client
You also need to create an oAuth2-Client to enable this application to communicate with the
oAuth server.
To do that you can run the `create-hydra-client` script in this repository:
```
bash ../create-hydra-client.bash testapplication clientsecret http://localhost:4445 http://localhost:13337/callback http://localhost:13337/ http://localhost:13337/logout
bash ../create-hydra-client.bash testapp clientsecret http://localhost:4445 http://localhost:13337/callback http://localhost:13337/ http://localhost:13337/logout
```
`http://localhost:4445` refers to the hydra-admin service. `http://localhost:13337/callback` is the
@@ -34,11 +37,11 @@ out for is called `--dangerous-allow-insecure-redirect-urls`:
In the default setup, users can be created by executing the scripts contained in `../../user-panel/backend/utils/`
```
bash ../../user-panel/backend/utils/create-user.bash admin <choose-password-here> admin@example.net
bash ../../user-panel/backend/utils/create-application.bash testapplication
bash ../../user-panel/backend/utils/grant-access.bash admin testapplication
bash ../../user-panel/backend/utils/create-role.bash admin
bash ../../user-panel/backend/utils/assign-role.bash admin admin
docker-compose exec backend ./utils/create-user.bash admin <choose-password-here> admin@example.net
docker-compose exec backend ./utils/create-application.bash testapp "this is a test application"
docker-compose exec backend ./utils/grant-access.bash admin testapp
docker-compose exec backend ./utils/create-role.bash admin
docker-compose exec backend ./utils/assign-role.bash admin admin
```
## Installation
@@ -50,24 +53,8 @@ python3 -m venv venv
pip3 install -r requrements.txt
```
## Configuration
Make sure you export the following
environment variables with values according to your setup. Use the default values provided here
if you run your setup locally.
```
export BASE_URL=http://localhost:4444/ # Hydra public API Base
export KEY=testapplication # name of your oauth/openID Connect client (application)
export SECRET=clientsecret # secret of your oauth/openID Connect client (application)
```
## Run the tests
Start the application with:
```
flask run --port=13337
```
Navigate to `http://localhost:13337/` to trigger the openID connect authentication flow. During the login
process your agent's browser will be redirected multiple times. If successful, you will see a
json reply containing your oAuth token.
@@ -78,6 +65,7 @@ Connect scopes.
### Run auto tests
Run the following commands to run the tests
```
export TESTUSER_USERNAME=user
export TESTUSER_PASSWORD=secret
@@ -86,8 +74,8 @@ export TESTUSER_EMAIL=test@example.net
export ROLE=admin
bash ../../user-panel/utils/create-user.bash $TESTUSER_USERNAME $TESTUSER_PASSWORD $TESTUSER_EMAIL
bash ../../user-panel/utils/create-user.bash $TESTUSER_USERNAME2 RANDOMPW $TESTUSER_EMAIL
bash ../../user-panel/utils/create-application.bash testapplication
bash ../../user-panel/utils/grant-access.bash $TESTUSER_USERNAME testapplication
bash ../../user-panel/utils/create-application.bash testapp
bash ../../user-panel/utils/grant-access.bash $TESTUSER_USERNAME testapp
bash ../../user-panel/utils/create-role.bash $ROLE
bash ../../user-panel/utils/assign-role.bash $TESTUSER_USERNAME $ROLE
python3 -m behave \
@@ -99,4 +87,5 @@ python3 -m behave \
-D email=${TESTUSER_EMAIL} \
-D role=${ROLE}
```
Note: You need to have chromedriver isntalled to run the tests
Note: You need to have chromedriver installed to run the tests
Loading