graphcore-distro 0.2.1__tar.gz → 0.2.3__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.
Files changed (117) hide show
  1. {graphcore_distro-0.2.1/graphcore_distro.egg-info → graphcore_distro-0.2.3}/PKG-INFO +3 -3
  2. {graphcore_distro-0.2.1 → graphcore_distro-0.2.3/graphcore_distro.egg-info}/PKG-INFO +3 -3
  3. graphcore_distro-0.2.3/graphcore_distro.egg-info/requires.txt +3 -0
  4. {graphcore_distro-0.2.1 → graphcore_distro-0.2.3}/graphcore_project/identity.py +15 -16
  5. {graphcore_distro-0.2.1 → graphcore_distro-0.2.3}/graphcore_project/tests/test_identity.py +20 -37
  6. {graphcore_distro-0.2.1 → graphcore_distro-0.2.3}/graphcore_project_kit/scaffold/project_template/.env.example +3 -2
  7. {graphcore_distro-0.2.1 → graphcore_distro-0.2.3}/graphcore_project_kit/scaffold/project_template/backend/project_name/settings.py-tpl +7 -1
  8. {graphcore_distro-0.2.1 → graphcore_distro-0.2.3}/graphcore_project_kit/scaffold/project_template/react_frontend/src/App.tsx +0 -2
  9. {graphcore_distro-0.2.1 → graphcore_distro-0.2.3}/graphcore_user_guides/app_design/how_to_design_gc_apps.md +2 -2
  10. {graphcore_distro-0.2.1 → graphcore_distro-0.2.3}/graphcore_user_guides/frontend.md +4 -6
  11. {graphcore_distro-0.2.1 → graphcore_distro-0.2.3}/graphcore_user_guides/identity_infrastructure.md +43 -44
  12. {graphcore_distro-0.2.1 → graphcore_distro-0.2.3}/graphcore_user_guides/production.md +21 -19
  13. {graphcore_distro-0.2.1 → graphcore_distro-0.2.3}/graphcore_user_guides/service_accounts.md +11 -11
  14. {graphcore_distro-0.2.1 → graphcore_distro-0.2.3}/pyproject.toml +3 -3
  15. graphcore_distro-0.2.1/graphcore_distro.egg-info/requires.txt +0 -3
  16. {graphcore_distro-0.2.1 → graphcore_distro-0.2.3}/LICENSE +0 -0
  17. {graphcore_distro-0.2.1 → graphcore_distro-0.2.3}/NOTICE +0 -0
  18. {graphcore_distro-0.2.1 → graphcore_distro-0.2.3}/README.md +0 -0
  19. {graphcore_distro-0.2.1 → graphcore_distro-0.2.3}/doc_topics.py +0 -0
  20. {graphcore_distro-0.2.1 → graphcore_distro-0.2.3}/graphcore_cli/__init__.py +0 -0
  21. {graphcore_distro-0.2.1 → graphcore_distro-0.2.3}/graphcore_cli/api_cmd.py +0 -0
  22. {graphcore_distro-0.2.1 → graphcore_distro-0.2.3}/graphcore_cli/apps_cmd.py +0 -0
  23. {graphcore_distro-0.2.1 → graphcore_distro-0.2.3}/graphcore_cli/db_cmd.py +0 -0
  24. {graphcore_distro-0.2.1 → graphcore_distro-0.2.3}/graphcore_cli/docker_cmd.py +0 -0
  25. {graphcore_distro-0.2.1 → graphcore_distro-0.2.3}/graphcore_cli/docs_cmd.py +0 -0
  26. {graphcore_distro-0.2.1 → graphcore_distro-0.2.3}/graphcore_cli/frontend_cmd.py +0 -0
  27. {graphcore_distro-0.2.1 → graphcore_distro-0.2.3}/graphcore_cli/identity_cmd.py +0 -0
  28. {graphcore_distro-0.2.1 → graphcore_distro-0.2.3}/graphcore_cli/infra_cmd.py +0 -0
  29. {graphcore_distro-0.2.1 → graphcore_distro-0.2.3}/graphcore_cli/scaffold_cmd.py +0 -0
  30. {graphcore_distro-0.2.1 → graphcore_distro-0.2.3}/graphcore_cli/skills_cmd.py +0 -0
  31. {graphcore_distro-0.2.1 → graphcore_distro-0.2.3}/graphcore_cli/tests/__init__.py +0 -0
  32. {graphcore_distro-0.2.1 → graphcore_distro-0.2.3}/graphcore_cli/tests/test_api_cmd.py +0 -0
  33. {graphcore_distro-0.2.1 → graphcore_distro-0.2.3}/graphcore_cli/tests/test_cli.py +0 -0
  34. {graphcore_distro-0.2.1 → graphcore_distro-0.2.3}/graphcore_cli/tests/test_createadmin_cmd.py +0 -0
  35. {graphcore_distro-0.2.1 → graphcore_distro-0.2.3}/graphcore_cli/tests/test_dev_reset.py +0 -0
  36. {graphcore_distro-0.2.1 → graphcore_distro-0.2.3}/graphcore_cli/tests/test_docker_cmd.py +0 -0
  37. {graphcore_distro-0.2.1 → graphcore_distro-0.2.3}/graphcore_cli/tests/test_docs_cmd.py +0 -0
  38. {graphcore_distro-0.2.1 → graphcore_distro-0.2.3}/graphcore_cli/tests/test_frontend_cmd.py +0 -0
  39. {graphcore_distro-0.2.1 → graphcore_distro-0.2.3}/graphcore_cli/tests/test_infra_cmd.py +0 -0
  40. {graphcore_distro-0.2.1 → graphcore_distro-0.2.3}/graphcore_cli/tests/test_migrate.py +0 -0
  41. {graphcore_distro-0.2.1 → graphcore_distro-0.2.3}/graphcore_cli/tests/test_packaging.py +0 -0
  42. {graphcore_distro-0.2.1 → graphcore_distro-0.2.3}/graphcore_cli/tests/test_policy_cmd.py +0 -0
  43. {graphcore_distro-0.2.1 → graphcore_distro-0.2.3}/graphcore_cli/tests/test_skills_cmd.py +0 -0
  44. {graphcore_distro-0.2.1 → graphcore_distro-0.2.3}/graphcore_cli/tests/test_status_cmd.py +0 -0
  45. {graphcore_distro-0.2.1 → graphcore_distro-0.2.3}/graphcore_distro.egg-info/SOURCES.txt +0 -0
  46. {graphcore_distro-0.2.1 → graphcore_distro-0.2.3}/graphcore_distro.egg-info/dependency_links.txt +0 -0
  47. {graphcore_distro-0.2.1 → graphcore_distro-0.2.3}/graphcore_distro.egg-info/entry_points.txt +0 -0
  48. {graphcore_distro-0.2.1 → graphcore_distro-0.2.3}/graphcore_distro.egg-info/top_level.txt +0 -0
  49. {graphcore_distro-0.2.1 → graphcore_distro-0.2.3}/graphcore_project/__init__.py +0 -0
  50. {graphcore_distro-0.2.1 → graphcore_distro-0.2.3}/graphcore_project/http.py +0 -0
  51. {graphcore_distro-0.2.1 → graphcore_distro-0.2.3}/graphcore_project/keycloak_admin.py +0 -0
  52. {graphcore_distro-0.2.1 → graphcore_distro-0.2.3}/graphcore_project/locate.py +0 -0
  53. {graphcore_distro-0.2.1 → graphcore_distro-0.2.3}/graphcore_project/runner.py +0 -0
  54. {graphcore_distro-0.2.1 → graphcore_distro-0.2.3}/graphcore_project/tests/__init__.py +0 -0
  55. {graphcore_distro-0.2.1 → graphcore_distro-0.2.3}/graphcore_project/tests/test_keycloak_admin.py +0 -0
  56. {graphcore_distro-0.2.1 → graphcore_distro-0.2.3}/graphcore_project/tests/test_locate.py +0 -0
  57. {graphcore_distro-0.2.1 → graphcore_distro-0.2.3}/graphcore_project/tests/test_runner.py +0 -0
  58. {graphcore_distro-0.2.1 → graphcore_distro-0.2.3}/graphcore_project_kit/__init__.py +0 -0
  59. {graphcore_distro-0.2.1 → graphcore_distro-0.2.3}/graphcore_project_kit/infra/docker-compose.yml +0 -0
  60. {graphcore_distro-0.2.1 → graphcore_distro-0.2.3}/graphcore_project_kit/infra/realm/README.md +0 -0
  61. {graphcore_distro-0.2.1 → graphcore_distro-0.2.3}/graphcore_project_kit/infra/realm/template-realm.json +0 -0
  62. {graphcore_distro-0.2.1 → graphcore_distro-0.2.3}/graphcore_project_kit/infra/themes/graphcore/login/template.ftl +0 -0
  63. {graphcore_distro-0.2.1 → graphcore_distro-0.2.3}/graphcore_project_kit/infra/themes/graphcore/login/theme.properties +0 -0
  64. {graphcore_distro-0.2.1 → graphcore_distro-0.2.3}/graphcore_project_kit/scaffold/app_template/backend/app_name/__init__.py-tpl +0 -0
  65. {graphcore_distro-0.2.1 → graphcore_distro-0.2.3}/graphcore_project_kit/scaffold/app_template/backend/app_name/apps.py-tpl +0 -0
  66. {graphcore_distro-0.2.1 → graphcore_distro-0.2.3}/graphcore_project_kit/scaffold/app_template/backend/app_name/authorization.py-tpl +0 -0
  67. {graphcore_distro-0.2.1 → graphcore_distro-0.2.3}/graphcore_project_kit/scaffold/app_template/backend/app_name/entities/__init__.py-tpl +0 -0
  68. {graphcore_distro-0.2.1 → graphcore_distro-0.2.3}/graphcore_project_kit/scaffold/app_template/backend/app_name/migrations/__init__.py-tpl +0 -0
  69. {graphcore_distro-0.2.1 → graphcore_distro-0.2.3}/graphcore_project_kit/scaffold/app_template/backend/app_name/models.py-tpl +0 -0
  70. {graphcore_distro-0.2.1 → graphcore_distro-0.2.3}/graphcore_project_kit/scaffold/app_template/backend/app_name/persistence.py-tpl +0 -0
  71. {graphcore_distro-0.2.1 → graphcore_distro-0.2.3}/graphcore_project_kit/scaffold/app_template/backend/app_name/routes.py-tpl +0 -0
  72. {graphcore_distro-0.2.1 → graphcore_distro-0.2.3}/graphcore_project_kit/scaffold/app_template/backend/app_name/strategies/__init__.py-tpl +0 -0
  73. {graphcore_distro-0.2.1 → graphcore_distro-0.2.3}/graphcore_project_kit/scaffold/app_template/backend/app_name/test_settings.py-tpl +0 -0
  74. {graphcore_distro-0.2.1 → graphcore_distro-0.2.3}/graphcore_project_kit/scaffold/app_template/backend/app_name/tests/__init__.py-tpl +0 -0
  75. {graphcore_distro-0.2.1 → graphcore_distro-0.2.3}/graphcore_project_kit/scaffold/app_template/backend/app_name_agent_frontend/__init__.py-tpl +0 -0
  76. {graphcore_distro-0.2.1 → graphcore_distro-0.2.3}/graphcore_project_kit/scaffold/app_template/backend/app_name_agent_frontend/agent_views.py-tpl +0 -0
  77. {graphcore_distro-0.2.1 → graphcore_distro-0.2.3}/graphcore_project_kit/scaffold/app_template/backend/pyproject.toml +0 -0
  78. {graphcore_distro-0.2.1 → graphcore_distro-0.2.3}/graphcore_project_kit/scaffold/app_template/react_frontend/generated/README.md +0 -0
  79. {graphcore_distro-0.2.1 → graphcore_distro-0.2.3}/graphcore_project_kit/scaffold/app_template/react_frontend/index.ts-tpl +0 -0
  80. {graphcore_distro-0.2.1 → graphcore_distro-0.2.3}/graphcore_project_kit/scaffold/app_template/react_frontend/package.json +0 -0
  81. {graphcore_distro-0.2.1 → graphcore_distro-0.2.3}/graphcore_project_kit/scaffold/app_template/react_frontend/style.css-tpl +0 -0
  82. {graphcore_distro-0.2.1 → graphcore_distro-0.2.3}/graphcore_project_kit/scaffold/project_template/.gitignore +0 -0
  83. {graphcore_distro-0.2.1 → graphcore_distro-0.2.3}/graphcore_project_kit/scaffold/project_template/.mcp.json +0 -0
  84. {graphcore_distro-0.2.1 → graphcore_distro-0.2.3}/graphcore_project_kit/scaffold/project_template/AGENTS.md +0 -0
  85. {graphcore_distro-0.2.1 → graphcore_distro-0.2.3}/graphcore_project_kit/scaffold/project_template/CLAUDE.md +0 -0
  86. {graphcore_distro-0.2.1 → graphcore_distro-0.2.3}/graphcore_project_kit/scaffold/project_template/README.md +0 -0
  87. {graphcore_distro-0.2.1 → graphcore_distro-0.2.3}/graphcore_project_kit/scaffold/project_template/apps/.gitkeep +0 -0
  88. {graphcore_distro-0.2.1 → graphcore_distro-0.2.3}/graphcore_project_kit/scaffold/project_template/backend/Dockerfile +0 -0
  89. {graphcore_distro-0.2.1 → graphcore_distro-0.2.3}/graphcore_project_kit/scaffold/project_template/backend/manage.py-tpl +0 -0
  90. {graphcore_distro-0.2.1 → graphcore_distro-0.2.3}/graphcore_project_kit/scaffold/project_template/backend/project_name/__init__.py-tpl +0 -0
  91. {graphcore_distro-0.2.1 → graphcore_distro-0.2.3}/graphcore_project_kit/scaffold/project_template/backend/project_name/asgi.py-tpl +0 -0
  92. {graphcore_distro-0.2.1 → graphcore_distro-0.2.3}/graphcore_project_kit/scaffold/project_template/backend/project_name/urls.py-tpl +0 -0
  93. {graphcore_distro-0.2.1 → graphcore_distro-0.2.3}/graphcore_project_kit/scaffold/project_template/backend/requirements.txt +0 -0
  94. {graphcore_distro-0.2.1 → graphcore_distro-0.2.3}/graphcore_project_kit/scaffold/project_template/docker-compose.yml +0 -0
  95. {graphcore_distro-0.2.1 → graphcore_distro-0.2.3}/graphcore_project_kit/scaffold/project_template/package.json +0 -0
  96. {graphcore_distro-0.2.1 → graphcore_distro-0.2.3}/graphcore_project_kit/scaffold/project_template/react_frontend/index.html +0 -0
  97. {graphcore_distro-0.2.1 → graphcore_distro-0.2.3}/graphcore_project_kit/scaffold/project_template/react_frontend/package.json +0 -0
  98. {graphcore_distro-0.2.1 → graphcore_distro-0.2.3}/graphcore_project_kit/scaffold/project_template/react_frontend/src/generated/installedApps.css +0 -0
  99. {graphcore_distro-0.2.1 → graphcore_distro-0.2.3}/graphcore_project_kit/scaffold/project_template/react_frontend/src/generated/installedApps.ts +0 -0
  100. {graphcore_distro-0.2.1 → graphcore_distro-0.2.3}/graphcore_project_kit/scaffold/project_template/react_frontend/src/index.css +0 -0
  101. {graphcore_distro-0.2.1 → graphcore_distro-0.2.3}/graphcore_project_kit/scaffold/project_template/react_frontend/src/main.tsx +0 -0
  102. {graphcore_distro-0.2.1 → graphcore_distro-0.2.3}/graphcore_project_kit/scaffold/project_template/react_frontend/src/vite-env.d.ts +0 -0
  103. {graphcore_distro-0.2.1 → graphcore_distro-0.2.3}/graphcore_project_kit/scaffold/project_template/react_frontend/tsconfig.json +0 -0
  104. {graphcore_distro-0.2.1 → graphcore_distro-0.2.3}/graphcore_project_kit/scaffold/project_template/react_frontend/vite.config.ts +0 -0
  105. {graphcore_distro-0.2.1 → graphcore_distro-0.2.3}/graphcore_project_kit/scripts/backup_postgres.sh +0 -0
  106. {graphcore_distro-0.2.1 → graphcore_distro-0.2.3}/graphcore_project_kit/scripts/restore_postgres.sh +0 -0
  107. {graphcore_distro-0.2.1 → graphcore_distro-0.2.3}/graphcore_project_kit/skills/graphcore-docs/SKILL.md +0 -0
  108. {graphcore_distro-0.2.1 → graphcore_distro-0.2.3}/graphcore_user_guides/__init__.py +0 -0
  109. {graphcore_distro-0.2.1 → graphcore_distro-0.2.3}/graphcore_user_guides/agent_views.md +0 -0
  110. {graphcore_distro-0.2.1 → graphcore_distro-0.2.3}/graphcore_user_guides/app_design/app_tdd_template.md +0 -0
  111. {graphcore_distro-0.2.1 → graphcore_distro-0.2.3}/graphcore_user_guides/app_design/stacks_tdd.md +0 -0
  112. {graphcore_distro-0.2.1 → graphcore_distro-0.2.3}/graphcore_user_guides/custom_authorization.md +0 -0
  113. {graphcore_distro-0.2.1 → graphcore_distro-0.2.3}/graphcore_user_guides/deployment_access.md +0 -0
  114. {graphcore_distro-0.2.1 → graphcore_distro-0.2.3}/graphcore_user_guides/entities.md +0 -0
  115. {graphcore_distro-0.2.1 → graphcore_distro-0.2.3}/graphcore_user_guides/getting_started.md +0 -0
  116. {graphcore_distro-0.2.1 → graphcore_distro-0.2.3}/graphcore_user_guides/writing_strategies.md +0 -0
  117. {graphcore_distro-0.2.1 → graphcore_distro-0.2.3}/setup.cfg +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: graphcore-distro
