keycloak-agent 2.3.2__tar.gz → 2.3.4__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {keycloak_agent-2.3.2 → keycloak_agent-2.3.4}/PKG-INFO +3 -7
- keycloak_agent-2.3.4/keycloak_agent/__init__.py +17 -0
- keycloak_agent-2.3.4/keycloak_agent/__main__.py +4 -0
- {keycloak_agent-2.3.2 → keycloak_agent-2.3.4}/keycloak_agent/api_client.py +0 -2
- keycloak_agent-2.3.4/keycloak_agent/connector_sources.py +102 -0
- {keycloak_agent-2.3.2 → keycloak_agent-2.3.4}/keycloak_agent/kg_ingest.py +6 -60
- keycloak_agent-2.3.4/keycloak_agent/mcp_server.py +33 -0
- {keycloak_agent-2.3.2 → keycloak_agent-2.3.4}/keycloak_agent/ontology/certification.json +6 -9
- {keycloak_agent-2.3.2 → keycloak_agent-2.3.4}/keycloak_agent/ontology/keycloak.ttl +3 -5
- {keycloak_agent-2.3.2 → keycloak_agent-2.3.4}/keycloak_agent/ontology/mappings/source.yaml +1 -1
- {keycloak_agent-2.3.2 → keycloak_agent-2.3.4}/keycloak_agent.egg-info/PKG-INFO +3 -7
- {keycloak_agent-2.3.2 → keycloak_agent-2.3.4}/keycloak_agent.egg-info/SOURCES.txt +1 -8
- keycloak_agent-2.3.4/keycloak_agent.egg-info/entry_points.txt +5 -0
- keycloak_agent-2.3.4/keycloak_agent.egg-info/requires.txt +8 -0
- {keycloak_agent-2.3.2 → keycloak_agent-2.3.4}/keycloak_agent.egg-info/top_level.txt +0 -1
- {keycloak_agent-2.3.2 → keycloak_agent-2.3.4}/pyproject.toml +6 -17
- {keycloak_agent-2.3.2 → keycloak_agent-2.3.4}/tests/test_fleet_name.py +3 -14
- {keycloak_agent-2.3.2 → keycloak_agent-2.3.4}/tests/test_kg_ingest.py +6 -6
- keycloak_agent-2.3.4/tests/test_mcp_server.py +11 -0
- keycloak_agent-2.3.4/tests/test_startup.py +8 -0
- keycloak_agent-2.3.2/keycloak_agent/__init__.py +0 -80
- keycloak_agent-2.3.2/keycloak_agent/__main__.py +0 -4
- keycloak_agent-2.3.2/keycloak_agent/connectors/__init__.py +0 -0
- keycloak_agent-2.3.2/keycloak_agent/connectors/mcp_source_presets.json +0 -14
- keycloak_agent-2.3.2/keycloak_agent/connectors/tool_schema_fingerprints.json +0 -8
- keycloak_agent-2.3.2/keycloak_agent/mcp_server.py +0 -89
- keycloak_agent-2.3.2/keycloak_agent/prompts/__init__.py +0 -0
- keycloak_agent-2.3.2/keycloak_agent/skills/__init__.py +0 -0
- keycloak_agent-2.3.2/keycloak_agent.egg-info/entry_points.txt +0 -14
- keycloak_agent-2.3.2/keycloak_agent.egg-info/requires.txt +0 -14
- keycloak_agent-2.3.2/scripts/security_sanitizer.py +0 -316
- keycloak_agent-2.3.2/tests/test_default_content_surfaces.py +0 -43
- keycloak_agent-2.3.2/tests/test_init_dynamics.py +0 -8
- keycloak_agent-2.3.2/tests/test_mcp_server.py +0 -27
- keycloak_agent-2.3.2/tests/test_startup.py +0 -15
- {keycloak_agent-2.3.2 → keycloak_agent-2.3.4}/LICENSE +0 -0
- {keycloak_agent-2.3.2 → keycloak_agent-2.3.4}/README.md +0 -0
- {keycloak_agent-2.3.2 → keycloak_agent-2.3.4}/keycloak_agent/api/__init__.py +0 -0
- {keycloak_agent-2.3.2 → keycloak_agent-2.3.4}/keycloak_agent/api/api_client_base.py +0 -0
- {keycloak_agent-2.3.2 → keycloak_agent-2.3.4}/keycloak_agent/api/api_client_clients.py +0 -0
- {keycloak_agent-2.3.2 → keycloak_agent-2.3.4}/keycloak_agent/api/api_client_realms.py +0 -0
- {keycloak_agent-2.3.2 → keycloak_agent-2.3.4}/keycloak_agent/api/api_client_users.py +0 -0
- {keycloak_agent-2.3.2 → keycloak_agent-2.3.4}/keycloak_agent/auth.py +0 -0
- {keycloak_agent-2.3.2 → keycloak_agent-2.3.4}/keycloak_agent/mcp/__init__.py +0 -0
- {keycloak_agent-2.3.2 → keycloak_agent-2.3.4}/keycloak_agent/mcp/mcp_attack_detection.py +0 -0
- {keycloak_agent-2.3.2 → keycloak_agent-2.3.4}/keycloak_agent/mcp/mcp_authentication.py +0 -0
- {keycloak_agent-2.3.2 → keycloak_agent-2.3.4}/keycloak_agent/mcp/mcp_clients.py +0 -0
- {keycloak_agent-2.3.2 → keycloak_agent-2.3.4}/keycloak_agent/mcp/mcp_components.py +0 -0
- {keycloak_agent-2.3.2 → keycloak_agent-2.3.4}/keycloak_agent/mcp/mcp_groups.py +0 -0
- {keycloak_agent-2.3.2 → keycloak_agent-2.3.4}/keycloak_agent/mcp/mcp_idps.py +0 -0
- {keycloak_agent-2.3.2 → keycloak_agent-2.3.4}/keycloak_agent/mcp/mcp_info.py +0 -0
- {keycloak_agent-2.3.2 → keycloak_agent-2.3.4}/keycloak_agent/mcp/mcp_ingest.py +0 -0
- {keycloak_agent-2.3.2 → keycloak_agent-2.3.4}/keycloak_agent/mcp/mcp_organizations.py +0 -0
- {keycloak_agent-2.3.2 → keycloak_agent-2.3.4}/keycloak_agent/mcp/mcp_realms.py +0 -0
- {keycloak_agent-2.3.2 → keycloak_agent-2.3.4}/keycloak_agent/mcp/mcp_roles.py +0 -0
- {keycloak_agent-2.3.2 → keycloak_agent-2.3.4}/keycloak_agent/mcp/mcp_users.py +0 -0
- {keycloak_agent-2.3.2 → keycloak_agent-2.3.4}/keycloak_agent/mcp_config.json +0 -0
- {keycloak_agent-2.3.2 → keycloak_agent-2.3.4}/keycloak_agent/models.py +0 -0
- {keycloak_agent-2.3.2 → keycloak_agent-2.3.4}/keycloak_agent/ontology/__init__.py +0 -0
- {keycloak_agent-2.3.2 → keycloak_agent-2.3.4}/keycloak_agent/ontology/fixtures/records.json +0 -0
- {keycloak_agent-2.3.2 → keycloak_agent-2.3.4}/keycloak_agent/ontology/migrations/manifest.json +0 -0
- {keycloak_agent-2.3.2 → keycloak_agent-2.3.4}/keycloak_agent/ontology/shapes/connector.shacl.ttl +0 -0
- {keycloak_agent-2.3.2 → keycloak_agent-2.3.4}/keycloak_agent/skills/keycloak-agent-operations/SKILL.md +0 -0
- {keycloak_agent-2.3.2 → keycloak_agent-2.3.4}/keycloak_agent/skills/keycloak-agent-operations/agents/openai.yaml +0 -0
- {keycloak_agent-2.3.2 → keycloak_agent-2.3.4}/keycloak_agent/skills/keycloak-agent-operations/references/catalog.md +0 -0
- {keycloak_agent-2.3.2 → keycloak_agent-2.3.4}/keycloak_agent/skills/keycloak-client-onboarder/SKILL.md +0 -0
- {keycloak_agent-2.3.2 → keycloak_agent-2.3.4}/keycloak_agent/skills/keycloak-client-onboarder/WORKFLOW.md +0 -0
- {keycloak_agent-2.3.2 → keycloak_agent-2.3.4}/keycloak_agent.egg-info/dependency_links.txt +0 -0
- {keycloak_agent-2.3.2 → keycloak_agent-2.3.4}/setup.cfg +0 -0
- {keycloak_agent-2.3.2 → keycloak_agent-2.3.4}/tests/conftest.py +0 -0
- {keycloak_agent-2.3.2 → keycloak_agent-2.3.4}/tests/test_admin_token_refresh.py +0 -0
- {keycloak_agent-2.3.2 → keycloak_agent-2.3.4}/tests/test_api_client.py +0 -0
- {keycloak_agent-2.3.2 → keycloak_agent-2.3.4}/tests/test_identity_realm_scoping.py +0 -0
- {keycloak_agent-2.3.2 → keycloak_agent-2.3.4}/tests/test_regenerate_client_secret.py +0 -0
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: keycloak-agent
|
|
3
|
-
Version: 2.3.
|
|
3
|
+
Version: 2.3.4
|
|
4
4
|
Summary: Keycloak Identity MCP Server and Agent for Agentic AI!
|
|
5
|
-
Author-email:
|
|
5
|
+
Author-email: Repository Maintainers <maintainers@knuckles.team>
|
|
6
6
|
License: MIT
|
|
7
7
|
Classifier: Development Status :: 4 - Beta
|
|
8
8
|
Classifier: License :: OSI Approved :: MIT License
|
|
@@ -12,12 +12,8 @@ Classifier: Programming Language :: Python :: 3
|
|
|
12
12
|
Requires-Python: >=3.12
|
|
13
13
|
Description-Content-Type: text/markdown
|
|
14
14
|
License-File: LICENSE
|
|
15
|
-
Requires-Dist: agent-connector-sdk[mcp]<
|
|
15
|
+
Requires-Dist: agent-connector-sdk[mcp]<0.6.0,>=0.5.4
|
|
16
16
|
Requires-Dist: requests>=2.34.2
|
|
17
|
-
Provides-Extra: mcp
|
|
18
|
-
Requires-Dist: agent-connector-sdk[mcp]<1.0.0,>=0.3.18; extra == "mcp"
|
|
19
|
-
Provides-Extra: all
|
|
20
|
-
Requires-Dist: agent-connector-sdk[mcp]<1.0.0,>=0.3.18; extra == "all"
|
|
21
17
|
Provides-Extra: test
|
|
22
18
|
Requires-Dist: pytest-xdist>=3.8.0; extra == "test"
|
|
23
19
|
Requires-Dist: pytest>=9.1.1; extra == "test"
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"""CONCEPT:AU-ECO.messaging.native-backend-abstraction Unified ecosystem initialization dynamic check."""
|
|
2
|
+
|
|
3
|
+
from agent_connector_sdk.connector import Connector
|
|
4
|
+
|
|
5
|
+
from keycloak_agent.api_client import Api
|
|
6
|
+
from keycloak_agent.auth import get_client
|
|
7
|
+
|
|
8
|
+
connector = Connector(
|
|
9
|
+
api=Api,
|
|
10
|
+
get_client=get_client,
|
|
11
|
+
tools="keycloak_agent.mcp_server",
|
|
12
|
+
instructions="Keycloak Agent MCP Server - Managed dynamic operations.",
|
|
13
|
+
transports=(
|
|
14
|
+
"stdio",
|
|
15
|
+
"streamable-http",
|
|
16
|
+
),
|
|
17
|
+
)
|
|
@@ -5,8 +5,6 @@ from keycloak_agent.api.api_client_clients import Api as ClientsApi
|
|
|
5
5
|
from keycloak_agent.api.api_client_realms import Api as RealmsApi
|
|
6
6
|
from keycloak_agent.api.api_client_users import Api as UsersApi
|
|
7
7
|
|
|
8
|
-
__version__ = "2.3.2"
|
|
9
|
-
|
|
10
8
|
|
|
11
9
|
class Api(RealmsApi, UsersApi, ClientsApi):
|
|
12
10
|
pass
|
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
"""Data sources of this connector, declared by tool name (generated by connector-ontology-map migrate).
|
|
2
|
+
|
|
3
|
+
Served live as ``connector://resources``. Regenerate by editing the declarations, not the tools.
|
|
4
|
+
"""
|
|
5
|
+
|
|
6
|
+
# ruff: noqa: E501
|
|
7
|
+
from __future__ import annotations
|
|
8
|
+
|
|
9
|
+
from agent_connector_sdk.ingest.live_declaration import source_meta
|
|
10
|
+
|
|
11
|
+
SOURCES = (
|
|
12
|
+
source_meta(
|
|
13
|
+
tool="keycloak_list_realms",
|
|
14
|
+
source_id="keycloak-realms",
|
|
15
|
+
record_type="Realm",
|
|
16
|
+
id_field="realm",
|
|
17
|
+
cursor_field="",
|
|
18
|
+
preset={
|
|
19
|
+
"doc_type": "keycloak_realm",
|
|
20
|
+
"params_style": "args",
|
|
21
|
+
},
|
|
22
|
+
records_path="",
|
|
23
|
+
server="keycloak-mcp",
|
|
24
|
+
text_field="realm",
|
|
25
|
+
title_field="displayName",
|
|
26
|
+
),
|
|
27
|
+
)
|
|
28
|
+
|
|
29
|
+
SCHEMA_VERSION = 2
|
|
30
|
+
|
|
31
|
+
FIELD_SETS = {
|
|
32
|
+
"fields_1": {
|
|
33
|
+
"clientId": "xsd:string",
|
|
34
|
+
"email": "xsd:string",
|
|
35
|
+
"enabled": "xsd:boolean",
|
|
36
|
+
"groupPath": "xsd:string",
|
|
37
|
+
"protocol": "xsd:string",
|
|
38
|
+
"publicClient": "xsd:boolean",
|
|
39
|
+
"realmName": "xsd:string",
|
|
40
|
+
"username": "xsd:string",
|
|
41
|
+
},
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
SCHEMA_MAPPINGS = {
|
|
45
|
+
"Client": {
|
|
46
|
+
"field_sets": ["fields_1"],
|
|
47
|
+
"ontology_class": None,
|
|
48
|
+
},
|
|
49
|
+
"Group": {
|
|
50
|
+
"field_sets": ["fields_1"],
|
|
51
|
+
"ontology_class": "Organization",
|
|
52
|
+
},
|
|
53
|
+
"IdentityProvider": {
|
|
54
|
+
"field_sets": ["fields_1"],
|
|
55
|
+
"ontology_class": None,
|
|
56
|
+
},
|
|
57
|
+
"Realm": {
|
|
58
|
+
"field_sets": ["fields_1"],
|
|
59
|
+
"ontology_class": None,
|
|
60
|
+
},
|
|
61
|
+
"Role": {
|
|
62
|
+
"field_sets": ["fields_1"],
|
|
63
|
+
"ontology_class": "Role",
|
|
64
|
+
},
|
|
65
|
+
"User": {
|
|
66
|
+
"field_sets": ["fields_1"],
|
|
67
|
+
"ontology_class": "Person",
|
|
68
|
+
},
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
RESOURCES = (
|
|
72
|
+
{
|
|
73
|
+
"id_prefix": "client",
|
|
74
|
+
"label": "Client",
|
|
75
|
+
"name": "Client",
|
|
76
|
+
},
|
|
77
|
+
{
|
|
78
|
+
"id_prefix": "group",
|
|
79
|
+
"label": "Group",
|
|
80
|
+
"name": "Group",
|
|
81
|
+
},
|
|
82
|
+
{
|
|
83
|
+
"id_prefix": "identityprovider",
|
|
84
|
+
"label": "Identity Provider",
|
|
85
|
+
"name": "IdentityProvider",
|
|
86
|
+
},
|
|
87
|
+
{
|
|
88
|
+
"id_prefix": "realm",
|
|
89
|
+
"label": "Realm",
|
|
90
|
+
"name": "Realm",
|
|
91
|
+
},
|
|
92
|
+
{
|
|
93
|
+
"id_prefix": "role",
|
|
94
|
+
"label": "Role",
|
|
95
|
+
"name": "Role",
|
|
96
|
+
},
|
|
97
|
+
{
|
|
98
|
+
"id_prefix": "user",
|
|
99
|
+
"label": "Keycloak User",
|
|
100
|
+
"name": "User",
|
|
101
|
+
},
|
|
102
|
+
)
|
|
@@ -10,65 +10,11 @@ from __future__ import annotations
|
|
|
10
10
|
from typing import Any
|
|
11
11
|
|
|
12
12
|
from agent_connector_sdk.ingest import (
|
|
13
|
-
ChangeSet,
|
|
14
|
-
Entity,
|
|
15
|
-
IngestBinding,
|
|
16
|
-
IngestError,
|
|
17
13
|
KnowledgeIngest,
|
|
18
|
-
|
|
19
|
-
current_ingest,
|
|
14
|
+
SourceStream,
|
|
20
15
|
)
|
|
21
16
|
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
_ENTITY_RESERVED_KEYS = frozenset({"id", "node_type"})
|
|
25
|
-
_RELATIONSHIP_RESERVED_KEYS = frozenset({"source", "target", "relationship"})
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
def _to_entity(record: dict[str, Any]) -> Entity:
|
|
29
|
-
return Entity(
|
|
30
|
-
id=record.get("id"),
|
|
31
|
-
node_type=record.get("node_type"),
|
|
32
|
-
properties={
|
|
33
|
-
key: value
|
|
34
|
-
for key, value in record.items()
|
|
35
|
-
if key not in _ENTITY_RESERVED_KEYS
|
|
36
|
-
},
|
|
37
|
-
)
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
def _to_relationship(record: dict[str, Any]) -> Relationship:
|
|
41
|
-
properties = {
|
|
42
|
-
key: value
|
|
43
|
-
for key, value in record.items()
|
|
44
|
-
if key not in _RELATIONSHIP_RESERVED_KEYS
|
|
45
|
-
}
|
|
46
|
-
return Relationship(
|
|
47
|
-
source=record["source"],
|
|
48
|
-
target=record["target"],
|
|
49
|
-
relationship=record["relationship"],
|
|
50
|
-
properties=properties or None,
|
|
51
|
-
)
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
async def ingest_entities(
|
|
55
|
-
entities: list[dict[str, Any]],
|
|
56
|
-
relationships: list[dict[str, Any]] | None = None,
|
|
57
|
-
*,
|
|
58
|
-
ingest: KnowledgeIngest | None = None,
|
|
59
|
-
) -> dict[str, int]:
|
|
60
|
-
"""Write canonical typed nodes and relationships through the SDK ingest facade."""
|
|
61
|
-
if not entities:
|
|
62
|
-
raise IngestError("ingest_entities needs at least one entity")
|
|
63
|
-
change_set = ChangeSet(
|
|
64
|
-
entities=tuple(_to_entity(entity) for entity in entities),
|
|
65
|
-
relationships=tuple(
|
|
66
|
-
_to_relationship(relationship) for relationship in relationships or ()
|
|
67
|
-
),
|
|
68
|
-
)
|
|
69
|
-
service = ingest or current_ingest()
|
|
70
|
-
receipt = await service.submit(_BINDING, change_set)
|
|
71
|
-
return {"nodes": receipt.affected_count, "edges": receipt.relationship_count}
|
|
17
|
+
STREAM = SourceStream.for_package(__package__.split(".")[0], "keycloak")
|
|
72
18
|
|
|
73
19
|
|
|
74
20
|
def _realm_of(record: dict[str, Any], realm: str | None) -> str | None:
|
|
@@ -99,7 +45,7 @@ async def ingest_realms(
|
|
|
99
45
|
)
|
|
100
46
|
if not entities:
|
|
101
47
|
return None
|
|
102
|
-
return await
|
|
48
|
+
return await STREAM.entities(entities, ingest=ingest)
|
|
103
49
|
|
|
104
50
|
|
|
105
51
|
async def ingest_users(
|
|
@@ -146,7 +92,7 @@ async def ingest_users(
|
|
|
146
92
|
)
|
|
147
93
|
if not entities:
|
|
148
94
|
return None
|
|
149
|
-
return await
|
|
95
|
+
return await STREAM.entities(entities, relationships, ingest=ingest)
|
|
150
96
|
|
|
151
97
|
|
|
152
98
|
async def ingest_clients(
|
|
@@ -193,7 +139,7 @@ async def ingest_clients(
|
|
|
193
139
|
)
|
|
194
140
|
if not entities:
|
|
195
141
|
return None
|
|
196
|
-
return await
|
|
142
|
+
return await STREAM.entities(entities, relationships, ingest=ingest)
|
|
197
143
|
|
|
198
144
|
|
|
199
145
|
async def ingest_groups(
|
|
@@ -250,4 +196,4 @@ async def ingest_groups(
|
|
|
250
196
|
_walk(grp, None)
|
|
251
197
|
if not entities:
|
|
252
198
|
return None
|
|
253
|
-
return await
|
|
199
|
+
return await STREAM.entities(entities, relationships, ingest=ingest)
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
"""Main FastMCP server and tool registration."""
|
|
2
|
+
|
|
3
|
+
from keycloak_agent.mcp import (
|
|
4
|
+
register_attack_detection_tools,
|
|
5
|
+
register_authentication_tools,
|
|
6
|
+
register_clients_tools,
|
|
7
|
+
register_components_tools,
|
|
8
|
+
register_groups_tools,
|
|
9
|
+
register_idps_tools,
|
|
10
|
+
register_info_tools,
|
|
11
|
+
register_ingest_tools,
|
|
12
|
+
register_organizations_tools,
|
|
13
|
+
register_realms_tools,
|
|
14
|
+
register_roles_tools,
|
|
15
|
+
register_users_tools,
|
|
16
|
+
)
|
|
17
|
+
|
|
18
|
+
# Re-exported so register_tool_surface(tools_module=...) auto-discovers them as
|
|
19
|
+
# module attributes (and ruff treats the imports as used).
|
|
20
|
+
__all__ = [
|
|
21
|
+
"register_attack_detection_tools",
|
|
22
|
+
"register_authentication_tools",
|
|
23
|
+
"register_clients_tools",
|
|
24
|
+
"register_components_tools",
|
|
25
|
+
"register_groups_tools",
|
|
26
|
+
"register_idps_tools",
|
|
27
|
+
"register_info_tools",
|
|
28
|
+
"register_ingest_tools",
|
|
29
|
+
"register_organizations_tools",
|
|
30
|
+
"register_realms_tools",
|
|
31
|
+
"register_roles_tools",
|
|
32
|
+
"register_users_tools",
|
|
33
|
+
]
|
|
@@ -1,12 +1,9 @@
|
|
|
1
1
|
{
|
|
2
|
-
"api_version": "
|
|
2
|
+
"api_version": "graphos.io/v1",
|
|
3
3
|
"artifacts": {
|
|
4
|
-
"connector_manifest.yml": "369b6a23d8ac26fd93bb86ffd371676233d57dafb41d3457a34f4911832617a7",
|
|
5
|
-
"keycloak_agent/connectors/mcp_source_presets.json": "9d026409234178229af3954a9b8eb138de36b9de5900a0204ac064481da44228",
|
|
6
|
-
"keycloak_agent/connectors/tool_schema_fingerprints.json": "8e54885a90fa152664f09b8fd2af9553320014e41f2420d57b0fe855d5875b9b",
|
|
7
4
|
"keycloak_agent/ontology/fixtures/records.json": "b805feca91bdac2f51386c2d2fb1308b1b1414752db55b414af2b2bb328e9eb8",
|
|
8
|
-
"keycloak_agent/ontology/keycloak.ttl": "
|
|
9
|
-
"keycloak_agent/ontology/mappings/source.yaml": "
|
|
5
|
+
"keycloak_agent/ontology/keycloak.ttl": "8e70511942c51509adbb52780dcc00634e0121e149291bc15f5878070089554d",
|
|
6
|
+
"keycloak_agent/ontology/mappings/source.yaml": "2a172caca23a45a5ab50a43632016487d0b5c63744436ef5b377c60ecc13353e",
|
|
10
7
|
"keycloak_agent/ontology/migrations/manifest.json": "36b70830a8ee004be7dbbada0bd6155586b3d2d61ec935f0f1327978e96685f1",
|
|
11
8
|
"keycloak_agent/ontology/shapes/connector.shacl.ttl": "f1592430e0f27fbe0867b31e93854166ff7a7fd6f6a41d8fbea0c1870ec3a20e"
|
|
12
9
|
},
|
|
@@ -18,11 +15,11 @@
|
|
|
18
15
|
"synthetic_fixture_contract": "passed"
|
|
19
16
|
},
|
|
20
17
|
"compatibility": {
|
|
21
|
-
"
|
|
18
|
+
"agent_utilities": ">=2.5.0,<3",
|
|
22
19
|
"bundle_schema": "2",
|
|
23
20
|
"epistemic_graph": ">=2.27.0,<3"
|
|
24
21
|
},
|
|
25
|
-
"connector": "keycloak-
|
|
22
|
+
"connector": "keycloak-agent",
|
|
26
23
|
"kind": "ConnectorSourceAttestation",
|
|
27
24
|
"live_certified": false,
|
|
28
25
|
"mode": "offline-source",
|
|
@@ -32,5 +29,5 @@
|
|
|
32
29
|
"signer": "UNSIGNED-PREVIEW",
|
|
33
30
|
"signing_public_key": "",
|
|
34
31
|
"status": "source-validated",
|
|
35
|
-
"validated_at": "2026-
|
|
32
|
+
"validated_at": "2026-10-24T10:45:13Z"
|
|
36
33
|
}
|
|
@@ -29,9 +29,8 @@
|
|
|
29
29
|
rdfs:label "Group" ;
|
|
30
30
|
rdfs:comment "A hierarchical collection of users used to grant roles and attributes in bulk (keycloak_agent_groups)." .
|
|
31
31
|
|
|
32
|
-
:Role a owl:Class
|
|
33
|
-
|
|
34
|
-
rdfs:comment "A realm-level or client-level role granting permissions to users, groups or composite roles (keycloak_agent_roles)." .
|
|
32
|
+
:Role a owl:Class .
|
|
33
|
+
|
|
35
34
|
|
|
36
35
|
:IdentityProvider a owl:Class ;
|
|
37
36
|
rdfs:label "Identity Provider" ;
|
|
@@ -119,5 +118,4 @@
|
|
|
119
118
|
rdfs:label "Keycloak Identity & Access Management Ontology" ;
|
|
120
119
|
rdfs:comment """Keycloak IAM model — realms, users, clients, groups, roles and
|
|
121
120
|
federated identity providers, with their ownership and membership relationships —
|
|
122
|
-
federated into the agent-connector-sdk knowledge-graph hub."""
|
|
123
|
-
owl:imports <http://knuckles.team/kg> .
|
|
121
|
+
federated into the agent-connector-sdk knowledge-graph hub.""" .
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: keycloak-agent
|
|
3
|
-
Version: 2.3.
|
|
3
|
+
Version: 2.3.4
|
|
4
4
|
Summary: Keycloak Identity MCP Server and Agent for Agentic AI!
|
|
5
|
-
Author-email:
|
|
5
|
+
Author-email: Repository Maintainers <maintainers@knuckles.team>
|
|
6
6
|
License: MIT
|
|
7
7
|
Classifier: Development Status :: 4 - Beta
|
|
8
8
|
Classifier: License :: OSI Approved :: MIT License
|
|
@@ -12,12 +12,8 @@ Classifier: Programming Language :: Python :: 3
|
|
|
12
12
|
Requires-Python: >=3.12
|
|
13
13
|
Description-Content-Type: text/markdown
|
|
14
14
|
License-File: LICENSE
|
|
15
|
-
Requires-Dist: agent-connector-sdk[mcp]<
|
|
15
|
+
Requires-Dist: agent-connector-sdk[mcp]<0.6.0,>=0.5.4
|
|
16
16
|
Requires-Dist: requests>=2.34.2
|
|
17
|
-
Provides-Extra: mcp
|
|
18
|
-
Requires-Dist: agent-connector-sdk[mcp]<1.0.0,>=0.3.18; extra == "mcp"
|
|
19
|
-
Provides-Extra: all
|
|
20
|
-
Requires-Dist: agent-connector-sdk[mcp]<1.0.0,>=0.3.18; extra == "all"
|
|
21
17
|
Provides-Extra: test
|
|
22
18
|
Requires-Dist: pytest-xdist>=3.8.0; extra == "test"
|
|
23
19
|
Requires-Dist: pytest>=9.1.1; extra == "test"
|
|
@@ -5,6 +5,7 @@ keycloak_agent/__init__.py
|
|
|
5
5
|
keycloak_agent/__main__.py
|
|
6
6
|
keycloak_agent/api_client.py
|
|
7
7
|
keycloak_agent/auth.py
|
|
8
|
+
keycloak_agent/connector_sources.py
|
|
8
9
|
keycloak_agent/kg_ingest.py
|
|
9
10
|
keycloak_agent/mcp_config.json
|
|
10
11
|
keycloak_agent/mcp_server.py
|
|
@@ -20,9 +21,6 @@ keycloak_agent/api/api_client_base.py
|
|
|
20
21
|
keycloak_agent/api/api_client_clients.py
|
|
21
22
|
keycloak_agent/api/api_client_realms.py
|
|
22
23
|
keycloak_agent/api/api_client_users.py
|
|
23
|
-
keycloak_agent/connectors/__init__.py
|
|
24
|
-
keycloak_agent/connectors/mcp_source_presets.json
|
|
25
|
-
keycloak_agent/connectors/tool_schema_fingerprints.json
|
|
26
24
|
keycloak_agent/mcp/__init__.py
|
|
27
25
|
keycloak_agent/mcp/mcp_attack_detection.py
|
|
28
26
|
keycloak_agent/mcp/mcp_authentication.py
|
|
@@ -43,21 +41,16 @@ keycloak_agent/ontology/fixtures/records.json
|
|
|
43
41
|
keycloak_agent/ontology/mappings/source.yaml
|
|
44
42
|
keycloak_agent/ontology/migrations/manifest.json
|
|
45
43
|
keycloak_agent/ontology/shapes/connector.shacl.ttl
|
|
46
|
-
keycloak_agent/prompts/__init__.py
|
|
47
|
-
keycloak_agent/skills/__init__.py
|
|
48
44
|
keycloak_agent/skills/keycloak-agent-operations/SKILL.md
|
|
49
45
|
keycloak_agent/skills/keycloak-agent-operations/agents/openai.yaml
|
|
50
46
|
keycloak_agent/skills/keycloak-agent-operations/references/catalog.md
|
|
51
47
|
keycloak_agent/skills/keycloak-client-onboarder/SKILL.md
|
|
52
48
|
keycloak_agent/skills/keycloak-client-onboarder/WORKFLOW.md
|
|
53
|
-
scripts/security_sanitizer.py
|
|
54
49
|
tests/conftest.py
|
|
55
50
|
tests/test_admin_token_refresh.py
|
|
56
51
|
tests/test_api_client.py
|
|
57
|
-
tests/test_default_content_surfaces.py
|
|
58
52
|
tests/test_fleet_name.py
|
|
59
53
|
tests/test_identity_realm_scoping.py
|
|
60
|
-
tests/test_init_dynamics.py
|
|
61
54
|
tests/test_kg_ingest.py
|
|
62
55
|
tests/test_mcp_server.py
|
|
63
56
|
tests/test_regenerate_client_secret.py
|
|
@@ -4,39 +4,28 @@ build-backend = "setuptools.build_meta"
|
|
|
4
4
|
|
|
5
5
|
[project]
|
|
6
6
|
name = "keycloak-agent"
|
|
7
|
-
version = "2.3.
|
|
7
|
+
version = "2.3.4"
|
|
8
8
|
description = "Keycloak Identity MCP Server and Agent for Agentic AI!"
|
|
9
9
|
readme = "README.md"
|
|
10
10
|
classifiers = [ "Development Status :: 4 - Beta", "License :: OSI Approved :: MIT License", "Environment :: Console", "Operating System :: POSIX :: Linux", "Programming Language :: Python :: 3",]
|
|
11
11
|
requires-python = ">=3.12"
|
|
12
|
-
dependencies = [ "agent-connector-sdk[mcp]>=0.
|
|
12
|
+
dependencies = [ "agent-connector-sdk[mcp]>=0.5.4,<0.6.0", "requests>=2.34.2",]
|
|
13
13
|
[[project.authors]]
|
|
14
|
-
name = "
|
|
15
|
-
email = "maintainers@
|
|
14
|
+
name = "Repository Maintainers"
|
|
15
|
+
email = "maintainers@knuckles.team"
|
|
16
16
|
|
|
17
17
|
[project.license]
|
|
18
18
|
text = "MIT"
|
|
19
19
|
|
|
20
20
|
[project.optional-dependencies]
|
|
21
|
-
mcp = [ "agent-connector-sdk[mcp]>=0.3.18,<1.0.0",]
|
|
22
|
-
all = [ "agent-connector-sdk[mcp]>=0.3.18,<1.0.0",]
|
|
23
21
|
test = [ "pytest-xdist>=3.8.0", "pytest>=9.1.1", "pytest-asyncio>=1.4.0", "pytest-cov>=7.1.0",]
|
|
24
22
|
|
|
25
23
|
[project.scripts]
|
|
26
|
-
keycloak-mcp = "
|
|
27
|
-
|
|
28
|
-
[project.entry-points."agent_connector_sdk.skill_providers"]
|
|
29
|
-
keycloak-agent = "keycloak_agent.skills"
|
|
30
|
-
|
|
31
|
-
[project.entry-points."agent_connector_sdk.ontology_providers"]
|
|
32
|
-
keycloak-agent = "keycloak_agent.ontology"
|
|
33
|
-
|
|
34
|
-
[project.entry-points."agent_connector_sdk.source_connector_providers"]
|
|
35
|
-
keycloak-agent = "keycloak_agent.connectors"
|
|
24
|
+
keycloak-mcp = "agent_connector_sdk.cli:serve"
|
|
36
25
|
|
|
37
26
|
# The one declared connector identity: the fleet name (SDK-CONNECTOR-CONTROL-R071).
|
|
38
27
|
[project.entry-points."agent_connector_sdk.connector"]
|
|
39
|
-
keycloak-mcp = "keycloak_agent"
|
|
28
|
+
keycloak-mcp = "keycloak_agent:connector"
|
|
40
29
|
|
|
41
30
|
[tool.uv.workspace]
|
|
42
31
|
members = ["."]
|
|
@@ -3,12 +3,11 @@
|
|
|
3
3
|
from __future__ import annotations
|
|
4
4
|
|
|
5
5
|
import ast
|
|
6
|
-
import json
|
|
7
|
-
import re
|
|
8
6
|
import tomllib
|
|
9
7
|
from pathlib import Path
|
|
10
8
|
|
|
11
9
|
import pytest
|
|
10
|
+
from agent_connector_sdk.connector_identity import connector_name
|
|
12
11
|
|
|
13
12
|
ROOT = Path(__file__).resolve().parents[1]
|
|
14
13
|
PACKAGE = ROOT / "keycloak_agent"
|
|
@@ -36,18 +35,8 @@ def _call_connectors(path: Path) -> list[str]:
|
|
|
36
35
|
def test_connector_name_is_the_fleet_name() -> None:
|
|
37
36
|
pyproject = tomllib.loads((ROOT / "pyproject.toml").read_text(encoding="utf-8"))
|
|
38
37
|
assert pyproject["project"]["entry-points"]["agent_connector_sdk.connector"] == {
|
|
39
|
-
FLEET: "keycloak_agent"
|
|
38
|
+
FLEET: "keycloak_agent:connector"
|
|
40
39
|
}
|
|
41
|
-
|
|
42
|
-
if not manifest_path.is_file():
|
|
43
|
-
manifest_path = ROOT / "connector_manifest.yml"
|
|
44
|
-
manifest = manifest_path.read_text(encoding="utf-8")
|
|
45
|
-
match = re.search(r'^\s*"?connector"?\s*:\s*"?([^"\s,]+)', manifest, re.MULTILINE)
|
|
46
|
-
assert match is not None and match.group(1) == FLEET
|
|
47
|
-
fingerprints = PACKAGE / "connectors" / "tool_schema_fingerprints.json"
|
|
48
|
-
if fingerprints.is_file():
|
|
49
|
-
assert (
|
|
50
|
-
json.loads(fingerprints.read_text(encoding="utf-8"))["connector"] == FLEET
|
|
51
|
-
)
|
|
40
|
+
assert connector_name("keycloak_agent") == FLEET
|
|
52
41
|
for module in sorted(PACKAGE.glob("*.py")):
|
|
53
42
|
assert all(name == FLEET for name in _call_connectors(module)), module.name
|
|
@@ -17,8 +17,8 @@ import pytest
|
|
|
17
17
|
from agent_connector_sdk.ingest import IngestError, KnowledgeIngest
|
|
18
18
|
|
|
19
19
|
from keycloak_agent.kg_ingest import (
|
|
20
|
+
STREAM,
|
|
20
21
|
ingest_clients,
|
|
21
|
-
ingest_entities,
|
|
22
22
|
ingest_groups,
|
|
23
23
|
ingest_realms,
|
|
24
24
|
ingest_users,
|
|
@@ -54,19 +54,19 @@ def ingest():
|
|
|
54
54
|
def _node_type(record: Any) -> str:
|
|
55
55
|
"""A real generated ``SourceRecord`` has no bare ``node_type`` field — it's the
|
|
56
56
|
last segment of ``mapping_reference``
|
|
57
|
-
(``
|
|
57
|
+
(``connector:<connector>#mappings/<NodeType>``)."""
|
|
58
58
|
return record.mapping_reference.rsplit("/", 1)[-1]
|
|
59
59
|
|
|
60
60
|
|
|
61
61
|
def _rel_name(relationship: Any) -> str:
|
|
62
62
|
"""Likewise, a ``SourceRelationship``'s kind is the last segment of
|
|
63
|
-
``relation_reference`` (``
|
|
63
|
+
``relation_reference`` (``connector:<connector>#relations/<NodeType>/<kind>``)."""
|
|
64
64
|
return relationship.relation_reference.rsplit("/", 1)[-1]
|
|
65
65
|
|
|
66
66
|
|
|
67
67
|
async def test_ingest_entities_writes_nodes_and_edges(ingest):
|
|
68
68
|
service, transport = ingest
|
|
69
|
-
res = await
|
|
69
|
+
res = await STREAM.entities(
|
|
70
70
|
[
|
|
71
71
|
{"id": "a", "node_type": "User", "username": "u"},
|
|
72
72
|
{"id": "b", "node_type": "Realm"},
|
|
@@ -187,7 +187,7 @@ async def test_ingest_groups_walks_subgroups(ingest):
|
|
|
187
187
|
async def test_retired_node_type_alias_is_rejected(ingest):
|
|
188
188
|
service, _transport = ingest
|
|
189
189
|
with pytest.raises(IngestError):
|
|
190
|
-
await
|
|
190
|
+
await STREAM.entities(
|
|
191
191
|
[{"id": "retired", "type": "RetiredAlias"}], ingest=service
|
|
192
192
|
)
|
|
193
193
|
|
|
@@ -195,7 +195,7 @@ async def test_retired_node_type_alias_is_rejected(ingest):
|
|
|
195
195
|
async def test_empty_native_ingest_is_rejected(ingest):
|
|
196
196
|
service, _transport = ingest
|
|
197
197
|
with pytest.raises(IngestError, match="at least one entity"):
|
|
198
|
-
await
|
|
198
|
+
await STREAM.entities([], ingest=service)
|
|
199
199
|
|
|
200
200
|
|
|
201
201
|
async def test_empty_mappers_are_a_noop(ingest):
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import pytest
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
@pytest.mark.concept("KC-OS.identity.keycloak-mcp-authenticates-admin")
|
|
5
|
+
def test_mcp_server_security_context(monkeypatch):
|
|
6
|
+
"""CONCEPT:KC-OS.identity.keycloak-mcp-authenticates-admin Verify that the server registers with correct security credentials."""
|
|
7
|
+
from keycloak_agent.auth import get_client
|
|
8
|
+
|
|
9
|
+
monkeypatch.setenv("KEYCLOAK_URL", "https://service.invalid")
|
|
10
|
+
client = get_client()
|
|
11
|
+
assert client is not None
|