mirror of
https://github.com/ansible-middleware/keycloak.git
synced 2026-06-13 20:15:55 +00:00
remove normalize_keycloak_url
This commit is contained in:
@@ -154,18 +154,6 @@ URL_AUTHZ_CUSTOM_POLICY = "{url}/admin/realms/{realm}/clients/{client_id}/authz/
|
|||||||
URL_AUTHZ_CUSTOM_POLICIES = "{url}/admin/realms/{realm}/clients/{client_id}/authz/resource-server/policy"
|
URL_AUTHZ_CUSTOM_POLICIES = "{url}/admin/realms/{realm}/clients/{client_id}/authz/resource-server/policy"
|
||||||
|
|
||||||
|
|
||||||
def normalize_keycloak_url(url: str) -> str:
|
|
||||||
"""Normalize Keycloak base URL for Admin REST API access.
|
|
||||||
|
|
||||||
Keycloak 17+ (Quarkus) exposes the API at the server root without an /auth prefix.
|
|
||||||
WildFly-based Keycloak used /auth as the context path. Trailing slashes are removed.
|
|
||||||
"""
|
|
||||||
url = url.rstrip("/")
|
|
||||||
if url.endswith("/auth"):
|
|
||||||
return url[:-5]
|
|
||||||
return url
|
|
||||||
|
|
||||||
|
|
||||||
def keycloak_argument_spec() -> dict[str, t.Any]:
|
def keycloak_argument_spec() -> dict[str, t.Any]:
|
||||||
"""
|
"""
|
||||||
Returns argument_spec of options common to keycloak_*-modules
|
Returns argument_spec of options common to keycloak_*-modules
|
||||||
@@ -403,7 +391,7 @@ class KeycloakAPI:
|
|||||||
|
|
||||||
def __init__(self, module: AnsibleModule, connection_header: dict[str, str]) -> None:
|
def __init__(self, module: AnsibleModule, connection_header: dict[str, str]) -> None:
|
||||||
self.module = module
|
self.module = module
|
||||||
self.baseurl = normalize_keycloak_url(self.module.params.get("auth_keycloak_url"))
|
self.baseurl = self.module.params.get("auth_keycloak_url")
|
||||||
self.validate_certs = self.module.params.get("validate_certs")
|
self.validate_certs = self.module.params.get("validate_certs")
|
||||||
self.connection_timeout = self.module.params.get("connection_timeout")
|
self.connection_timeout = self.module.params.get("connection_timeout")
|
||||||
self.restheaders = connection_header
|
self.restheaders = connection_header
|
||||||
|
|||||||
Reference in New Issue
Block a user