3
- Version: 0.2.1
3
+ Version: 0.2.3
4
4
  Summary: GraphCore distro — CLI, scaffolding, and curated built-in apps
5
5
  Author: GraphCore
6
6
  License-Expression: Apache-2.0
@@ -14,8 +14,8 @@ Requires-Python: >=3.13
14
14
  Description-Content-Type: text/markdown
15
15
  License-File: LICENSE
16
16
  License-File: NOTICE
17
- Requires-Dist: graphcore-kernel[redis,server]==0.2.1
18
- Requires-Dist: graphcore-agents==0.2.1
17
+ Requires-Dist: graphcore-kernel[redis,server]==0.2.3
18
+ Requires-Dist: graphcore-agents==0.2.3
19
19
  Requires-Dist: python-dotenv<2,>=1.0
20
20
  Dynamic: license-file
21
21
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: graphcore-distro
3
- Version: 0.2.1
3
+ Version: 0.2.3
4
4
  Summary: GraphCore distro — CLI, scaffolding, and curated built-in apps
5
5
  Author: GraphCore
6
6
  License-Expression: Apache-2.0
@@ -14,8 +14,8 @@ Requires-Python: >=3.13
14
14
  Description-Content-Type: text/markdown
15
15
  License-File: LICENSE
16
16
  License-File: NOTICE
