testcontainers / testcontainers/testcontainers-python
Bug: Keycloak container fails with 'HTTPS required'
Chưa có ai nhận issue này.
- Ngôn ngữ chính
- Python
- Star
- 2.3k
- Fork
- 386
- Merge trung bình
- 4 giờ 40 phút
- Pull request đã merge (30 ngày)
- 1
Mô tả
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
Hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Hướng nghiên cứu
Bắt đầu với modules/keycloak/testcontainers/keycloak/init.py và modules/keycloak/example_basic.py, sau đó tái hiện lỗi bằng Keycloak 25.0.4 và python-keycloak 5.6.0. Kiểm tra README của Keycloak được liên kết trong issue và xác định xem thiết lập hoạt động có yêu cầu thay đổi về cấu hình hoặc tài liệu hay không; hoàn tất khi ví dụ cơ bản chạy thành công và thiết lập cần thiết đã rõ ràng.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Đánh giá
- Công nghệ
- docker, python
- Lĩnh vực
- authentication, testing
- Loại issue
- Lỗi
- Độ khó
- 4/5
- Thời gian dự kiến
- 3-5 ngày
- Mức độ hoạt động
- Đình trệ
- Độ rõ ràng
- Cần làm rõ
- Mức phù hợp với người mới
- 35/100