KeycloakContainer
from skipcheck_tm1_testcontainers import KeycloakContainer Keycloak in Docker, as the OpenID Connect provider for a CognosContainer's OIDC
namespace (CognosContainer.with_keycloak). Cognos builds a realm in it from its
test users when it starts.
Its issuer is its address on the shared Docker network, http://keycloak:8080,
whichever way it's reached, so Cognos accepts tokens that tests get through the
host-side port (id_token). The interactive (browser) logon would need a browser
that reaches that network address, so it isn't wrapped here.
Members
DEFAULT_IMAGE | The Keycloak image. |
IMAGE | Overrides the Keycloak image, e.g. |
HTTP_PORT | Keycloak's HTTP port inside the container. |
NETWORK_ALIAS | The container's name on its Docker network. |
REALM | The realm cognos-server builds from its test users. |
APP_CLIENT | The realm's client for applications. |
__init__ constructor | Keycloak on the default image (or KEYCLOAK_IMAGE), in development mode. |
network_url property | Keycloak as other containers on its network reach it. |
url property | Keycloak as seen from the host, such as http://localhost:54321, without a trailing slash. |
id_token | An ID token for a user of the realm, by password. |
DEFAULT_IMAGE
DEFAULT_IMAGE: ClassVar[str]The Keycloak image.
IMAGE
IMAGE: ClassVar[str]Overrides the Keycloak image, e.g. another version. Read as a system property, then an environment variable.
HTTP_PORT
HTTP_PORT: ClassVar[int]Keycloak's HTTP port inside the container.
NETWORK_ALIAS
NETWORK_ALIAS: ClassVar[str]The container's name on its Docker network.
REALM
REALM: ClassVar[str]The realm cognos-server builds from its test users.
APP_CLIENT
APP_CLIENT: ClassVar[str]The realm's client for applications: public, and its tokens include Cognos's client in their audience, which Cognos requires.
__init__
constructor__init__(image: str | None = None) -> NoneKeycloak on the default image (or KEYCLOAK_IMAGE), in development mode.
network_url
propertynetwork_url: strKeycloak as other containers on its network reach it: http://keycloak:8080. Also its issuer's base. No trailing slash.
url
propertyurl: strKeycloak as seen from the host, such as http://localhost:54321, without a trailing slash. Its admin console logs on as admin / admin.
id_token
id_token(user: str, password: str) -> strAn ID token for a user of the realm, by password.