testcontainers / testcontainers/testcontainers-python
Bug: Keycloak container fails with 'HTTPS required'
Nessuno ha ancora preso questa issue.
- Lingua principale
- Python
- Stelle
- 2.3k
- Fork
- 386
- Merge medio
- 4h 40m
- PR unite (30g)
- 1
Descrizione
Describe the bug
The basic example from Keycloak does not run.
There is actually another "solvable" bug that the library python-keycloak does not work on version 5.7.1 due to a missing import (KeycloakClient), and must be downgraded to 5.6.0
To Reproduce
I have used the exact example provided in the source code here:
from testcontainers.keycloak import KeycloakContainer
def test_keycloak_setup():
with KeycloakContainer(f"quay.io/keycloak/keycloak:25.0.4") as keycloak:
counts = keycloak.get_client().users_count()
print(counts)
I have also tried the example on the repo example_basic.py, and this one also does not run, but fails early since the API for the library has changed.
I understand that keycloak is sometimes a pain to setup with insecure options, and probably it needs extra options, but it's unclear from the docs that that is the case. Docs here:
https://testcontainers-python.readthedocs.io/en/latest/modules/keycloak/README.html
I could offer my help to tackle the issue for a working solution, the question is if the change is for documentation (keycloak is not expected to work out of the box) or configuration. It's also possible that it needs a realm import.
Runtime environment
# Get the operating system information (on a unix os).
$ uname -a
Darwin
# Get the python version.
$ python --version
3.10.11
# Get the docker version and other docker information.
$ docker info
Client:
Version: 28.3.2
Context: desktop-linux
Debug Mode: false
# Get all python packages.
$ pip freeze
testcontainers==4.12.0
python-keycloak==5.6.0
Guida per i contributori
Apri la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Direzione di ricerca
Inizia da modules/keycloak/testcontainers/keycloak/init.py e modules/keycloak/example_basic.py, quindi riproduci il problema usando Keycloak 25.0.4 e python-keycloak 5.6.0. Controlla il README di Keycloak collegato nell’issue e determina se la configurazione funzionante richiede modifiche alla configurazione o alla documentazione; il lavoro è completato quando l’esempio di base viene eseguito correttamente e la configurazione necessaria è chiara.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Valutazione
- Stack tecnologico
- docker, python
- Ambito
- authentication, testing
- Tipo di issue
- Bug
- Difficoltà
- 4/5
- Tempo stimato
- 3-5 giorni
- Stato di attività
- Ferma
- Chiarezza
- Da chiarire
- Idoneità per principianti
- 35/100