17
- Requires-Dist: graphcore-kernel[redis,server]==0.2.1
18
- Requires-Dist: graphcore-agents==0.2.1
17
+ Requires-Dist: graphcore-kernel[redis,server]==0.2.3
18
+ Requires-Dist: graphcore-agents==0.2.3
19
19
  Requires-Dist: python-dotenv<2,>=1.0
20
20
  Dynamic: license-file
21
21
 
@@ -0,0 +1,3 @@
1
+ graphcore-kernel[redis,server]==0.2.3
2
+ graphcore-agents==0.2.3
3
+ python-dotenv<2,>=1.0
@@ -2,8 +2,10 @@
2
2
 
3
3
  Built from declarations (the project's settings and its apps'
4
4
  `graphcore_service_clients`), rendered from the template realm, and applied
5
- idempotently through Keycloak's admin API by `graphcore identity apply`.
6
- `graphcore docs distro/identity-infrastructure` describes the behaviour.
5
+ idempotently to the local Keycloak's admin API by `graphcore identity apply`.
6
+ A deployment configures its own provider; `graphcore identity render` shows
7
+ what a realm for this project holds. `graphcore docs
8
+ distro/identity-infrastructure` describes the behaviour.
7
9
  """
8
10
 
9
11
  from __future__ import annotations
@@ -219,7 +221,7 @@ def domain_secrets(root: Path, spec: DomainSpec) -> dict[str, str]:
219
221
  raise SystemExit(
220
222
  f"Missing client secrets for {spec.keycloak_base}: {', '.join(missing)}.\n"
221
223
  "Generate each once, keep it in your secret store and set it in the environment; "
222
- "`apply` generates secrets only for a local Keycloak."
224
+ "secrets are generated only for a local Keycloak."
223
225
  )
224
226
  return secrets
225
227
 
@@ -617,24 +619,15 @@ def _apply_direction(applier: _Applier, spec: DomainSpec, caller: str, target: s
617
619
  applier.identity_provider(target, provider, secret_changed=broker is None)
618
620
 
619
621
 
620
- def _admin_credentials(spec: DomainSpec) -> tuple[str, str]:
621
- keys = ("GRAPHCORE_KEYCLOAK_ADMIN", "GRAPHCORE_KEYCLOAK_ADMIN_PASSWORD")
622
- user, password = (os.environ.get(key) for key in keys)
623
- if spec.dev:
624
- return user or "admin", password or "admin"
625
- missing = [key for key, value in zip(keys, (user, password)) if not value]
626
- if missing:
627
- raise SystemExit(
628
- f"Missing admin credentials for {spec.keycloak_base}: {', '.join(missing)}.\n"
629
- "Set them from your secret store; `admin` / `admin` is tried only on a local Keycloak."
630
- )
631
- return user, password
622
+ def _admin_credentials() -> tuple[str, str]:
623
+ return (os.environ.get("GRAPHCORE_KEYCLOAK_ADMIN") or "admin",
624
+ os.environ.get("GRAPHCORE_KEYCLOAK_ADMIN_PASSWORD") or "admin")
632
625
 
633
626
 
634
627
  def _admin_for(spec: DomainSpec):
635
628
  from .keycloak_admin import KeycloakAdmin
636
629
 
637
- return KeycloakAdmin(spec.admin_base, *_admin_credentials(spec))
630
+ return KeycloakAdmin(spec.admin_base, *_admin_credentials())
638
631
 
639
632
 
640
633
  def apply_identity(root: Path | None = None, *, admin=None, log: Callable[[str], None] = print,
@@ -645,6 +638,12 @@ def apply_identity(root: Path | None = None, *, admin=None, log: Callable[[str],
645
638
 
646
639
  root = require_project_root(root, command="graphcore identity apply")
647
640
  spec = load_spec(root, service_clients=service_clients)
641
+ if not spec.dev:
642
+ raise SystemExit(
643
+ f"{spec.issuer} is not a local Keycloak. `graphcore identity apply` sets up local development "
644
+ "only; a deployment's provider is configured by its own deployment tooling. "
645
+ "See `graphcore docs distro/identity-infrastructure`, In production."
646
+ )
648
647
  admin = admin or _admin_for(spec)
649
648
  realm = render_realm(spec, load_template(), domain_secrets(root, spec))
650
649
 
@@ -203,21 +203,13 @@ class DomainSecretsTests(ProjectFixture):
203
203
 
204
204
 
205
205
  class AdminCredentialsTests(ProjectFixture):
206
- def test_a_local_keycloak_defaults_to_admin(self):
207
- self.assertEqual(identity._admin_credentials(_spec()), ("admin", "admin"))
206
+ def test_the_local_keycloak_defaults_to_admin(self):
207
+ self.assertEqual(identity._admin_credentials(), ("admin", "admin"))
208
208
 
209
- def test_another_keycloak_uses_the_environment(self):
209
+ def test_the_environment_overrides_the_default(self):
210
210
  os.environ.update({"GRAPHCORE_KEYCLOAK_ADMIN": "ops", "GRAPHCORE_KEYCLOAK_ADMIN_PASSWORD": "pw"})
211
211
 
212
- self.assertEqual(identity._admin_credentials(_spec(dev=False)), ("ops", "pw"))
213
-
214
- def test_another_keycloak_never_tries_the_default(self):
215
- os.environ["GRAPHCORE_KEYCLOAK_ADMIN"] = "ops"
216
-
217
- with self.assertRaises(SystemExit) as raised:
218
- identity._admin_credentials(_spec(dev=False, keycloak_base="https://auth.example.com"))
219
-
220
- self.assertIn("https://auth.example.com: GRAPHCORE_KEYCLOAK_ADMIN_PASSWORD.", str(raised.exception))
212
+ self.assertEqual(identity._admin_credentials(), ("ops", "pw"))
221
213
 
222
214
 
223
215
  class RenderRealmTests(TestCase):
@@ -698,40 +690,31 @@ class ApplyIdentityTests(ProjectFixture):
698
690
 
699
691
  self.assertIn("'wedding' has no backend client", str(raised.exception))
700
692
 
701
- def test_another_keycloak_is_applied_from_the_environment_alone(self):
702
- (self.root / ".env").unlink()
693
+ def test_another_keycloak_is_refused_before_any_contact(self):
703
694
  os.environ.update({
704
695
  "GRAPHCORE_OIDC_ISSUER": "https://auth.example.com/realms/notes",
705
- "WEDDING_GATEWAY_CLIENT_SECRET": "gateway-secret",
706
- BACKEND_SECRET_ENV: "backend-secret",
696
+ "GRAPHCORE_KEYCLOAK_ADMIN": "ops",
697
+ "GRAPHCORE_KEYCLOAK_ADMIN_PASSWORD": "pw",
707
698
  })
699
+ before = (self.root / ".env").read_bytes()
708
700
 
709
- self.assertEqual(self.apply(), 0)
710
-
711
- clients = {c["clientId"]: c for c in self.keycloak.realms["notes"]["clients"]}
712
- self.assertEqual(clients["wedding-gateway"]["secret"], "gateway-secret")
713
- self.assertEqual(clients["notes-backend"]["secret"], "backend-secret")
714
- self.assertEqual(list(self.root.iterdir()), [self.root / "backend"])
715
-
716
- def test_another_keycloak_without_its_secrets_is_refused_before_any_write(self):
717
- os.environ["GRAPHCORE_OIDC_ISSUER"] = "https://auth.example.com/realms/notes"
718
-
719
- with self.assertRaises(SystemExit) as raised:
720
- self.apply()
701
+ with patch("graphcore_project.keycloak_admin.KeycloakAdmin") as admin, \
702
+ self.assertRaises(SystemExit) as raised:
703
+ apply_identity(self.root, service_clients=lambda root: [("wedding", ["gateway"])])
721
704
 
722
- self.assertIn("WEDDING_GATEWAY_CLIENT_SECRET", str(raised.exception))
723
- self.assertEqual(self.keycloak.writes, [])
724
- self.assertNotIn("CLIENT_SECRET", (self.root / ".env").read_text())
705
+ self.assertIn("https://auth.example.com/realms/notes is not a local Keycloak", str(raised.exception))
706
+ self.assertIn("distro/identity-infrastructure", str(raised.exception))
707
+ admin.assert_not_called()
708
+ self.assertEqual((self.root / ".env").read_bytes(), before)
725
709
 
726
- def test_another_keycloak_without_admin_credentials_is_refused(self):
710
+ def test_another_keycloaks_realm_still_renders(self):
727
711
  os.environ["GRAPHCORE_OIDC_ISSUER"] = "https://auth.example.com/realms/notes"
728
712
 
729
- with patch("graphcore_project.keycloak_admin.KeycloakAdmin") as admin, \
730
- self.assertRaises(SystemExit) as raised:
731
- apply_identity(self.root, service_clients=lambda root: [])
713
+ realm = render_identity(self.root, service_clients=lambda root: [("wedding", ["gateway"])])
732
714
 
733
- self.assertIn("GRAPHCORE_KEYCLOAK_ADMIN, GRAPHCORE_KEYCLOAK_ADMIN_PASSWORD", str(raised.exception))
734
- admin.assert_not_called()
715
+ self.assertEqual(realm["sslRequired"], "external")
716
+ self.assertIn("graphcore-mcp", {c["clientId"] for c in realm["clients"]})
717
+ self.assertNotIn("graphcore-dev-test", {c["clientId"] for c in realm["clients"]})
735
718
 
736
719
  def test_render_lists_the_secrets_the_realm_needs(self):
737
720
  self.assertEqual(required_secrets(self.root, service_clients=lambda root: [("wedding", ["gateway"])]),
@@ -45,8 +45,9 @@ GRAPHCORE_OIDC_AUDIENCE={{ project_name }}
45
45
  # GRAPHCORE_KEYCLOAK_ADMIN=admin
46
46
  # GRAPHCORE_KEYCLOAK_ADMIN_PASSWORD=admin
47
47
 
48
- # The public client of the issuer the frontend signs in as.
49
- VITE_OIDC_CLIENT_ID=graphcore-web
48
+ # The public client of the issuer the frontend signs in as; the backend
49
+ # tells the frontend at runtime.
50
+ GRAPHCORE_OIDC_WEB_CLIENT_ID=graphcore-web
50
51
  # Off localhost, the backend's URL and host the frontend calls (default
51
52
  # http://localhost:$BACKEND_PORT) and the frontend origins the backend allows
52
53
  # (default localhost and 127.0.0.1 on $FRONTEND_PORT).
@@ -154,17 +154,23 @@ GRAPHCORE_RECONCILE_INTERVAL = int(os.environ.get('GRAPHCORE_RECONCILE_INTERVAL'
154
154
  # that `graphcore infra up` runs; any standard OIDC issuer works. The audience
155
155
  # is what tokens must carry in `aud`. GRAPHCORE_OIDC_INTERNAL_URL is the issuer
156
156
  # URL as this process reaches it, when that differs (`graphcore docker up`
157
- # sets it for a container reaching the host).
157
+ # sets it for a container reaching the host). The web client is the issuer's
158
+ # public client the frontend signs in as; the backend tells the frontend.
158
159
  GRAPHCORE_TRUSTED_ISSUERS = [{
159
160
  'issuer': os.environ.get('GRAPHCORE_OIDC_ISSUER', 'http://localhost:8180/realms/{{ project_name }}'),
160
161
  'audience': os.environ.get('GRAPHCORE_OIDC_AUDIENCE', '{{ project_name }}'),
161
162
  'internal_url': os.environ.get('GRAPHCORE_OIDC_INTERNAL_URL') or None,
163
+ 'web_client_id': os.environ.get('GRAPHCORE_OIDC_WEB_CLIENT_ID', 'graphcore-web'),
162
164
  }]
163
165
 
164
166
  # This deployment's public origin when it sits behind a proxy; unset uses the
165
167
  # request's own scheme and host.
166
168
  GRAPHCORE_PUBLIC_URL = os.environ.get('GRAPHCORE_PUBLIC_URL', '')
167
169
 
170
+ # Scopes the resource metadata offers MCP hosts, comma-separated. Hosts that
171
+ # register a client ask for these; unset lets the issuer give its defaults.
172
+ GRAPHCORE_RESOURCE_SCOPES = [s for s in os.environ.get('GRAPHCORE_RESOURCE_SCOPES', '').split(',') if s]
173
+
168
174
  # Whether any authenticated principal can read another user's User
169
175
  # (username, not credentials - see User.to_client). Off means user
170
176
  # profiles are private like any other entity.
@@ -14,8 +14,6 @@ import { installedApps } from './generated/installedApps';
14
14
  const config = {
15
15
  apiUrl: import.meta.env.VITE_API_URL,
16
16
  wsUrl: import.meta.env.VITE_WS_URL,
17
- // The issuer's public client this frontend signs in as (see .env).
18
- oidcClientId: import.meta.env.VITE_OIDC_CLIENT_ID ?? 'graphcore-web',
19
17
  };
20
18
 
21
19
  // Views: `baseViews` (the framework's generic views, including
@@ -439,8 +439,8 @@ view as it lands, and to walk through the TDD's worked examples.
439
439
  ```
440
440
 
441
441
  If `.env` sets another `BACKEND_PORT`, change the port in `url` to
442
- match. `graphcore-mcp` is the public client `graphcore identity apply`
443
- creates in every realm. Its only redirect URIs are
442
+ match. `graphcore-mcp` is the public client every GraphCore realm has
443
+ (`graphcore identity apply` creates it locally). Its only redirect URIs are
444
444
  `http://localhost:8765/callback` and `http://127.0.0.1:8765/callback`,
445
445
  so `callbackPort` must be `8765`. Another MCP host registers the same
446
446
  URL and client in its own configuration.
@@ -38,7 +38,6 @@ import { installedApps } from './generated/installedApps';
38
38
  const config = {
39
39
  apiUrl: import.meta.env.VITE_API_URL,
40
40
  wsUrl: import.meta.env.VITE_WS_URL,
41
- oidcClientId: import.meta.env.VITE_OIDC_CLIENT_ID ?? 'graphcore-web',
42
41
  };
43
42
 
44
43
  const registry = createViewRegistry();
@@ -177,7 +176,6 @@ in the app. The backend cannot read `basePath`; set it in both places.
177
176
  |---|---|
178
177
  | `apiUrl` | Full API base URL, e.g. `https://api.example.com` |
179
178
  | `wsUrl` | WebSocket host and port, e.g. `api.example.com` |
180
- | `oidcClientId` | The issuer's public client to sign in as. Default `graphcore-web` |
181
179
  | `agentMirror` | Offer every routed view a pane showing what an agent reads at that address |
182
180
  | `getToken`, `principalEntityId` | Supply a token yourself instead of signing in |
183
181
 
@@ -312,9 +310,10 @@ graphcore frontend up --script build # prepare, then npm run build
312
310
  under the base path.
313
311
  - Register the web client at your issuer with redirect URI
314
312
  `<frontend origin><base path>/auth/callback` and post-logout URI
315
- `<frontend origin><base path>`. With Keycloak and `graphcore identity
316
- apply`, the web client allows `<origin>/*` for each origin in
317
- `CORS_ALLOWED_ORIGINS`, which covers any base path.
313
+ `<frontend origin><base path>` (`<origin>/*` covers any base path), and set
314
+ its id in the backend's `GRAPHCORE_OIDC_WEB_CLIENT_ID`. The frontend asks
315
+ the backend for the issuer and the client when it loads, so one build
316
+ works with any provider.
318
317
  - Set the backend's `GRAPHCORE_WEB_URL` to the frontend's public URL with
319
318
  its base path. Unless `CORS_ALLOWED_ORIGINS` is set, the backend allows
320
319
  that URL's origin.
@@ -329,7 +328,6 @@ graphcore frontend up --script build # prepare, then npm run build
329
328
  | `BACKEND_PORT` | The local backend's port, which the two URLs below default to | `8000` | Unused |
330
329
  | `VITE_API_URL` | The backend's HTTP base URL (`config.apiUrl`) | `http://localhost:$BACKEND_PORT` | The backend's public URL |
331
330
  | `VITE_WS_URL` | The backend's WebSocket host and port (`config.wsUrl`) | `localhost:$BACKEND_PORT` | The backend's public host |
332
- | `VITE_OIDC_CLIENT_ID` | The issuer's public web client (`config.oidcClientId`) | `graphcore-web` | Your provider's web client id |
333
331
  | `GRAPHCORE_WEB_URL` | The app's full URL with its base path, read by the backend for agents' `web:` links and the default allowed origin | `http://localhost:$FRONTEND_PORT` | The frontend's public URL, plus `basePath` |
334
332
 
335
333
  ## How the kernel does this
@@ -153,8 +153,10 @@ for just the list of variables).
153
153
 
154
154
  It signs in to Keycloak's `master` realm with `GRAPHCORE_KEYCLOAK_ADMIN` and
155
155
  `GRAPHCORE_KEYCLOAK_ADMIN_PASSWORD`, which default to the local-only
156
- `admin` / `admin` for a Keycloak at `localhost`. Those credentials are given only to this
157
- command, never to the backend. It reaches Keycloak at the base of
156
+ `admin` / `admin`. Those credentials are given only to this command, never
157
+ to the backend. It refuses an issuer whose Keycloak is not at `localhost`:
158
+ a deployment's realm is its deployment tooling's to configure (*In
159
+ production*). It reaches Keycloak at the base of
158
160
  `GRAPHCORE_OIDC_ISSUER`, or of `GRAPHCORE_OIDC_INTERNAL_URL` when set.
159
161
 
160
162
  Within a shared domain, the realm's settings (display name, login theme,
@@ -179,7 +181,7 @@ Every realm has:
179
181
 
180
182
  | Client | Kind | Used by |
181
183
  |---|---|---|
182
- | `graphcore-web` | Public, code + PKCE; redirect URIs from the project's origins | The web frontend (`VITE_OIDC_CLIENT_ID`) |
184
+ | `graphcore-web` | Public, code + PKCE; redirect URIs from the project's origins | The web frontend, which the backend tells its id (`GRAPHCORE_OIDC_WEB_CLIENT_ID`) |
183
185
  | `graphcore-cli` | Public, device authorization grant | `graphcore api login` |
184
186
  | `graphcore-mcp` | Public, code + PKCE, loopback redirect URIs | MCP hosts that cannot register themselves |
185
187
  | `<project>-backend` per project in the domain | Confidential, standard token exchange; secret in `.env` as `GRAPHCORE_BACKEND_CLIENT_SECRET` | The backend, exchanging a user's token to act for them at another deployment |
@@ -269,9 +271,9 @@ mappings).
269
271
 
270
272
  | Client | Grant | Register it with |
271
273
  |---|---|---|
272
- | The web frontend | Authorization code with PKCE, public | Redirect URI `<frontend origin><base path>/auth/callback` and post-logout URI `<frontend origin><base path>`; its id in `VITE_OIDC_CLIENT_ID` |
274
+ | The web frontend | Authorization code with PKCE, public | Redirect URI `<frontend origin><base path>/auth/callback` and post-logout URI `<frontend origin><base path>`; its id in `GRAPHCORE_OIDC_WEB_CLIENT_ID`, which the backend gives the frontend at runtime |
273
275
  | The `graphcore` CLI | Device authorization grant (RFC 8628), public | Its id in `GRAPHCORE_OIDC_CLI_CLIENT_ID`, or `--client-id`; default `graphcore-cli` |
274
- | MCP hosts | Authorization code with PKCE | Dynamic client registration (RFC 7591), or a client you register and configure in the host |
276
+ | MCP hosts | Authorization code with PKCE | Dynamic client registration (RFC 7591), or a client you register and configure in the host. Hosts on the person's machine (Claude Code, Codex) redirect to a loopback URI; a hosted one (Claude on the web) redirects to its own HTTPS callback, which the client's redirect URIs or the registration policy must allow |
275
277
  | Each service account | Client credentials, confidential | Client id exactly `<app_id>-<name>`, which tokens must carry in `azp` |
276
278
 
277
279
  - For one deployment acting for a user at another: RFC 8693 token exchange
@@ -281,44 +283,41 @@ mappings).
281
283
 
282
284
  ### With Keycloak
283
285
 
284
- `graphcore identity apply` configures a production Keycloak exactly as the
285
- local one. Run it from your deploy pipeline, before `graphcore migrate`,
286
- with:
287
-
288
- - `GRAPHCORE_OIDC_ISSUER=https://<your keycloak>/realms/<domain>` and
289
- `CORS_ALLOWED_ORIGINS` set to the frontend's public origins;
290
- - `GRAPHCORE_KEYCLOAK_ADMIN` and `GRAPHCORE_KEYCLOAK_ADMIN_PASSWORD` for an
291
- admin account of that Keycloak, from your secret store;
292
- - every client secret the realm needs, from your secret store: `graphcore
293
- identity render --secrets` lists their variables, so the pipeline can
294
- generate each once;
295
- - `GRAPHCORE_OIDC_INTERNAL_URL` when the pipeline reaches Keycloak at a
296
- different address than its public one.
297
-
298
- A Keycloak not at `localhost` gets none of the local-development settings:
299
- the realm requires HTTPS for external requests, has no `test@example.com` user and no
300
- `graphcore-dev-test` client, takes the web client's redirect URIs and web
301
- origins from `CORS_ALLOWED_ORIGINS` only, and has Keycloak call other realms
302
- on their public URLs.
286
+ Define the realm in your deployment tooling, for example as a realm file
287
+ your pipeline imports with a declarative import tool, and apply it before
288
+ the backend starts. `graphcore identity apply` sets up the local Keycloak
289
+ only and refuses any other.
290
+
291
+ `graphcore identity render`, run with the production
292
+ `GRAPHCORE_OIDC_ISSUER` and `CORS_ALLOWED_ORIGINS`, prints the realm the
293
+ project expects, each secret shown as its variable. Use it as the reference
294
+ for what your realm must hold: the clients above, the domain's audience
295
+ scope, the user profile and the client-registration policies. Leave out what
296
+ Keycloak creates for every realm itself (its built-in clients and signing
297
+ keys). For an issuer not at `localhost` it has none of the local-development
298
+ settings: the realm requires HTTPS for external requests, has no
299
+ `test@example.com` user and no `graphcore-dev-test` client, and takes the
300
+ web client's redirect URIs and web origins from `CORS_ALLOWED_ORIGINS` only.
301
+
302
+ - **Secrets.** `graphcore identity render --secrets` lists the client
303
+ secrets. Generate each once, keep it in your secret store, set it on its
304
+ client in the realm, and give the same value to the backend and each
305
+ service-account process.
306
+ - **Clients that register themselves.** MCP hosts register clients through
307
+ dynamic client registration at runtime. Import the realm without deleting
308
+ clients your file does not list, or each release signs those hosts out.
309
+ - **The login theme.** Install the `graphcore` theme on your Keycloak, or set
310
+ your realm's login theme to one it has.
303
311
 
304
312
  Running Keycloak itself, its HTTPS, hostname, database and backups, is
305
- outside GraphCore. Install the `graphcore` login theme on it, or set
306
- `GRAPHCORE_IDENTITY_LOGIN_THEME` to a theme it has.
307
-
308
- Each client secret is read from the environment first, then from `.env`;
309
- no `.env` is needed. Only for a Keycloak at `localhost` does `apply`
310
- generate a missing secret into `.env` or fall back to `admin` / `admin`.
311
- For any other, it writes nothing to disk and stops before any change,
312
- naming the missing admin credentials or secrets. Give the same secrets to
313
- the backend and each service-account process.
313
+ outside GraphCore.
314
314
 
315
315
  ### With another provider
316
316
 
317
317
  Register the clients above in the provider's console or its own
318
318
  infrastructure-as-code, and set `GRAPHCORE_OIDC_ISSUER`,
319
- `GRAPHCORE_OIDC_AUDIENCE`, `VITE_OIDC_CLIENT_ID` and, if the CLI's client is
320
- not `graphcore-cli`, `GRAPHCORE_OIDC_CLI_CLIENT_ID`. Do not run
321
- `graphcore identity apply`; it configures Keycloak only.
319
+ `GRAPHCORE_OIDC_AUDIENCE`, `GRAPHCORE_OIDC_WEB_CLIENT_ID` and, if the CLI's
320
+ client is not `graphcore-cli`, `GRAPHCORE_OIDC_CLI_CLIENT_ID`.
322
321
 
323
322
  - **Domains** are whatever set of applications the provider lets share
324
323
  accounts; give every deployment in one the same audience.
@@ -335,17 +334,17 @@ not `graphcore-cli`, `GRAPHCORE_OIDC_CLI_CLIENT_ID`. Do not run
335
334
 
336
335
  | Setting | Meaning | Local default | In production |
337
336
  |---|---|---|---|
338
- | `GRAPHCORE_IDENTITY_DOMAIN` | The identity domain (realm) this project belongs to | the project name | the same; read by `apply` only |
339
- | `GRAPHCORE_IDENTITY_DISPLAY_NAME` | The realm's display name, on its login page | the domain | Keycloak only |
340
- | `GRAPHCORE_IDENTITY_LOGIN_THEME` | The realm's login theme | `graphcore` | Keycloak only; a theme installed there |
341
- | `GRAPHCORE_IDENTITY_REGISTRATION` | Whether people may register themselves | `true` | Keycloak only |
342
- | `GRAPHCORE_IDENTITY_LINKED_DOMAINS` | Domains linked to this one, both ways, comma-separated | none | Keycloak only; all on one Keycloak |
337
+ | `GRAPHCORE_IDENTITY_DOMAIN` | The identity domain (realm) this project belongs to | the project name | Read by `render` only; your realm's name |
338
+ | `GRAPHCORE_IDENTITY_DISPLAY_NAME` | The realm's display name, on its login page | the domain | Read by `render` only; set it in your realm |
339
+ | `GRAPHCORE_IDENTITY_LOGIN_THEME` | The realm's login theme | `graphcore` | Read by `render` only; set it in your realm |
340
+ | `GRAPHCORE_IDENTITY_REGISTRATION` | Whether people may register themselves | `true` | Read by `render` only; set it in your realm |
341
+ | `GRAPHCORE_IDENTITY_LINKED_DOMAINS` | Domains linked to this one, both ways, comma-separated | none | Not used; configure links in your provider |
343
342
  | `GRAPHCORE_OIDC_ISSUER` | The issuer URL the backend trusts. With `apply`, must be `<keycloak>/realms/<domain>` | `http://localhost:8180/realms/<domain>` | Your provider's issuer URL |
344
343
  | `GRAPHCORE_OIDC_AUDIENCE` | The audience tokens must carry | the domain | The audience your provider issues for the deployment |
345
344
  | `GRAPHCORE_OIDC_INTERNAL_URL` | Where this process fetches discovery and keys, and `apply` reaches the admin API, when the public URL is unreachable from it | unset; `graphcore docker up` sets it | Only when your network needs it |
346
- | `GRAPHCORE_KEYCLOAK_ADMIN`, `GRAPHCORE_KEYCLOAK_ADMIN_PASSWORD` | Admin credentials `apply` signs in with | `admin` / `admin`, local only | Required; from your secret store, given to `apply` only |
347
- | `GRAPHCORE_BACKEND_CLIENT_SECRET`, `*_CLIENT_SECRET` | Client secrets | generated into `.env` by `apply` | Required; from your secret store (`graphcore identity render --secrets` lists them) |
348
- | `VITE_OIDC_CLIENT_ID` | The public client the frontend signs in as | `graphcore-web` | Your provider's browser client id |
345
+ | `GRAPHCORE_KEYCLOAK_ADMIN`, `GRAPHCORE_KEYCLOAK_ADMIN_PASSWORD` | Admin credentials `apply` signs in with | `admin` / `admin`, local only | Not used |
346
+ | `GRAPHCORE_BACKEND_CLIENT_SECRET`, `*_CLIENT_SECRET` | Client secrets | generated into `.env` by `apply` | Required; from your secret store, the same values your realm holds (`graphcore identity render --secrets` lists them) |
347
+ | `GRAPHCORE_OIDC_WEB_CLIENT_ID` | The public client the web frontend signs in as; the backend gives it to the frontend at runtime | `graphcore-web` | Your provider's browser client id |
349
348
  | `GRAPHCORE_OIDC_CLI_CLIENT_ID` | The client `graphcore api login` signs in as | `graphcore-cli` | Your provider's device-grant client id |
350
349
 
351
350
  ## Why
@@ -18,7 +18,7 @@ distro does not provide something for production yet, the guide says so.
18
18
  | The framework packages | The release (`graphcore-distro` in `backend/requirements.txt`, `@graphcore/react` from npm), or the monorepo checkout for a `--local-framework` project | The release, installed from PyPI and npm; the project's Dockerfile builds an image from them with nothing else checked out. A `--local-framework` project needs the checkout next to it |
19
19
  | A Postgres database | One database per project on the shared Postgres from `graphcore infra up` (`graphcore db create`) | A database of your own, named by `POSTGRES_*` |
20
20
  | Redis | The shared Redis from `graphcore infra up`, one namespace per project (`REDIS_NS`) | A Redis of your own, `REDIS_URL` and `REDIS_NS` |
21
- | An OIDC issuer | A Keycloak realm per project on the shared Keycloak, created by `graphcore identity apply` | Any standard OIDC provider; see Identity |
21
+ | An OIDC issuer | A Keycloak realm per project on the shared Keycloak, created by `graphcore identity apply` | Any standard OIDC provider, configured by your deployment tooling; see Identity |
22
22
  | The backend processes | `graphcore run` (web, worker and beat in one process) or `graphcore docker up` | `graphcore run --role web`, `--role worker`, and exactly one `--role beat` |
23
23
  | The web frontend | The Vite dev server (`graphcore frontend up`) | A static build served by any web server; see Frontend |
24
24
 
@@ -38,11 +38,13 @@ not required.
38
38
  | `POSTGRES_POOL_MAX_SIZE`, `GRAPHCORE_DB_THREADS` | `10` pooled connections and `4` query threads per process | Keep the threads below the pool size, and every process's pool together below your database's connection limit |
39
39
  | `REDIS_URL` (or `REDIS_HOST`, `REDIS_PORT`), `REDIS_NS` | the shared infra Redis | Your Redis; a namespace unique to the deployment |
40
40
  | `GRAPHCORE_OIDC_ISSUER`, `GRAPHCORE_OIDC_AUDIENCE` | the project's realm on the local Keycloak | Your provider's issuer URL and the audience its tokens carry for this deployment |
41
+ | `GRAPHCORE_OIDC_WEB_CLIENT_ID` | `graphcore-web` | Your provider's browser client id. The backend gives it to the frontend at runtime |
41
42
  | `GRAPHCORE_PUBLIC_URL` | unset (the request's own host) | The backend's public origin, when it sits behind a proxy |
43
+ | `GRAPHCORE_RESOURCE_SCOPES` | unset | Scopes MCP hosts ask for when they register a client, comma-separated. Leave unset unless your provider needs them; a host then gets the provider's default scopes |
42
44
  | `GRAPHCORE_WEB_URL` | `http://localhost:$FRONTEND_PORT` | The web app's public URL, base path included (it must match `basePath`). Agents link users to pages there |
43
45
  | `CORS_ALLOWED_ORIGINS` | `localhost` and `127.0.0.1` on `FRONTEND_PORT` (`3000`), and the origin of `GRAPHCORE_WEB_URL` | The frontend's public origin(s); unset allows the origin of `GRAPHCORE_WEB_URL` |
44
- | `GRAPHCORE_BACKEND_CLIENT_SECRET`, `*_CLIENT_SECRET` | generated into `.env` by `graphcore identity apply` | Generated once, kept in your secret store; `graphcore identity render --secrets` lists them |
45
- | `VITE_API_URL`, `VITE_WS_URL`, `VITE_OIDC_CLIENT_ID` | the local backend on `BACKEND_PORT` (`8000`) and `graphcore-web` | The backend's public URL and host, and your provider's browser client id. Read when the frontend is built, not when it runs |
46
+ | `GRAPHCORE_BACKEND_CLIENT_SECRET`, `*_CLIENT_SECRET` | generated into `.env` by `graphcore identity apply` | Generated once, kept in your secret store and registered with your provider; `graphcore identity render --secrets` lists them |
47
+ | `VITE_API_URL`, `VITE_WS_URL` | the local backend on `BACKEND_PORT` (`8000`) | The backend's public URL and host. Read when the frontend is built, not when it runs |
46
48
 
47
49
  ## Steps on every deploy
48
50
 
@@ -50,7 +52,6 @@ Run these from the project root, with the production settings in the
50
52
  environment:
51
53
 
52
54
  ```bash
53
- graphcore identity apply # only when the issuer is Keycloak; see Identity
54
55
  graphcore migrate # safe to run from several replicas at once
55
56
  ```
56
57
 
@@ -67,21 +68,22 @@ settings, from wherever you run one-off commands against the deployment
67
68
 
68
69
  The backend trusts any OIDC provider that meets the kernel's contract
69
70
  (`graphcore docs kernel/authentication`). Keycloak is what the distro runs
70
- locally, not a requirement. `graphcore docs distro/identity-infrastructure`,
71
- under *In production*, lists what a provider must offer and the clients to
72
- register with it. In short:
73
-
74
- - **With Keycloak**, `graphcore identity apply` configures the realm for
75
- you. Run it from the deploy pipeline with `GRAPHCORE_OIDC_ISSUER` naming
76
- your Keycloak, and its admin credentials and the realm's client secrets
77
- from your secret store (`graphcore identity render --secrets` lists them).
78
- A Keycloak not at `localhost` gets no development settings, and `apply`
79
- generates no secret and tries no default admin login for it.
80
- - **With another provider**, register the web, CLI, MCP and service-account
81
- clients there yourself, set `GRAPHCORE_OIDC_ISSUER`,
82
- `GRAPHCORE_OIDC_AUDIENCE` and `VITE_OIDC_CLIENT_ID`, and do not run
83
- `apply`. Domains, linking and delegation are then the provider's to
84
- configure, and service accounts need it to let you choose client ids.
71
+ locally, not a requirement. The deployment owns its provider's
72
+ configuration: the project only reads the settings that name it
73
+ (`GRAPHCORE_OIDC_ISSUER`, `GRAPHCORE_OIDC_AUDIENCE`,
74
+ `GRAPHCORE_OIDC_WEB_CLIENT_ID` and the client secrets).
75
+ `graphcore docs distro/identity-infrastructure`, under *In production*,
76
+ lists what a provider must offer and the clients to register with it.
77
+
78
+ - **With Keycloak**, define the project's realm in your deployment tooling,
79
+ for example as a realm file your pipeline imports.
80
+ `graphcore identity render` prints the realm `apply` builds locally, with
81
+ each secret as its variable: use it as the reference for the clients,
82
+ scopes and policies the realm must hold. `graphcore identity apply` sets
83
+ up the local Keycloak only and refuses any other.
84
+ - **With another provider**, register the same clients there. Domains,
85
+ linking and delegation are then the provider's to configure, and service
86
+ accounts need it to let you choose client ids.
85
87
 
86
88
  ## Frontend
87
89
 
@@ -106,25 +106,25 @@ graphcore api execute-strategy --await-response \
106
106
  The declaration, the principal and the grants are the same, and `graphcore
107
107
  migrate` creates the account on deploy as it does locally. What changes:
108
108
 
109
- - **Registering the client.** With Keycloak, run `graphcore identity apply`
110
- against the production Keycloak from your deploy pipeline
111
- (`graphcore docs distro/production`). With another provider, register a
112
- confidential client-credentials client whose id is exactly
109
+ - **Registering the client.** Your deployment tooling registers it with the
110
+ provider (`graphcore docs distro/identity-infrastructure`, *In
111
+ production*): a confidential client-credentials client whose id is exactly
113
112
  `<app_id>-<name>`, whose tokens carry that id in `azp` and the
114
113
  deployment's audience in `aud`. A provider that assigns its own client ids
115
114
  cannot be used for service accounts yet.
116
- - **The secret.** Give the process its client id and secret from your
117
- secret store, through its environment. `apply` keeps the secret it
118
- generates in the project's `.env`; copy it from there into the store.
115
+ - **The secret.** Generate it once and keep it in your secret store. Set it
116
+ on the client at the provider, and give the process its client id and
117
+ secret through its environment.
119
118
  - **The token endpoint** is the issuer's, found at
120
119
  `<issuer>/.well-known/openid-configuration` (`token_endpoint`).
121
120
 
122
121
  ## Changing or removing one
123
122
 
124
- - **Rotating the secret.** With Keycloak: delete the variable from `.env` and
125
- run `graphcore identity apply`, which generates a new secret and sets it on
126
- the client. The old one stops working at once, so update the process in
127
- the same step. With another provider, rotate it in the provider's console.
123
+ - **Rotating the secret.** Locally: delete the variable from `.env` and run
124
+ `graphcore identity apply`, which generates a new secret and sets it on the
125
+ client. In production, set a new secret on the client at the provider and
126
+ in your secret store. The old one stops working at once, so update the
127
+ process in the same step.
128
128
  - **Recreating the client** at the issuer gives its tokens a new `sub`. The
129
129
  account and its grants stay: the backend recognizes the client by its id,
130
130
  not by `sub`. A token for the client from a different issuer is refused.
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "graphcore-distro"
7
- version = "0.2.1"
7
+ version = "0.2.3"
8
8
  description = "GraphCore distro — CLI, scaffolding, and curated built-in apps"
9
9
  readme = "README.md"
10
10
  license = "Apache-2.0"
@@ -20,8 +20,8 @@ classifiers = [
20
20
  "Framework :: Django :: 5.2",
21
21
  ]
22
22
  dependencies = [
23
- "graphcore-kernel[redis,server]==0.2.1",
24
- "graphcore-agents==0.2.1",
23
+ "graphcore-kernel[redis,server]==0.2.3",
24
+ "graphcore-agents==0.2.3",
25
25
  "python-dotenv>=1.0,<2",
26
26
  ]
27
27
 
@@ -1,3 +0,0 @@
1
- graphcore-kernel[redis,server]==0.2.1
2
- graphcore-agents==0.2.1
3
- python-dotenv<2,>=1.0