Skip to content

Commit 37a5b30

Browse files
committed
Used oidc-provider-mock docker image
1 parent 776e3c5 commit 37a5b30

File tree

4 files changed

+14
-22
lines changed

4 files changed

+14
-22
lines changed

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
77

88
## [Unreleased]
99

10+
* [PR-27](https://github.com/itk-dev/rpa-process-overview/pull/27)
11+
Added pre-defined users in OIDC mock
1012
* [PR-24](https://github.com/itk-dev/rpa-process-overview/pull/24)
1113
Remove search from url
1214
* [PR-25](https://github.com/itk-dev/rpa-process-overview/pull/25)

README.md

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -102,13 +102,7 @@ For local testing of OIDC login, we use [OpenID Provider Mock](https://github.co
102102
[`docker-compose.oidc.yml`](docker-compose.oidc.yml)) and the mock is running on
103103
<https://idp.rpa-process-overview.local.itkdev.dk/>.
104104

105-
To load users into the mock, run
106-
107-
``` shell
108-
task oidc:mock:load-users
109-
```
110-
111-
This will create the following users:
105+
The following users are defined in the mock (cf. [`docker-compose.oidc.yml`](docker-compose.oidc.yml)):
112106

113107
| Username (sub) | Roles |
114108
|------------------|------------------|

Taskfile.yml

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -134,9 +134,3 @@ tasks:
134134
vars:
135135
BUILD_DIR: widgets/static/dist/
136136
PUBLIC_DIR: public/widgets
137-
138-
oidc:mock:load-users:
139-
cmds:
140-
- |-
141-
curl "http://$(task --silent compose -- port oidc-idp 80)/users/user" --request PUT --header 'content-type: application/json' --data '{"email": "[email protected]", "roles": ["user"]}'
142-
curl "http://$(task --silent compose -- port oidc-idp 80)/users/overview-manager" --request PUT --header 'content-type: application/json' --data '{"email": "overview-manager", "roles": ["overview-manager"]}'

docker-compose.oidc.yml

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,17 @@ services:
44
- ${DOCKER_OIDC_DISABLE:-}
55
# Let this container be accessible both internally and externally on the same domain.
66
container_name: idp.${COMPOSE_DOMAIN}
7-
build:
8-
# https://github.com/geigerzaehler/oidc-provider-mock
9-
dockerfile_inline: |
10-
FROM python:3.13-slim-trixie
11-
RUN pip install --root-user-action=ignore pipx
12-
13-
# https://github.com/geigerzaehler/oidc-provider-mock/blob/main/src/oidc_provider_mock/__main__.py
14-
ENTRYPOINT ["/usr/local/bin/pipx", "run", "oidc-provider-mock", "--host", "0.0.0.0", "--port", "80"]
7+
image: ghcr.io/geigerzaehler/oidc-provider-mock:latest
8+
# https://docs.docker.com/reference/compose-file/services/#command
9+
command:
10+
[
11+
"--port",
12+
"80",
13+
"--user-claims",
14+
'{"sub": "user", "email": "[email protected]", "roles": ["user"]}',
15+
"--user-claims",
16+
'{"sub": "overview-manager", "email": "[email protected]", "roles": ["overview-manager"]}',
17+
]
1518
ports:
1619
- "80"
1720
networks:
@@ -21,4 +24,3 @@ services:
2124
- "traefik.enable=true"
2225
- "traefik.docker.network=frontend"
2326
- "traefik.http.routers.${COMPOSE_PROJECT_NAME}-idp.rule=Host(`idp.${COMPOSE_DOMAIN}`)"
24-
# - "traefik.http.services.${COMPOSE_PROJECT_NAME}-idp.loadbalancer.server.port=9400"

0 commit comments

Comments
 (0)