Skip to content

Commit

Permalink
Add OIDC integration test
Browse files Browse the repository at this point in the history
WIP
  • Loading branch information
sbreker committed Oct 4, 2024
1 parent 2111cbe commit c4aeffc
Show file tree
Hide file tree
Showing 3 changed files with 154 additions and 0 deletions.
41 changes: 41 additions & 0 deletions .github/workflows/oidc-integration-test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
name: OIDC integration tests
on:
pull_request:
push:
branches:
- qa/**
- stable/**
jobs:
integration-tests:
runs-on: ubuntu-20.04
strategy:
fail-fast: false
matrix:
browser: [Chrome, Electron, Firefox]
name: ${{ matrix.browser }}
env:
COMPOSE_FILE: ${{ github.workspace }}/docker/docker-compose.dev.yml
steps:
- name: Check out code
uses: actions/checkout@v3

- name: Start containerized services
run: |
sudo sysctl -w vm.max_map_count=262144
docker compose -p ci up -d percona elasticsearch gearmand
- name: Launch Keycloak service
run: |
docker compose -p ci -f ${{ github.workspace }}/docker/docker-compose.keycloak.yml up -d
- name: Wait for Keycloak to be Ready
run: |
echo "Waiting for Keycloak to be ready..."
for i in {1..30}; do
if nc -z localhost 8080; then
echo "Keycloak is up!"
break
fi
echo "Waiting for Keycloak..."
sleep 5
done
15 changes: 15 additions & 0 deletions docker/docker-compose.keycloak.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
---
services:
keycloak:
image: quay.io/keycloak/keycloak:latest
command: ["start-dev", "--import-realm"]
restart: unless-stopped
environment:
KEYCLOAK_ADMIN: admin
KEYCLOAK_ADMIN_PASSWORD: admin
KC_METRICS_ENABLED: true
KC_LOG_LEVEL: INFO
ports:
- 8080:8080
volumes:
- .etc/keycloak/realm.json:/opt/keycloak/data/import/realm.json:ro
98 changes: 98 additions & 0 deletions docker/etc/keycloak/realm.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,98 @@
[
{
"id": "demo",
"realm": "demo",
"sslRequired": "none",
"enabled": true,
"eventsEnabled": true,
"eventsExpiration": 900,
"adminEventsEnabled": true,
"adminEventsDetailsEnabled": true,
"attributes": {
"adminEventsExpiration": "900"
},
"clients": [
{
"id": "atom",
"clientId": "atom",
"name": "atom",
"enabled": true,
"rootUrl": "http://docker-atom:63001",
"adminUrl": "http://docker-atom:63001",
"baseUrl": "http://docker-atom:63001",
"clientAuthenticatorType": "client-secret",
"secret": "example-secret",
"redirectUris": ["http://docker-atom:63001/*"],
"webOrigins": ["http://docker-atom:63001"],
"standardFlowEnabled": true,
"serviceAccountsEnabled": true,
"authorizationServicesEnabled": true,
"publicClient": false
}
],
"users": [
{
"id": "demo",
"email": "[email protected]",
"username": "demo",
"enabled": true,
"emailVerified": true,
"credentials": [
{
"temporary": false,
"type": "password",
"value": "demo"
}
]
}
]
},
{
"id": "secondary",
"realm": "secondary",
"sslRequired": "none",
"enabled": true,
"eventsEnabled": true,
"eventsExpiration": 900,
"adminEventsEnabled": true,
"adminEventsDetailsEnabled": true,
"attributes": {
"adminEventsExpiration": "900"
},
"clients": [
{
"id": "atom-secondary",
"clientId": "atom-secondary",
"name": "atom-secondary",
"enabled": true,
"rootUrl": "http://docker-atom:63001",
"adminUrl": "http://docker-atom:63001",
"baseUrl": "http://docker-atom:63001",
"clientAuthenticatorType": "client-secret",
"secret": "example-secret",
"redirectUris": ["http://docker-atom:63001/*"],
"webOrigins": ["http://docker-atom:63001"],
"standardFlowEnabled": true,
"serviceAccountsEnabled": true,
"authorizationServicesEnabled": true,
"publicClient": false
}
],
"users": [
{
"id": "support",
"email": "[email protected]",
"username": "support",
"enabled": true,
"emailVerified": true,
"credentials": [
{
"temporary": false,
"type": "password",
"value": "support"
}
]
}
]
}
]

0 comments on commit c4aeffc

Please sign in to comment.