@cratis/pi 8.4.1 → 8.6.0
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.
- package/package/corpus/harnesses/copilot/instructions/ai-distribution.instructions.md +2 -1
- package/package/corpus/harnesses/copilot/instructions/exit-codes-and-wrappers.instructions.md +1 -1
- package/package/corpus/harnesses/copilot/instructions/glossary.instructions.md +5 -3
- package/package/corpus/harnesses/copilot/instructions/react.instructions.md +3 -1
- package/package/corpus/harnesses/copilot/instructions/reactors.instructions.md +3 -1
- package/package/corpus/harnesses/copilot/instructions/scripting.instructions.md +2 -1
- package/package/corpus/harnesses/copilot/instructions/specs.csharp.instructions.md +6 -3
- package/package/corpus/harnesses/copilot/instructions/vertical-slices.instructions.md +5 -2
- package/package/corpus/hooks/scripts/cratis-guard-secrets.sh +131 -9
- package/package/corpus/rules/ai-distribution.md +2 -1
- package/package/corpus/rules/exit-codes-and-wrappers.md +1 -1
- package/package/corpus/rules/glossary.md +5 -3
- package/package/corpus/rules/react.md +3 -1
- package/package/corpus/rules/reactors.md +3 -1
- package/package/corpus/rules/scripting.md +2 -1
- package/package/corpus/rules/specs.csharp.md +6 -3
- package/package/corpus/rules/vertical-slices.md +5 -2
- package/package/corpus/skills/cratis-application-growth/SKILL.md +1 -2
- package/package/corpus/skills/cratis-application-growth/references/csharp.md +1 -3
- package/package/corpus/skills/cratis-application-growth/references/move-and-untangle.md +1 -2
- package/package/corpus/skills/cratis-application-growth/references/rename-window.md +1 -3
- package/package/corpus/skills/cratis-application-growth/references/service-and-delivery.md +3 -2
- package/package/corpus/skills/cratis-application-growth/references/stages.md +2 -2
- package/package/corpus/skills/cratis-arc-authorize-request/SKILL.md +3 -3
- package/package/corpus/skills/cratis-arc-authorize-request/references/authproxy.md +47 -3
- package/package/corpus/skills/cratis-arc-authorize-request/references/csharp-query-security.md +18 -3
- package/package/corpus/skills/cratis-arc-authorize-request/references/csharp.md +12 -3
- package/package/corpus/skills/cratis-arc-authorize-request/references/typescript.md +2 -0
- package/package/corpus/skills/cratis-arc-connect-storage/references/csharp.md +1 -0
- package/package/corpus/skills/cratis-arc-connect-storage/references/elixir.md +9 -2
- package/package/corpus/skills/cratis-arc-declare-command/SKILL.md +2 -0
- package/package/corpus/skills/cratis-arc-declare-command/references/csharp-chronicle.md +47 -8
- package/package/corpus/skills/cratis-arc-declare-command/references/csharp-controller.md +3 -1
- package/package/corpus/skills/cratis-arc-declare-command/references/csharp-history.md +6 -3
- package/package/corpus/skills/cratis-arc-declare-command/references/csharp.md +38 -11
- package/package/corpus/skills/cratis-arc-declare-command/references/go.md +1 -1
- package/package/corpus/skills/cratis-arc-declare-operation/references/csharp-abilities.md +2 -2
- package/package/corpus/skills/cratis-arc-declare-operation/references/csharp-recovery.md +6 -4
- package/package/corpus/skills/cratis-arc-declare-operation/references/csharp.md +2 -2
- package/package/corpus/skills/cratis-arc-diagnose-live-query/SKILL.md +1 -1
- package/package/corpus/skills/cratis-arc-diagnose-live-query/references/csharp.md +29 -7
- package/package/corpus/skills/cratis-arc-diagnose-live-query/references/java.md +1 -1
- package/package/corpus/skills/cratis-arc-diagnose-live-query/references/kotlin.md +1 -1
- package/package/corpus/skills/cratis-arc-expose-mcp-operation/references/csharp-diagnose-tool-call.md +9 -7
- package/package/corpus/skills/cratis-arc-expose-mcp-operation/references/csharp.md +52 -1
- package/package/corpus/skills/cratis-arc-expose-query/SKILL.md +4 -2
- package/package/corpus/skills/cratis-arc-expose-query/references/csharp.md +36 -10
- package/package/corpus/skills/cratis-arc-expose-query/references/go.md +2 -2
- package/package/corpus/skills/cratis-arc-expose-query/references/typescript.md +6 -3
- package/package/corpus/skills/cratis-arc-generate-proxies/SKILL.md +1 -0
- package/package/corpus/skills/cratis-arc-generate-proxies/references/csharp.md +55 -6
- package/package/corpus/skills/cratis-arc-generate-proxies/references/typescript.md +9 -0
- package/package/corpus/skills/cratis-arc-host-application/SKILL.md +1 -1
- package/package/corpus/skills/cratis-arc-host-application/references/csharp-configuration.md +54 -0
- package/package/corpus/skills/cratis-arc-host-application/references/csharp-deployment.md +98 -0
- package/package/corpus/skills/cratis-arc-host-application/references/csharp-http.md +9 -1
- package/package/corpus/skills/cratis-arc-host-application/references/csharp-identity.md +87 -4
- package/package/corpus/skills/cratis-arc-host-application/references/csharp.md +9 -0
- package/package/corpus/skills/cratis-arc-invoke-command/references/csharp-extensions.md +4 -0
- package/package/corpus/skills/cratis-arc-invoke-command/references/csharp.md +2 -1
- package/package/corpus/skills/cratis-arc-isolate-tenant/SKILL.md +19 -2
- package/package/corpus/skills/cratis-arc-isolate-tenant/references/csharp.md +4 -2
- package/package/corpus/skills/cratis-arc-page-query/references/csharp.md +2 -0
- package/package/corpus/skills/cratis-arc-react-bind-slice/SKILL.md +33 -36
- package/package/corpus/skills/cratis-arc-react-bind-slice/references/typescript-commands.md +18 -3
- package/package/corpus/skills/cratis-arc-react-bind-slice/references/typescript-host.md +94 -19
- package/package/corpus/skills/cratis-arc-react-bind-slice/references/typescript-identity.md +29 -5
- package/package/corpus/skills/cratis-arc-react-bind-slice/references/typescript-instant-feedback.md +81 -0
- package/package/corpus/skills/cratis-arc-react-bind-slice/references/typescript-localization.md +80 -0
- package/package/corpus/skills/cratis-arc-react-bind-slice/references/typescript-navigation.md +103 -0
- package/package/corpus/skills/cratis-arc-react-bind-slice/references/typescript-queries.md +41 -2
- package/package/corpus/skills/cratis-arc-react-bind-slice/references/typescript-structure.md +117 -0
- package/package/corpus/skills/cratis-arc-react-bind-slice/references/typescript.md +8 -4
- package/package/corpus/skills/cratis-arc-react-separate-view-model/SKILL.md +3 -3
- package/package/corpus/skills/cratis-arc-react-separate-view-model/references/typescript.md +27 -6
- package/package/corpus/skills/cratis-arc-testing-typescript/references/typescript.md +2 -2
- package/package/corpus/skills/cratis-arc-validate-command/references/csharp-rules.md +23 -2
- package/package/corpus/skills/cratis-arc-validate-command/references/csharp.md +28 -2
- package/package/corpus/skills/cratis-arc-validation-typescript/SKILL.md +1 -0
- package/package/corpus/skills/cratis-authproxy-configure/SKILL.md +136 -0
- package/package/corpus/skills/cratis-authproxy-configure/references/admission.md +125 -0
- package/package/corpus/skills/cratis-authproxy-configure/references/aspire.md +154 -0
- package/package/corpus/skills/cratis-authproxy-configure/references/operations.md +122 -0
- package/package/corpus/skills/cratis-authproxy-configure/references/services-and-routing.md +114 -0
- package/package/corpus/skills/cratis-authproxy-configure/references/sessions-and-logout.md +126 -0
- package/package/corpus/skills/cratis-authproxy-configure/references/sign-in-providers.md +116 -0
- package/package/corpus/skills/cratis-authproxy-configure/references/tenant-resolution.md +135 -0
- package/package/corpus/skills/cratis-choreography-run-workflow/SKILL.md +117 -0
- package/package/corpus/skills/cratis-choreography-run-workflow/references/csharp-chronicle.md +164 -0
- package/package/corpus/skills/cratis-choreography-run-workflow/references/csharp.md +354 -0
- package/package/corpus/skills/cratis-chronicle-cli-operations/SKILL.md +6 -6
- package/package/corpus/skills/cratis-chronicle-cli-operations/references/inspection.md +11 -3
- package/package/corpus/skills/cratis-chronicle-cli-operations/references/project-tooling.md +50 -0
- package/package/corpus/skills/cratis-chronicle-cli-operations/references/recovery-and-comparison.md +17 -3
- package/package/corpus/skills/cratis-chronicle-cli-operations/references/setup-and-target.md +8 -2
- package/package/corpus/skills/cratis-chronicle-connect-application/references/csharp-services.md +13 -2
- package/package/corpus/skills/cratis-chronicle-connect-application/references/csharp.md +12 -0
- package/package/corpus/skills/cratis-chronicle-connect-application/references/kotlin.md +2 -0
- package/package/corpus/skills/cratis-chronicle-connect-application/references/python.md +2 -2
- package/package/corpus/skills/cratis-chronicle-connect-application/references/typescript.md +10 -1
- package/package/corpus/skills/cratis-chronicle-constrain-append/SKILL.md +9 -2
- package/package/corpus/skills/cratis-chronicle-constrain-append/references/csharp.md +35 -3
- package/package/corpus/skills/cratis-chronicle-constrain-append/references/go.md +1 -1
- package/package/corpus/skills/cratis-chronicle-constrain-append/references/operations.md +70 -0
- package/package/corpus/skills/cratis-chronicle-deploy-kernel/SKILL.md +6 -3
- package/package/corpus/skills/cratis-chronicle-deploy-kernel/references/configuration.md +113 -16
- package/package/corpus/skills/cratis-chronicle-deploy-kernel/references/container-and-kubernetes.md +293 -0
- package/package/corpus/skills/cratis-chronicle-deploy-kernel/references/kernel-options.md +16 -9
- package/package/corpus/skills/cratis-chronicle-deploy-kernel/references/network-and-tls.md +60 -7
- package/package/corpus/skills/cratis-chronicle-deploy-kernel/references/storage.md +124 -2
- package/package/corpus/skills/cratis-chronicle-deploy-kernel/references/upgrade-and-recovery.md +36 -1
- package/package/corpus/skills/cratis-chronicle-evolve-event/SKILL.md +12 -0
- package/package/corpus/skills/cratis-chronicle-evolve-event/references/csharp.md +2 -2
- package/package/corpus/skills/cratis-chronicle-inspect-observer/SKILL.md +15 -5
- package/package/corpus/skills/cratis-chronicle-inspect-observer/references/csharp.md +9 -8
- package/package/corpus/skills/cratis-chronicle-inspect-observer/references/go.md +2 -2
- package/package/corpus/skills/cratis-chronicle-mcp-inspection/SKILL.md +1 -1
- package/package/corpus/skills/cratis-chronicle-mcp-inspection/references/deployment.md +1 -1
- package/package/corpus/skills/cratis-chronicle-project-view/SKILL.md +2 -2
- package/package/corpus/skills/cratis-chronicle-project-view/references/csharp-fluent.md +15 -4
- package/package/corpus/skills/cratis-chronicle-project-view/references/csharp-model-bound.md +4 -1
- package/package/corpus/skills/cratis-chronicle-project-view/references/csharp-reading.md +5 -2
- package/package/corpus/skills/cratis-chronicle-project-view/references/csharp.md +23 -0
- package/package/corpus/skills/cratis-chronicle-project-view/references/elixir.md +1 -0
- package/package/corpus/skills/cratis-chronicle-project-view/references/go.md +2 -1
- package/package/corpus/skills/cratis-chronicle-project-view/references/java.md +3 -1
- package/package/corpus/skills/cratis-chronicle-project-view/references/kotlin.md +4 -3
- package/package/corpus/skills/cratis-chronicle-project-view/references/typescript.md +3 -1
- package/package/corpus/skills/cratis-chronicle-protect-decision/SKILL.md +3 -1
- package/package/corpus/skills/cratis-chronicle-protect-decision/references/csharp-scopes.md +41 -4
- package/package/corpus/skills/cratis-chronicle-protect-decision/references/csharp.md +22 -4
- package/package/corpus/skills/cratis-chronicle-protect-decision/references/elixir.md +7 -0
- package/package/corpus/skills/cratis-chronicle-protect-decision/references/go.md +9 -1
- package/package/corpus/skills/cratis-chronicle-protect-decision/references/java.md +8 -0
- package/package/corpus/skills/cratis-chronicle-protect-decision/references/kotlin.md +9 -0
- package/package/corpus/skills/cratis-chronicle-protect-decision/references/typescript.md +7 -0
- package/package/corpus/skills/cratis-chronicle-protect-personal-data/SKILL.md +1 -1
- package/package/corpus/skills/cratis-chronicle-protect-personal-data/references/csharp.md +28 -3
- package/package/corpus/skills/cratis-chronicle-publish-contract/SKILL.md +7 -6
- package/package/corpus/skills/cratis-chronicle-publish-contract/references/csharp.md +41 -0
- package/package/corpus/skills/cratis-chronicle-publish-contract/references/elixir-integrations.md +3 -3
- package/package/corpus/skills/cratis-chronicle-publish-contract/references/webhook-signature-wire-format.md +82 -0
- package/package/corpus/skills/cratis-chronicle-react-to-fact/SKILL.md +19 -1
- package/package/corpus/skills/cratis-chronicle-react-to-fact/references/csharp-outputs.md +3 -1
- package/package/corpus/skills/cratis-chronicle-react-to-fact/references/csharp-pages.md +1 -1
- package/package/corpus/skills/cratis-chronicle-react-to-fact/references/csharp.md +37 -4
- package/package/corpus/skills/cratis-chronicle-react-to-fact/references/elixir.md +11 -0
- package/package/corpus/skills/cratis-chronicle-react-to-fact/references/java.md +2 -1
- package/package/corpus/skills/cratis-chronicle-react-to-fact/references/kotlin.md +1 -0
- package/package/corpus/skills/cratis-chronicle-record-event/SKILL.md +3 -3
- package/package/corpus/skills/cratis-chronicle-record-event/references/csharp-coordination.md +31 -2
- package/package/corpus/skills/cratis-chronicle-record-event/references/csharp-history.md +21 -4
- package/package/corpus/skills/cratis-chronicle-record-event/references/csharp.md +20 -2
- package/package/corpus/skills/cratis-chronicle-record-event/references/go.md +1 -1
- package/package/corpus/skills/cratis-chronicle-record-event/references/java.md +1 -1
- package/package/corpus/skills/cratis-chronicle-record-event/references/kotlin.md +3 -0
- package/package/corpus/skills/cratis-chronicle-reduce-state/SKILL.md +2 -1
- package/package/corpus/skills/cratis-chronicle-reduce-state/references/csharp.md +3 -1
- package/package/corpus/skills/cratis-chronicle-reduce-state/references/java.md +10 -1
- package/package/corpus/skills/cratis-chronicle-reduce-state/references/kotlin.md +10 -1
- package/package/corpus/skills/cratis-chronicle-reduce-state/references/typescript.md +27 -5
- package/package/corpus/skills/cratis-chronicle-select-client/SKILL.md +18 -0
- package/package/corpus/skills/cratis-chronicle-select-client/references/elixir.md +21 -1
- package/package/corpus/skills/cratis-chronicle-select-client/references/go.md +13 -0
- package/package/corpus/skills/cratis-chronicle-select-client/references/java.md +15 -0
- package/package/corpus/skills/cratis-chronicle-select-client/references/kotlin.md +15 -0
- package/package/corpus/skills/cratis-chronicle-select-client/references/typescript.md +16 -0
- package/package/corpus/skills/cratis-chronicle-web-workbench/SKILL.md +1 -1
- package/package/corpus/skills/cratis-ci-pipeline-performance/SKILL.md +4 -3
- package/package/corpus/skills/cratis-ci-pipeline-performance/references/publish-pipelines.md +19 -4
- package/package/corpus/skills/cratis-code-review/SKILL.md +6 -2
- package/package/corpus/skills/cratis-code-review/references/csharp-diagnostics.md +28 -2
- package/package/corpus/skills/cratis-code-review/references/csharp.md +4 -4
- package/package/corpus/skills/cratis-commits-and-pull-requests/SKILL.md +6 -38
- package/package/corpus/skills/cratis-commits-and-pull-requests/references/pr-description.md +2 -0
- package/package/corpus/skills/cratis-commits-and-pull-requests/references/pr-labels-and-release.md +5 -4
- package/package/corpus/skills/cratis-commits-and-pull-requests/references/workflow-inputs.md +39 -0
- package/package/corpus/skills/cratis-components-accessibility/SKILL.md +6 -8
- package/package/corpus/skills/cratis-components-accessibility/references/typescript.md +32 -14
- package/package/corpus/skills/cratis-components-build-canvas/SKILL.md +4 -3
- package/package/corpus/skills/cratis-components-build-canvas/references/typescript-props.md +1 -1
- package/package/corpus/skills/cratis-components-build-canvas/references/typescript.md +4 -2
- package/package/corpus/skills/cratis-components-choose-control/SKILL.md +13 -7
- package/package/corpus/skills/cratis-components-choose-control/references/from-primereact.md +116 -0
- package/package/corpus/skills/cratis-components-choose-control/references/menu.md +90 -0
- package/package/corpus/skills/cratis-components-choose-control/references/typescript-composition.md +48 -0
- package/package/corpus/skills/cratis-components-choose-control/references/typescript.md +2 -2
- package/package/corpus/skills/cratis-components-compose-toolbar/SKILL.md +2 -1
- package/package/corpus/skills/cratis-components-compose-toolbar/references/floating-toolbar.md +146 -0
- package/package/corpus/skills/cratis-components-diagnose-screen/SKILL.md +102 -0
- package/package/corpus/skills/cratis-components-display-list/SKILL.md +10 -10
- package/package/corpus/skills/cratis-components-display-list/references/typescript-custom-panel.md +74 -0
- package/package/corpus/skills/cratis-components-display-list/references/typescript-datatables.md +2 -7
- package/package/corpus/skills/cratis-components-display-list/references/typescript.md +3 -2
- package/package/corpus/skills/cratis-components-submit-form/SKILL.md +6 -6
- package/package/corpus/skills/cratis-components-submit-form/references/typescript-commanddialog.md +21 -1
- package/package/corpus/skills/cratis-components-submit-form/references/typescript-commandform.md +72 -2
- package/package/corpus/skills/cratis-components-submit-form/references/typescript.md +7 -5
- package/package/corpus/skills/cratis-components-theme-application/SKILL.md +17 -15
- package/package/corpus/skills/cratis-components-theme-application/references/localization.md +166 -0
- package/package/corpus/skills/cratis-components-theme-application/references/typescript.md +18 -14
- package/package/corpus/skills/cratis-components-theme-application/references/upgrade-from-previous-major.md +141 -0
- package/package/corpus/skills/cratis-engineering-csharp-conventions/SKILL.md +2 -0
- package/package/corpus/skills/cratis-engineering-csharp-conventions/references/csharp-domain-philosophy.md +31 -3
- package/package/corpus/skills/cratis-engineering-csharp-conventions/references/csharp-fundamentals-helpers.md +119 -0
- package/package/corpus/skills/cratis-engineering-csharp-conventions/references/csharp.md +4 -0
- package/package/corpus/skills/cratis-fundamentals-concept/references/csharp-serialization.md +72 -1
- package/package/corpus/skills/cratis-fundamentals-concept/references/csharp.md +9 -0
- package/package/corpus/skills/cratis-fundamentals-concept/references/go.md +2 -1
- package/package/corpus/skills/cratis-fundamentals-concept/references/java-json.md +3 -2
- package/package/corpus/skills/cratis-fundamentals-concept/references/kotlin-json.md +3 -2
- package/package/corpus/skills/cratis-fundamentals-concept/references/typescript-serialization.md +41 -2
- package/package/corpus/skills/cratis-fundamentals-name-value/SKILL.md +8 -7
- package/package/corpus/skills/cratis-fundamentals-name-value/references/csharp.md +2 -1
- package/package/corpus/skills/cratis-fundamentals-type-discovery/SKILL.md +3 -3
- package/package/corpus/skills/cratis-fundamentals-type-discovery/references/csharp-diagnostics.md +8 -0
- package/package/corpus/skills/cratis-fundamentals-type-discovery/references/csharp.md +2 -2
- package/package/corpus/skills/cratis-fundamentals-type-discovery/references/go-dependency-injection.md +3 -0
- package/package/corpus/skills/cratis-modeling-design-event-model/SKILL.md +6 -4
- package/package/corpus/skills/cratis-modeling-design-event-model/references/command-inventory.md +7 -1
- package/package/corpus/skills/cratis-modeling-design-event-model/references/model-first.md +13 -1
- package/package/corpus/skills/cratis-modeling-design-event-model/references/review-one-slice.md +6 -0
- package/package/corpus/skills/cratis-multi-service-local-orchestration/SKILL.md +6 -6
- package/package/corpus/skills/cratis-multi-service-local-orchestration/references/csharp-aspire.md +116 -28
- package/package/corpus/skills/cratis-multi-service-local-orchestration/references/docker-compose.md +2 -2
- package/package/corpus/skills/cratis-observability/references/chronicle-kernel-export.md +46 -0
- package/package/corpus/skills/cratis-orleans-jobs/SKILL.md +4 -2
- package/package/corpus/skills/cratis-platform-build-application/SKILL.md +8 -0
- package/package/corpus/skills/cratis-platform-build-application/references/cratis-identity.md +71 -0
- package/package/corpus/skills/cratis-platform-build-application/references/studio-repository.md +96 -0
- package/package/corpus/skills/cratis-platform-deliver-slice/SKILL.md +14 -8
- package/package/corpus/skills/cratis-platform-deliver-slice/references/csharp.md +167 -3
- package/package/corpus/skills/cratis-platform-deliver-slice/references/eventual-consistency.md +150 -0
- package/package/corpus/skills/cratis-platform-deliver-slice/references/typescript.md +14 -1
- package/package/corpus/skills/cratis-platform-diagnose-slice/SKILL.md +1 -1
- package/package/corpus/skills/cratis-platform-prepare-release-pr/SKILL.md +8 -8
- package/package/corpus/skills/cratis-platform-prepare-release-pr/references/product-release-checks.md +16 -2
- package/package/corpus/skills/cratis-platform-start-application/SKILL.md +21 -0
- package/package/corpus/skills/cratis-platform-start-application/references/csharp.md +77 -3
- package/package/corpus/skills/cratis-platform-upgrade-application/SKILL.md +118 -0
- package/package/corpus/skills/cratis-platform-upgrade-application/references/csharp.md +117 -0
- package/package/corpus/skills/cratis-platform-upgrade-application/references/java.md +53 -0
- package/package/corpus/skills/cratis-platform-upgrade-application/references/kotlin.md +53 -0
- package/package/corpus/skills/cratis-platform-upgrade-application/references/typescript.md +71 -0
- package/package/corpus/skills/cratis-release-notes/SKILL.md +1 -1
- package/package/corpus/skills/cratis-release-notes/references/publish-repair.md +6 -3
- package/package/corpus/skills/cratis-screenplay-accept-model/references/csharp.md +34 -3
- package/package/corpus/skills/cratis-screenplay-accept-model/references/read-the-evidence.md +84 -3
- package/package/corpus/skills/cratis-screenplay-declare-slice/SKILL.md +7 -11
- package/package/corpus/skills/cratis-screenplay-declare-slice/references/commands.md +8 -4
- package/package/corpus/skills/cratis-screenplay-declare-slice/references/projections.md +2 -0
- package/package/corpus/skills/cratis-screenplay-declare-slice/references/structure-and-imports.md +29 -1
- package/package/corpus/skills/cratis-screenplay-edit-workspace/SKILL.md +2 -1
- package/package/corpus/skills/cratis-screenplay-edit-workspace/references/mcp-tools.md +1 -1
- package/package/corpus/skills/cratis-screenplay-handoff-slice/references/csharp.md +13 -1
- package/package/corpus/skills/cratis-screenplay-model-translation/SKILL.md +1 -1
- package/package/corpus/skills/cratis-screenplay-model-translation/references/boundary-diagnostics.md +1 -1
- package/package/corpus/skills/cratis-screenplay-onboard-workspace/SKILL.md +30 -51
- package/package/corpus/skills/cratis-screenplay-onboard-workspace/references/cli.md +19 -2
- package/package/corpus/skills/cratis-screenplay-onboard-workspace/references/smallest-model.md +87 -0
- package/package/corpus/skills/cratis-screenplay-onboard-workspace/references/studio.md +5 -0
- package/package/corpus/skills/cratis-screenplay-onboard-workspace/references/typescript.md +13 -0
- package/package/corpus/skills/cratis-screenplay-onboard-workspace/references/workspace-mcp.md +5 -0
- package/package/corpus/skills/cratis-screenplay-specify-outcome/SKILL.md +8 -12
- package/package/corpus/skills/cratis-screenplay-specify-outcome/references/running-mcp.md +12 -0
- package/package/corpus/skills/cratis-screenplay-specify-outcome/references/scenarios.md +2 -2
- package/package/corpus/skills/cratis-specifications-exercise-backend/SKILL.md +2 -0
- package/package/corpus/skills/cratis-specifications-exercise-backend/references/csharp-colocated.md +101 -0
- package/package/corpus/skills/cratis-specifications-exercise-backend/references/csharp-command-results.md +4 -2
- package/package/corpus/skills/cratis-specifications-exercise-backend/references/csharp-decision-reads.md +1 -0
- package/package/corpus/skills/cratis-specifications-exercise-backend/references/csharp-events.md +7 -0
- package/package/corpus/skills/cratis-specifications-exercise-backend/references/csharp-integration.md +7 -4
- package/package/corpus/skills/cratis-specifications-exercise-backend/references/csharp-reactors.md +18 -5
- package/package/corpus/skills/cratis-specifications-exercise-backend/references/csharp-read-models.md +4 -2
- package/package/corpus/skills/cratis-specifications-exercise-backend/references/csharp.md +35 -2
- package/package/corpus/skills/cratis-specifications-exercise-backend/references/elixir.md +2 -0
- package/package/corpus/skills/cratis-specifications-exercise-backend/references/typescript.md +4 -2
- package/package/corpus/skills/cratis-specifications-isolate-behavior/SKILL.md +1 -1
- package/package/corpus/skills/cratis-specifications-isolate-behavior/references/csharp-running.md +10 -3
- package/package/corpus/skills/cratis-specifications-test-application-ui/references/typescript.md +22 -4
- package/package/corpus/skills/cratis-specifications-test-typescript-behavior/SKILL.md +2 -1
- package/package/corpus/skills/cratis-specifications-test-typescript-behavior/references/typescript.md +40 -0
- package/package/corpus/skills/cratis-stage-render-slice/SKILL.md +6 -0
- package/package/corpus/skills/cratis-stage-render-slice/references/semantic-conformance.md +64 -0
- package/package/profile-catalog.json +15 -0
- package/package.json +1 -1
|
@@ -0,0 +1,125 @@
|
|
|
1
|
+
# Admission: who gets past the proxy
|
|
2
|
+
|
|
3
|
+
## Contents
|
|
4
|
+
|
|
5
|
+
- Which gate decides
|
|
6
|
+
- Require a claim
|
|
7
|
+
- GitHub organizations and teams
|
|
8
|
+
- Narrow one service
|
|
9
|
+
- Let the application decide
|
|
10
|
+
- What a refused caller sees
|
|
11
|
+
- What the claim gate never covers
|
|
12
|
+
- Hide the deployment entirely
|
|
13
|
+
- Anti-patterns
|
|
14
|
+
|
|
15
|
+
## Which gate decides
|
|
16
|
+
|
|
17
|
+
Signing in proves who a person is. It does not decide whether they may come in. A social provider signs in every account it has, so on a public host declare who is admitted.
|
|
18
|
+
|
|
19
|
+
| The decision depends on | Use |
|
|
20
|
+
|---|---|
|
|
21
|
+
| A claim the sign-in provider issues: a role, a group, a GitHub organization or team | [Required claims](#require-a-claim) in the proxy. The default. |
|
|
22
|
+
| Application data: an invitation, a subscription, a membership the application stores | The application's [identity details](#let-the-application-decide). |
|
|
23
|
+
| Both | Both. Each one can refuse on its own. |
|
|
24
|
+
|
|
25
|
+
These gates decide who reaches the application at all. Each command and query still declares its own authorization: see `cratis-arc-authorize-request`.
|
|
26
|
+
|
|
27
|
+
## Require a claim
|
|
28
|
+
|
|
29
|
+
```json
|
|
30
|
+
{
|
|
31
|
+
"Cratis": {
|
|
32
|
+
"AuthProxy": {
|
|
33
|
+
"Authorization": {
|
|
34
|
+
"RequiredClaims": [
|
|
35
|
+
{ "Claim": "urn:github:organization", "AnyOf": [ "Acme" ] }
|
|
36
|
+
]
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
- Several entries in `RequiredClaims` must all be satisfied.
|
|
44
|
+
- Several values in one `AnyOf` are alternatives; one match is enough.
|
|
45
|
+
- Without `AnyOf` the claim only has to be present. Use that when the provider issues the claim solely to the people who should get in.
|
|
46
|
+
- Values are compared case-insensitively.
|
|
47
|
+
- An entry with a blank `Claim` stops the proxy at startup.
|
|
48
|
+
- The gate is off until a requirement is declared.
|
|
49
|
+
|
|
50
|
+
## GitHub organizations and teams
|
|
51
|
+
|
|
52
|
+
Add the `read:org` scope to the GitHub provider. The proxy then reads the person's organizations and teams during sign-in and adds them as claims:
|
|
53
|
+
|
|
54
|
+
| Claim | Value | Example |
|
|
55
|
+
|---|---|---|
|
|
56
|
+
| `urn:github:organization` | The organization's GitHub login | `Acme` |
|
|
57
|
+
| `urn:github:team` | `organization/team-slug` | `Acme/operations` |
|
|
58
|
+
|
|
59
|
+
Without the scope the claims are absent and every requirement on them refuses.
|
|
60
|
+
|
|
61
|
+
## Narrow one service
|
|
62
|
+
|
|
63
|
+
The same block on a service applies in addition to the root requirements:
|
|
64
|
+
|
|
65
|
+
```json
|
|
66
|
+
"Services": {
|
|
67
|
+
"admin": {
|
|
68
|
+
"Frontend": { "BaseUrl": "http://admin-web:3000/" },
|
|
69
|
+
"Authorization": {
|
|
70
|
+
"RequiredClaims": [
|
|
71
|
+
{ "Claim": "urn:github:team", "AnyOf": [ "Acme/operations" ] }
|
|
72
|
+
]
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
A service can narrow who reaches it, never widen it. The root requirements are a floor for every request that arrives on a proxy session. A bearer route is the one exception: with `IgnoreDeploymentRequiredClaims` it is held to its own `RequiredClaims` only, in place of the root and service requirements.
|
|
79
|
+
|
|
80
|
+
## Let the application decide
|
|
81
|
+
|
|
82
|
+
After sign-in the proxy calls `GET /.cratis/me` on each service that has a `Backend` and has not set `ResolveIdentityDetails: false`. With the default `IdentityVerification: Required` the answer is the admission verdict for that person in that tenant:
|
|
83
|
+
|
|
84
|
+
- Only a positive answer admits.
|
|
85
|
+
- A refusal, an error or no answer within the timeout (10 seconds by default) keeps the person out.
|
|
86
|
+
|
|
87
|
+
In an Arc backend the answer comes from the identity details provider: `IsUserAuthorized: false` refuses. See `cratis-arc-host-application` (identity reference) for writing it.
|
|
88
|
+
|
|
89
|
+
| Setting on the service | Use when |
|
|
90
|
+
|---|---|
|
|
91
|
+
| `IdentityVerification: Required` (default) | The application decides who may enter. Fails closed. |
|
|
92
|
+
| `IdentityVerification: BestEffort` | The endpoint only adds display details. A `403` denies, and so does a call the proxy cannot sign when the service is set up for the signed hop. An unavailable service does not keep anyone out. |
|
|
93
|
+
| `ResolveIdentityDetails: false` | The service has no `/.cratis/me` at all. |
|
|
94
|
+
|
|
95
|
+
- A positive verdict is reused: `Session:IdentityRevalidationInterval` (10 minutes by default) bounds the verdict stored with the session, and `Session:IdentityResultCacheDuration` (30 seconds by default) bounds the proxy's in-memory copy. Removing a person's access does not take effect on the next request, and neither setting is an exact deadline. Lower both to shorten the delay.
|
|
96
|
+
- When a `Required` service cannot be asked, the person gets `503` and keeps the session. That is an outage, not a refusal.
|
|
97
|
+
- `Required` needs a tenant: the proxy refuses to start with a `Required` service and no entry in `TenantResolutions`. See [tenant-resolution.md](tenant-resolution.md).
|
|
98
|
+
- A `roles` field in the answer is ignored. Roles reach backends only from the sign-in provider's claims.
|
|
99
|
+
|
|
100
|
+
## What a refused caller sees
|
|
101
|
+
|
|
102
|
+
| Caller | Response |
|
|
103
|
+
|---|---|
|
|
104
|
+
| A signed-in person who lacks a required claim | The not-authorized page with `403` and a sign-out link. |
|
|
105
|
+
| A bearer-route caller that lacks a required claim | `403` with the JSON body `{"error":"forbidden"}`. |
|
|
106
|
+
| A caller with no session | Not this gate: sign-in for a browser navigation, `401` for anything else. |
|
|
107
|
+
|
|
108
|
+
A caller refused by a required claim reaches nothing: no request is forwarded and `/.cratis/me` is not called. The proxy logs each refusal at warning level with the claim type that was not satisfied; look there first when someone is refused unexpectedly.
|
|
109
|
+
|
|
110
|
+
## What the claim gate never covers
|
|
111
|
+
|
|
112
|
+
- **Paths in a service's `AnonymousPaths`.** They are public by declaration. Declare the narrowest prefix that works and let the application authorize what it serves there.
|
|
113
|
+
- **The proxy's own sign-in and sign-out endpoints.** A person must reach them to obtain the claims.
|
|
114
|
+
|
|
115
|
+
## Hide the deployment entirely
|
|
116
|
+
|
|
117
|
+
By default the sign-in surface answers anyone, because a person has to reach it to sign in. For a deployment whose existence must not be discoverable, set `Admission:Mode` to `CapabilityOnly` and `Admission:Capability:VerifierUrl` to a verifier the deployment owns. The proxy then answers `404` to application paths, pages and the sign-in surface until a caller presents a capability the verifier admits. The management listener's health paths are not behind this gate. Admission decides whether anything is reachable; sign-in, required claims and tenancy apply unchanged afterwards. Use it only for that requirement.
|
|
118
|
+
|
|
119
|
+
## Anti-patterns
|
|
120
|
+
|
|
121
|
+
- A public host with a social provider and neither a required claim nor a `Required` identity verdict. Every account at that provider gets in.
|
|
122
|
+
- Treating the proxy gate as the application's authorization. It is the first gate; operations still declare `[Authorize]` or roles.
|
|
123
|
+
- Returning roles from `/.cratis/me` and expecting them on the forwarded principal.
|
|
124
|
+
- Switching a service to `BestEffort` to get past a failing `/.cratis/me`. It admits exactly when the proxy knows least. Fix the endpoint.
|
|
125
|
+
- A broad prefix such as `/api` in `AnonymousPaths`. It opens every operation under it.
|
|
@@ -0,0 +1,154 @@
|
|
|
1
|
+
# AuthProxy in an Aspire AppHost
|
|
2
|
+
|
|
3
|
+
## Contents
|
|
4
|
+
|
|
5
|
+
- Add the proxy
|
|
6
|
+
- Pair the backend
|
|
7
|
+
- Sign-in providers
|
|
8
|
+
- Admission
|
|
9
|
+
- Tenant resolution
|
|
10
|
+
- Services, hosts and paths
|
|
11
|
+
- Sessions and operations
|
|
12
|
+
- Settings without a method
|
|
13
|
+
- Anti-patterns
|
|
14
|
+
|
|
15
|
+
## Add the proxy
|
|
16
|
+
|
|
17
|
+
Reference the `Cratis.AuthProxy.Aspire` package in the AppHost project. Its methods write the same `Cratis:AuthProxy` settings as environment variables, so every rule in the other references applies unchanged.
|
|
18
|
+
|
|
19
|
+
```csharp
|
|
20
|
+
var authproxy = builder.AddAuthProxy("authproxy")
|
|
21
|
+
.WithHttpEndpoint(port: 8080)
|
|
22
|
+
.WithOidcProvider(
|
|
23
|
+
"Microsoft",
|
|
24
|
+
OidcProviderType.Microsoft,
|
|
25
|
+
authority: "https://login.microsoftonline.com/<tenant-id>/v2.0",
|
|
26
|
+
clientId: clientId,
|
|
27
|
+
clientSecret: clientSecret)
|
|
28
|
+
.WithSpecifiedTenantResolution("acme")
|
|
29
|
+
.WithBackend("main", api)
|
|
30
|
+
.WithSignedForwardingTo(api)
|
|
31
|
+
.WithFrontend("main", web);
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
- `AddAuthProxy(name, tag)` runs the `cratis/authproxy` container image. `tag` defaults to `latest`; pin a version for anything that is deployed.
|
|
35
|
+
- `"main"` is the service name. `WithBackend` and `WithFrontend` with the same name form one service.
|
|
36
|
+
- Both take an optional `endpointName`, default `"http"`, that selects the endpoint of the target resource.
|
|
37
|
+
- During a local run the AppHost makes the proxy trust the local Aspire ingress. A published deployment declares its own with `WithTrustedProxies`.
|
|
38
|
+
|
|
39
|
+
## Pair the backend
|
|
40
|
+
|
|
41
|
+
`WithSignedForwardingTo(api)` is the default for an Arc backend. It is a separate call; `WithBackend` does not imply it.
|
|
42
|
+
|
|
43
|
+
- It configures both sides: the proxy signs the identity it forwards, and the backend resource is set to trust forwarded identity and to accept only signed identity from this proxy.
|
|
44
|
+
- **Local run:** the AppHost generates a fresh key on every run. The run also selects the proxy's `LocalDevelopment` profile so the hop may use plain HTTP.
|
|
45
|
+
- **Publish:** no key is generated. Pass a secret parameter, provisioned with a base64-encoded, freshly generated 32-byte key, one per backend:
|
|
46
|
+
|
|
47
|
+
```csharp
|
|
48
|
+
var apiSigningKey = builder.AddParameter("api-signing-key", secret: true);
|
|
49
|
+
|
|
50
|
+
authproxy
|
|
51
|
+
.WithBackend("main", api)
|
|
52
|
+
.WithSignedForwardingTo(api, signingKey: apiSigningKey);
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
- Publishing without `signingKey` fails when the AppHost builds. A parameter that is not marked `secret: true` is refused.
|
|
56
|
+
- A published deployment also needs an HTTPS backend URL and a backend client certificate. See [operations.md](operations.md).
|
|
57
|
+
- A paired backend accepts no unsigned identity. Tools that switch identity by sending unsigned headers do not work against it; sign in through the proxy instead.
|
|
58
|
+
|
|
59
|
+
## Sign-in providers
|
|
60
|
+
|
|
61
|
+
| Method | Use for |
|
|
62
|
+
|---|---|
|
|
63
|
+
| `WithOidcProvider(name, type, authority, clientId, clientSecret, scopes?)` | A provider with OpenID Connect discovery. `type` is `OidcProviderType.Microsoft`, `Google` or `Custom`. |
|
|
64
|
+
| `WithOAuthProvider(name, type, authorizationEndpoint, tokenEndpoint, userInformationEndpoint, clientId, clientSecret, scopes?, claimMappings?, ...)` | A provider without discovery, such as GitHub (`OidcProviderType.GitHub`). |
|
|
65
|
+
|
|
66
|
+
Call once per provider. Several providers give the provider-selection page. Pass client secrets from secret parameters or user secrets, not string literals. See [sign-in-providers.md](sign-in-providers.md).
|
|
67
|
+
|
|
68
|
+
## Admission
|
|
69
|
+
|
|
70
|
+
| Method | Effect |
|
|
71
|
+
|---|---|
|
|
72
|
+
| `WithRequiredClaim(claim, anyOf...)` | A root requirement that applies to every service. |
|
|
73
|
+
| `WithRequiredClaimForService(serviceName, claim, anyOf...)` | An additional requirement for one service. |
|
|
74
|
+
| `WithIdentityVerification(serviceName, mode, timeout?)` | `IdentityVerificationMode.Required` (the default when not called) or `BestEffort`. |
|
|
75
|
+
| `WithBackend(serviceName, resource, resolveIdentityDetails: false)` | The service has no `/.cratis/me`. |
|
|
76
|
+
| `WithAnonymousPaths(serviceName, paths...)` | Paths served without a session. Calls accumulate. |
|
|
77
|
+
| `WithCapabilityOnlyAdmission(verifierUrl, ...)` | Hide the deployment until a capability is presented. |
|
|
78
|
+
|
|
79
|
+
```csharp
|
|
80
|
+
authproxy.WithRequiredClaim("urn:github:organization", "Acme");
|
|
81
|
+
```
|
|
82
|
+
|
|
83
|
+
See [admission.md](admission.md).
|
|
84
|
+
|
|
85
|
+
## Tenant resolution
|
|
86
|
+
|
|
87
|
+
Strategies run in the order they are added.
|
|
88
|
+
|
|
89
|
+
| Method | Strategy |
|
|
90
|
+
|---|---|
|
|
91
|
+
| `WithSpecifiedTenantResolution(tenantId)` | `Specified` |
|
|
92
|
+
| `WithHostTenantResolution()` | `Host` |
|
|
93
|
+
| `WithSubHostTenantResolution()` | `SubHost` |
|
|
94
|
+
| `WithClaimTenantResolution(claimType?)` | `Claim` |
|
|
95
|
+
| `WithRouteTenantResolution(pattern)` | `Route` |
|
|
96
|
+
| `WithSelectionTenantResolution(resource, route)` or `(tenantsEndpoint)` | `Selection` |
|
|
97
|
+
| `WithDefaultTenantResolution(tenantId)` | `Default` |
|
|
98
|
+
| `WithTenantVerification(resource, routeTemplate)` or `(urlTemplate)` | Tenant verification, with `{tenantId}` in the template. |
|
|
99
|
+
|
|
100
|
+
- Prefer the overloads that take a resource: the endpoint address is resolved by Aspire, and a selectable-tenants endpoint on a paired backend is signed automatically.
|
|
101
|
+
- `WithSubHostTenantResolution()` adds the strategy without its `ParentHost` option, and without that option the strategy resolves nothing. Supply it as an environment variable, where the index is the strategy's position in the order added:
|
|
102
|
+
|
|
103
|
+
```csharp
|
|
104
|
+
authproxy
|
|
105
|
+
.WithSubHostTenantResolution()
|
|
106
|
+
.WithEnvironment("Cratis__AuthProxy__TenantResolutions__0__Options__ParentHost", "example.com");
|
|
107
|
+
```
|
|
108
|
+
|
|
109
|
+
- The tenant registry (`Tenants`) that `Host`, `Claim` and `Route` read has no method. Supply it as configuration.
|
|
110
|
+
|
|
111
|
+
See [tenant-resolution.md](tenant-resolution.md).
|
|
112
|
+
|
|
113
|
+
## Services, hosts and paths
|
|
114
|
+
|
|
115
|
+
| Method | Effect |
|
|
116
|
+
|---|---|
|
|
117
|
+
| `WithHosts(serviceName, hosts...)` | Routes those hosts to the service. Calls append. |
|
|
118
|
+
| `WithPathPrefix(serviceName, pathPrefix, stripPathPrefix: false)` | Routes a path prefix to the service. |
|
|
119
|
+
| `WithSessionCookieDomain(domain)` | One sign-in for every host under the domain. |
|
|
120
|
+
| `WithSignInCallbackHost(host)` | Runs every sign-in handshake on one host. Requires the session cookie domain. |
|
|
121
|
+
| `WithActivityTimeout(timeout)`, `WithServiceActivityTimeout(serviceName, timeout)` | The idle limit for every service, or for one. The service value wins. |
|
|
122
|
+
|
|
123
|
+
See [services-and-routing.md](services-and-routing.md).
|
|
124
|
+
|
|
125
|
+
## Sessions and operations
|
|
126
|
+
|
|
127
|
+
| Method | Effect |
|
|
128
|
+
|---|---|
|
|
129
|
+
| `WithFreshAuthentication(serviceName, path, maxAge?, prefix: false, methods...)` | Requires a recent sign-in for a path. |
|
|
130
|
+
| `WithoutIdentityDetailsCookie()` | Stops writing the readable `.cratis-identity` cookie. |
|
|
131
|
+
| `WithSessionTerminationOnIdentityDenial()` | A refusal from `/.cratis/me` also ends the proxy session. |
|
|
132
|
+
| `WithTrustedProxies(addressesOrCidrs...)`, `WithForwardLimit(hops)` | Declares the ingress in front of the proxy. |
|
|
133
|
+
| `WithManagementListener(port, ...)` | Enables the health endpoints on a private port. |
|
|
134
|
+
| `WithRequiredTlsOnIdentityHops()` | Requires HTTPS on every hop that carries identity. |
|
|
135
|
+
|
|
136
|
+
See [sessions-and-logout.md](sessions-and-logout.md) and [operations.md](operations.md).
|
|
137
|
+
|
|
138
|
+
## Settings without a method
|
|
139
|
+
|
|
140
|
+
Any setting can be written directly with its environment-variable name, which is the configuration path with `__` between segments:
|
|
141
|
+
|
|
142
|
+
```csharp
|
|
143
|
+
authproxy.WithEnvironment("Cratis__AuthProxy__Session__Lifetime", "08:00:00");
|
|
144
|
+
```
|
|
145
|
+
|
|
146
|
+
Use this for the data protection store, `PagesPath`, `DeniedPaths`, `ForwardedPaths`, session lifetimes and anything else the tables above do not list.
|
|
147
|
+
|
|
148
|
+
## Anti-patterns
|
|
149
|
+
|
|
150
|
+
- `WithBackend` without `WithSignedForwardingTo` for an Arc backend. The backend then cannot tell the proxy from any other caller on its network.
|
|
151
|
+
- Publishing with a signing key that is not a secret parameter, or reusing one key for several backends.
|
|
152
|
+
- `WithSubHostTenantResolution()` with no `ParentHost`.
|
|
153
|
+
- Hand-writing environment variables for something a method already covers.
|
|
154
|
+
- A literal client secret in the AppHost source.
|
|
@@ -0,0 +1,122 @@
|
|
|
1
|
+
# Running AuthProxy in production
|
|
2
|
+
|
|
3
|
+
## Contents
|
|
4
|
+
|
|
5
|
+
- Production checklist
|
|
6
|
+
- Data protection key ring
|
|
7
|
+
- Behind an ingress or load balancer
|
|
8
|
+
- Health probes
|
|
9
|
+
- The hop to the backend
|
|
10
|
+
- Replace the built-in pages
|
|
11
|
+
- Telemetry
|
|
12
|
+
- Anti-patterns
|
|
13
|
+
|
|
14
|
+
## Production checklist
|
|
15
|
+
|
|
16
|
+
1. Run the `cratis/authproxy` image with a pinned version tag.
|
|
17
|
+
2. Supply every secret (client secrets, signing keys, connection strings) from a secret store. Every setting has an environment-variable form: `Cratis:AuthProxy:Session:Lifetime` is `Cratis__AuthProxy__Session__Lifetime`.
|
|
18
|
+
3. Persist and share the data protection key ring.
|
|
19
|
+
4. Declare the ingress in front of the proxy as a trusted proxy.
|
|
20
|
+
5. Enable the management listener and point liveness and readiness probes at it.
|
|
21
|
+
6. Make the backend reachable only from the proxy, and sign the identity the proxy forwards.
|
|
22
|
+
7. Leave `Cratis:AuthProxy:Profile` unset. `LocalDevelopment` is for a developer machine only.
|
|
23
|
+
|
|
24
|
+
## Data protection key ring
|
|
25
|
+
|
|
26
|
+
The proxy encrypts its session cookie, its sign-in cookies and every token it issues with a key ring. Without a persisted, shared key ring:
|
|
27
|
+
|
|
28
|
+
- every restart signs everyone out, and
|
|
29
|
+
- with more than one replica, a request that lands on another replica cannot read the session, so people are signed out at random.
|
|
30
|
+
|
|
31
|
+
| Store | Use when | Setting |
|
|
32
|
+
|---|---|---|
|
|
33
|
+
| File system (default) | One instance, or replicas sharing a persistent volume. | `DataProtectionKeysPath`: a directory on a persistent volume, mounted at the same path in every replica. |
|
|
34
|
+
| Azure Blob Storage | The proxy runs on Azure and no volume should be managed. | `DataProtection:Store` = `AzureBlob`, `DataProtection:AzureBlob:BlobUri` |
|
|
35
|
+
| Redis | Redis is already running, or the proxy runs outside Azure. | `DataProtection:Store` = `Redis`, `DataProtection:Redis:ConnectionString` |
|
|
36
|
+
|
|
37
|
+
- With no path and no store, the key ring is neither persisted nor shared. That is acceptable only on a developer machine.
|
|
38
|
+
- Azure Blob Storage authenticates with the managed or workload identity of the proxy; there is no secret to configure. The container must exist, and the identity needs read and write access to the blob.
|
|
39
|
+
|
|
40
|
+
## Behind an ingress or load balancer
|
|
41
|
+
|
|
42
|
+
The proxy learns the public scheme and the client address from `X-Forwarded-Proto` and `X-Forwarded-For`. It believes those headers only from peers declared in `Ingress:TrustedProxies`. With an empty list they are ignored from everyone.
|
|
43
|
+
|
|
44
|
+
```json
|
|
45
|
+
"Ingress": {
|
|
46
|
+
"TrustedProxies": [ "10.0.0.0/8" ],
|
|
47
|
+
"ForwardLimit": 1
|
|
48
|
+
}
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
- Each entry is an IP address or a CIDR range. Declare the addresses the proxy sees as its peer, not the addresses of users.
|
|
52
|
+
- `ForwardLimit` is the number of proxies a request passes through before it reaches the proxy. Set it when there is more than one.
|
|
53
|
+
- When TLS ends at the ingress and the ingress is not declared, the proxy sees plain HTTP: session cookies are written without `Secure`, the public origin used for sign-out is wrong, and bearer routes refuse every request.
|
|
54
|
+
- A sign-in callback sets several cookies in one response. Behind ingress-nginx, raise `proxy-buffer-size` to `16k`; the default of `4k` can answer `502` on the callback.
|
|
55
|
+
|
|
56
|
+
## Health probes
|
|
57
|
+
|
|
58
|
+
The public port serves no health endpoint: a probe at a protected application path without a session gets `401`. Enable the management listener:
|
|
59
|
+
|
|
60
|
+
```json
|
|
61
|
+
"Management": { "Port": 9110 }
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
| Path | Answers |
|
|
65
|
+
|---|---|
|
|
66
|
+
| `/health/live` | `200` while the proxy is serving requests. Use for liveness. |
|
|
67
|
+
| `/health/ready` | `200` when this instance can serve traffic, `503` when it cannot. Use for readiness. |
|
|
68
|
+
|
|
69
|
+
- `Port` is required; there is no default port.
|
|
70
|
+
- The listener binds `127.0.0.1` by default, which only a process in the same pod or container reaches. A Kubernetes `httpGet` probe connects to the pod's IP, not to loopback: use an `exec` probe that runs inside the container, or set `BindAddress` to an address the kubelet reaches and restrict who else can reach the port.
|
|
71
|
+
- Readiness checks the key ring. It calls no backend, so a backend outage does not take the proxy out of rotation.
|
|
72
|
+
- The health paths exist only on the management port. With the listener enabled they answer `404` on the public port.
|
|
73
|
+
|
|
74
|
+
## The hop to the backend
|
|
75
|
+
|
|
76
|
+
The backend trusts whatever arrives in the identity headers, so two things have to hold:
|
|
77
|
+
|
|
78
|
+
1. **Nothing reaches the backend around the proxy.** Restrict the backend's listener to the proxy at the network level.
|
|
79
|
+
2. **The backend can tell that the proxy wrote the headers.** Sign the forwarded identity: a `ForwardedIdentity` block on the service (`Audience`, `KeyId`, and `SecretBase64` from a secret store) and the matching verifier in the backend. See `cratis-arc-host-application` (identity reference) for the backend side and [aspire.md](aspire.md) for the one-call pairing.
|
|
80
|
+
|
|
81
|
+
Outside the `LocalDevelopment` profile a signed hop requires an HTTPS backend URL and a client certificate under `BackendTls`:
|
|
82
|
+
|
|
83
|
+
```json
|
|
84
|
+
"BackendTls": {
|
|
85
|
+
"ClientCertificate": {
|
|
86
|
+
"CertificatePath": "/run/authproxy/backend/client.crt",
|
|
87
|
+
"KeyPath": "/run/authproxy/backend/client.key"
|
|
88
|
+
},
|
|
89
|
+
"TrustedCertificateAuthoritiesPath": "/run/authproxy/backend/ca-bundle.crt"
|
|
90
|
+
}
|
|
91
|
+
```
|
|
92
|
+
|
|
93
|
+
- `TrustedCertificateAuthoritiesPath` is optional. When set, it replaces the system roots for backend hosts.
|
|
94
|
+
- `BackendTls:RequireTlsOnIdentityHops: true` requires HTTPS on every hop that carries identity, also without signing. It defaults to `false`.
|
|
95
|
+
- `Profile: LocalDevelopment` lets a signed hop use plain HTTP and no client certificate. It never belongs in a deployed environment.
|
|
96
|
+
|
|
97
|
+
## Replace the built-in pages
|
|
98
|
+
|
|
99
|
+
The proxy ships pages for provider selection, tenant selection and errors. To replace them, mount a directory into the container and set `Cratis:AuthProxy:PagesPath` to the mount path. A file with the name of a built-in page replaces it:
|
|
100
|
+
|
|
101
|
+
| File | Shown when |
|
|
102
|
+
|---|---|
|
|
103
|
+
| `select-provider.html` | A person must choose a sign-in provider. |
|
|
104
|
+
| `select-tenant.html` | A person must choose a tenant. |
|
|
105
|
+
| `not-authorized.html` | A signed-in person lacks a required claim. |
|
|
106
|
+
| `403.html` | The application's identity verdict refused the person. |
|
|
107
|
+
| `no-organization.html` | A signed-in person belongs to no tenant. |
|
|
108
|
+
| `tenant-not-found.html` | Tenant verification did not confirm the tenant. |
|
|
109
|
+
| `service-unavailable.html` | The tenants endpoint could not answer. |
|
|
110
|
+
|
|
111
|
+
## Telemetry
|
|
112
|
+
|
|
113
|
+
The proxy exports OpenTelemetry traces, metrics and logs over OTLP to the address in `OTEL_EXPORTER_OTLP_ENDPOINT`. A signal-specific variable such as `OTEL_EXPORTER_OTLP_TRACES_ENDPOINT` sets the address for that signal alone. Nothing is exported while none of them is set.
|
|
114
|
+
|
|
115
|
+
## Anti-patterns
|
|
116
|
+
|
|
117
|
+
- More than one replica, or a platform without persistent disks, and no shared key ring.
|
|
118
|
+
- A liveness or readiness probe on the public port.
|
|
119
|
+
- An ingress that terminates TLS and is not declared in `TrustedProxies`.
|
|
120
|
+
- The `latest` image tag in a deployed environment.
|
|
121
|
+
- `Profile: LocalDevelopment` outside a developer machine.
|
|
122
|
+
- A backend that is reachable from the network without going through the proxy.
|
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
# Services and routing
|
|
2
|
+
|
|
3
|
+
## Contents
|
|
4
|
+
|
|
5
|
+
- One service
|
|
6
|
+
- Several services behind one sign-in
|
|
7
|
+
- Limit which paths are forwarded
|
|
8
|
+
- What the backend receives
|
|
9
|
+
- The caller's Authorization header
|
|
10
|
+
- Machine callers
|
|
11
|
+
- Live connections, replicas and gRPC
|
|
12
|
+
- Anti-patterns
|
|
13
|
+
|
|
14
|
+
## One service
|
|
15
|
+
|
|
16
|
+
A service is an entry under `Cratis:AuthProxy:Services` with a `Backend`, a `Frontend`, or both.
|
|
17
|
+
|
|
18
|
+
```json
|
|
19
|
+
"Services": {
|
|
20
|
+
"main": {
|
|
21
|
+
"Backend": { "BaseUrl": "http://backend:8080/" },
|
|
22
|
+
"Frontend": { "BaseUrl": "http://frontend:3000/" }
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
| Request | Goes to |
|
|
28
|
+
|---|---|
|
|
29
|
+
| `/api/...` | The backend |
|
|
30
|
+
| Everything else | The frontend |
|
|
31
|
+
|
|
32
|
+
- A single service that declares neither `Hosts` nor `PathPrefix` receives every request. No routing header is needed.
|
|
33
|
+
- A service with only a `Backend` receives every path on that route, so a backend that also serves the frontend's static files is declared with `Backend` alone.
|
|
34
|
+
- The proxy's own endpoints (`/.cratis/login`, `/.cratis/logout`, `/.cratis/select-tenant` and the others it answers itself) are never forwarded.
|
|
35
|
+
|
|
36
|
+
## Several services behind one sign-in
|
|
37
|
+
|
|
38
|
+
With more than one service, each request has to name its service. Pick one way per service:
|
|
39
|
+
|
|
40
|
+
| Way | Declare | Use when |
|
|
41
|
+
|---|---|---|
|
|
42
|
+
| Host | `"Hosts": [ "portal.example.com" ]` | Each application has its own host. The default for separate applications. |
|
|
43
|
+
| Path prefix | `"PathPrefix": "/reporting"` | Several applications share a host. |
|
|
44
|
+
| Header or query parameter | Nothing in the proxy; the client sends `x-cratis-microservice: <service>` | Several Arc backends serve one frontend. |
|
|
45
|
+
|
|
46
|
+
- **Path prefix.** By default the service receives the path as requested and serves itself under the prefix. With `"StripPathPrefix": true` the prefix is removed and sent in `X-Forwarded-Prefix`. A `PathPrefix` cannot be `/api` or below it.
|
|
47
|
+
- **Header.** An Arc frontend sends `x-cratis-microservice` on HTTP requests, and as a query parameter on WebSocket and server-sent-event connections, when its `microservice` is set. See `cratis-arc-react-bind-slice` for the frontend setting. A service that has only a `Backend` and is selected this way receives `/api/...` only.
|
|
48
|
+
- A browser cannot put a header on a page navigation. A service whose pages a person opens directly needs a host or a path prefix.
|
|
49
|
+
- A sign-in on one host is not valid on another unless `Session:CookieDomain` is set. See [sessions-and-logout.md](sessions-and-logout.md).
|
|
50
|
+
|
|
51
|
+
## Limit which paths are forwarded
|
|
52
|
+
|
|
53
|
+
Both lists belong to a service. Each entry is `{ "Path": "...", "Match": "Prefix" | "Exact", "Methods": [ ... ] }`; `Match` defaults to `Prefix` and an empty `Methods` matches every method.
|
|
54
|
+
|
|
55
|
+
| Setting | Effect | Use when |
|
|
56
|
+
|---|---|---|
|
|
57
|
+
| `DeniedPaths` | A matching path is never forwarded, also for a signed-in caller. It answers `404`. | The application has internal endpoints that must not be reachable from outside: diagnostics, an OpenAPI document. |
|
|
58
|
+
| `ForwardedPaths` | When the list has entries, only matching paths are forwarded. | Only a small surface of the service is exposed. |
|
|
59
|
+
|
|
60
|
+
- A matching deny rule always wins.
|
|
61
|
+
- Paths here are relative to the service, after `StripPathPrefix` has removed the prefix. `AnonymousPaths` entries are the public path, before stripping.
|
|
62
|
+
- `/` is valid only with `"Match": "Exact"`.
|
|
63
|
+
- `AnonymousPaths` opens paths to callers without a session. That decision, and bearer routes, are covered in `cratis-arc-authorize-request` (`references/authproxy.md`).
|
|
64
|
+
|
|
65
|
+
## What the backend receives
|
|
66
|
+
|
|
67
|
+
| Header | Content |
|
|
68
|
+
|---|---|
|
|
69
|
+
| `x-ms-client-principal`, `x-ms-client-principal-id`, `x-ms-client-principal-name` | The authenticated caller. Arc reads these once it trusts forwarded identity. |
|
|
70
|
+
| `x-cratis-tenant-id` | The tenant the proxy resolved. |
|
|
71
|
+
| `x-cratis-microservice` | The service that routing selected as the destination. Not the value the caller sent. |
|
|
72
|
+
|
|
73
|
+
- The proxy removes every copy of these headers that the caller sent.
|
|
74
|
+
- `Tenant-ID` and `Service-ID` carry the same values and are deprecated. Read the `x-cratis-` names.
|
|
75
|
+
- On a bearer route the backend also receives `x-cratis-token-scope` (the granted scopes, space-separated) and `x-cratis-token-client-id` (the client the token was issued to). The client id is what the client asserts; a public client cannot prove which program uses it.
|
|
76
|
+
- On an anonymous path the proxy forwards no identity at all, also for a signed-in caller.
|
|
77
|
+
|
|
78
|
+
## The caller's Authorization header
|
|
79
|
+
|
|
80
|
+
A request authenticated by the proxy session has the `Authorization` header the caller sent removed. A request with both a bearer token and the session cookie is refused: `401` on an ordinary protected path, `400` on a bearer route. A client sends one or the other.
|
|
81
|
+
|
|
82
|
+
| The backend needs | Set on the service |
|
|
83
|
+
|---|---|
|
|
84
|
+
| Only to know who the caller is | Nothing. The identity headers are enough. The default. |
|
|
85
|
+
| To call a downstream API as the signed-in person (Microsoft Graph, another API through the on-behalf-of flow) | `"AccessToken": { "Scopes": [ "api://reporting/access_as_user" ] }` |
|
|
86
|
+
| A non-bearer `Authorization` header the caller sent, unchanged | `"CallerAuthorizationHeader": "Forward"`. It never lets a bearer token through beside the session cookie. |
|
|
87
|
+
|
|
88
|
+
With `AccessToken` the proxy obtains a token for the backend's audience and forwards it as `Authorization: Bearer <token>`. It requires `Scopes` or `Resource`, a `Backend` on the service, and an OIDC provider that issues refresh tokens (request `offline_access`).
|
|
89
|
+
|
|
90
|
+
## Machine callers
|
|
91
|
+
|
|
92
|
+
| Situation | Use |
|
|
93
|
+
|---|---|
|
|
94
|
+
| An authorization server already issues tokens for the callers | A bearer route on the service. The default. See `cratis-arc-authorize-request` (`references/authproxy.md`). |
|
|
95
|
+
| The application owns its client ids and secrets and there is no authorization server | `ClientCredentials` on the service. |
|
|
96
|
+
|
|
97
|
+
With `ClientCredentials` the proxy exposes `POST /.cratis/token` (`grant_type=client_credentials`, `client_id`, `client_secret`, and `service` when more than one service has client credentials). It sends the credentials to the service's `VerificationPath`; a `2xx` answer issues a bearer token valid on the service's `RoutePrefix` (default `/api`), together with a refresh token. The application stores and verifies the secrets; the proxy only issues and validates the tokens.
|
|
98
|
+
|
|
99
|
+
## Live connections, replicas and gRPC
|
|
100
|
+
|
|
101
|
+
- **Idle limit.** `ActivityTimeout` is how long a request, WebSocket or server-sent-event stream may stay silent before the proxy cuts it. The default is five minutes. Set it at the root (`Cratis:AuthProxy:ActivityTimeout`), on a service, or on its `Backend` or `Frontend`; the most specific value wins.
|
|
102
|
+
- **Observable queries.** A live query that stays quiet longer than the limit is cut and the client reconnects. Raise the limit on that service when the reconnects are a problem, and raise the idle limit of whatever sits in front of the proxy as well: the shortest limit on the path wins.
|
|
103
|
+
- **A stream is authorized when it opens.** A person whose access is removed keeps an open stream until it closes.
|
|
104
|
+
- **Sticky routing.** `StickyRouting` on a `Backend` pins each browser to one replica. Use it only when the backend keeps per-replica caches. It is a cache hint, not a security boundary.
|
|
105
|
+
- **gRPC.** A gRPC backend needs `"Protocol": "Http2"` on its `Backend`. Behind an ingress that terminates TLS the proxy also needs its `GrpcListener`.
|
|
106
|
+
|
|
107
|
+
## Anti-patterns
|
|
108
|
+
|
|
109
|
+
- Routing page navigations by `x-cratis-microservice`. A navigation carries no custom header; use `Hosts` or `PathPrefix`.
|
|
110
|
+
- Reading `Tenant-ID` or `Service-ID` in new backend code.
|
|
111
|
+
- Forwarding a token from the browser so the backend can call a downstream API. Use `AccessToken`.
|
|
112
|
+
- Hiding an internal endpoint by leaving it out of the frontend. Declare it in `DeniedPaths`.
|
|
113
|
+
- Sending a bearer token and the session cookie on the same request.
|
|
114
|
+
- Treating `x-cratis-token-client-id` as proof of which program is calling.
|
|
@@ -0,0 +1,126 @@
|
|
|
1
|
+
# Sessions and sign-out
|
|
2
|
+
|
|
3
|
+
## Contents
|
|
4
|
+
|
|
5
|
+
- What a caller without a session gets
|
|
6
|
+
- Session lifetime
|
|
7
|
+
- The identity cookie
|
|
8
|
+
- Sign out
|
|
9
|
+
- Require a recent sign-in for sensitive paths
|
|
10
|
+
- Tell the backend when someone signs in
|
|
11
|
+
- Anti-patterns
|
|
12
|
+
|
|
13
|
+
## What a caller without a session gets
|
|
14
|
+
|
|
15
|
+
The proxy serves a sign-in or selection page only to a browser that is navigating. Every other caller gets a status code. A refusal of a signed-in caller carries its status for every caller, with the refusal page as the body.
|
|
16
|
+
|
|
17
|
+
| Situation | Browser navigation | Any other caller (`fetch`, webhook, API client) |
|
|
18
|
+
|---|---|---|
|
|
19
|
+
| Not signed in, one provider | Redirect to the provider | `401` |
|
|
20
|
+
| Not signed in, several providers | The provider-selection page | `401` |
|
|
21
|
+
| Signed in, must choose a tenant | The tenant-selection page | `403` |
|
|
22
|
+
| Signed in, belongs to no tenant | The no-organization page with `403` | The same `403` response, page included |
|
|
23
|
+
| Signed in, lacks a required claim | The not-authorized page with `403` | The same `403` response, page included |
|
|
24
|
+
| Signed in, a `Required` service could not be asked | The service-unavailable page with `503` and `Retry-After` | The same `503` response, page included |
|
|
25
|
+
|
|
26
|
+
- A `503` is an outage, not a refusal: the session is kept and the person is let back in when the service answers again. Do not treat it as signed out.
|
|
27
|
+
- A client must read the status, not the body: a `403` or `503` can carry HTML.
|
|
28
|
+
- The frontend never receives a login page as the response to a command or query. A `401` there means the session has ended: navigate or reload the page so the browser starts sign-in. See `cratis-arc-react-bind-slice` (identity reference) for the React side.
|
|
29
|
+
- An endpoint that must answer callers without a session, such as a webhook receiver, is declared in the service's `AnonymousPaths`. See [services-and-routing.md](services-and-routing.md).
|
|
30
|
+
- An HTTP probe is not a navigation: on a protected application path it gets `401`, not a redirect. Probe the management listener instead: see [operations.md](operations.md).
|
|
31
|
+
|
|
32
|
+
## Session lifetime
|
|
33
|
+
|
|
34
|
+
Settings under `Cratis:AuthProxy:Session`:
|
|
35
|
+
|
|
36
|
+
| Setting | Default | Meaning |
|
|
37
|
+
|---|---|---|
|
|
38
|
+
| `Lifetime` | `12:00:00` | Absolute lifetime. When it elapses the person signs in again at the provider. |
|
|
39
|
+
| `SlidingExpiration` | `false` | Whether activity extends the lifetime. Off, so `Lifetime` is a hard bound. |
|
|
40
|
+
| `IdentityRevalidationInterval` | `00:10:00` | How long a positive `/.cratis/me` verdict stored with the session is honored before the proxy asks the services again. |
|
|
41
|
+
| `IdentityResultCacheDuration` | `00:00:30` | How long the proxy reuses a `/.cratis/me` answer in memory, per person and tenant. Zero turns off this in-memory reuse only; the verdict stored with the session is still honored for `IdentityRevalidationInterval`. |
|
|
42
|
+
| `TenantRevalidationInterval` | `00:10:00` | How long a selected tenant is trusted before it is confirmed against the tenants endpoint again. |
|
|
43
|
+
| `CookieDomain` | host-only | A parent domain such as `.example.com`, so one sign-in holds on every host under it. Cannot be combined with `SubHost` tenant resolution. |
|
|
44
|
+
|
|
45
|
+
- Removing a person's access in the application does not take effect on the next request. Both `IdentityRevalidationInterval` and `IdentityResultCacheDuration` let a positive verdict be reused, and neither is an exact deadline. Lower both when the delay is too long; each lapse costs one `/.cratis/me` call per service. To have a `Required` service asked on every request, set both to zero.
|
|
46
|
+
- The session cookie is `HttpOnly` and has no persistent expiry: the browser drops it when the browser session ends.
|
|
47
|
+
- A provider entry can carry its own `Session` block with `Lifetime` and `SlidingExpiration`. It can only shorten the global policy. Use it for a provider that proves less, such as an e-mail code.
|
|
48
|
+
|
|
49
|
+
## The identity cookie
|
|
50
|
+
|
|
51
|
+
By default the proxy writes a readable `.cratis-identity` cookie with the details from `/.cratis/me`.
|
|
52
|
+
|
|
53
|
+
- It is display data, never a credential. The backend ignores it and the Arc frontend reads identity from `/.cratis/me`.
|
|
54
|
+
- Set `Session:EmitIdentityDetailsCookie` to `false` once every frontend reads identity from `/.cratis/me`. The proxy then stops writing it and expires copies that browsers still send.
|
|
55
|
+
- The roles of a session come from the sign-in provider's claims. A `roles` field in a service's `/.cratis/me` answer is not added to the session.
|
|
56
|
+
|
|
57
|
+
## Sign out
|
|
58
|
+
|
|
59
|
+
Sign-out is a full-page navigation, not a `fetch`:
|
|
60
|
+
|
|
61
|
+
```html
|
|
62
|
+
<a href="/.cratis/logout?redirect=https://www.example.com">Sign out</a>
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
| Session established through | What sign-out ends |
|
|
66
|
+
|---|---|
|
|
67
|
+
| An OIDC provider that advertises an end-session endpoint | The proxy session and the provider's session. The browser goes through the provider's end-session endpoint and back to `/.cratis/logout/callback`. |
|
|
68
|
+
| An OIDC provider without an end-session endpoint, or a session that holds no ID token | The proxy session only. |
|
|
69
|
+
| An OAuth provider such as GitHub | The proxy session only. The person stays signed in at the provider, so the next sign-in may complete without asking for credentials. |
|
|
70
|
+
|
|
71
|
+
- Register `https://<proxy-host>/.cratis/logout/callback` as a post-logout redirect URI at every OIDC provider that supports sign-out through an end-session endpoint.
|
|
72
|
+
- `redirect` is an absolute URL or a same-site relative path. An absolute target is accepted when its origin is the proxy's own public origin, a configured service frontend, or listed in `Logout:AllowedRedirectOrigins`. Each entry there is an origin with no path, such as `https://www.example.com`.
|
|
73
|
+
- A missing or refused `redirect` falls back to `/`.
|
|
74
|
+
- The endpoint is anonymous. It works when the session is already invalid.
|
|
75
|
+
- Sign-out deletes the proxy's own cookies. A cookie the application or an earlier ingress set survives unless it is listed under `Logout:AdditionalCookies` with its exact `Name` and, for a cookie scoped to a parent domain, its `Domain`.
|
|
76
|
+
|
|
77
|
+
## Require a recent sign-in for sensitive paths
|
|
78
|
+
|
|
79
|
+
A valid session does not prove the person signed in recently. Declare how old the sign-in may be per path on a service:
|
|
80
|
+
|
|
81
|
+
```json
|
|
82
|
+
"Services": {
|
|
83
|
+
"main": {
|
|
84
|
+
"FreshAuthentication": [
|
|
85
|
+
{ "Path": "/admin", "Prefix": true, "MaxAge": "00:15:00" }
|
|
86
|
+
]
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
```
|
|
90
|
+
|
|
91
|
+
| Caller whose sign-in is older than `MaxAge` | Response |
|
|
92
|
+
|---|---|
|
|
93
|
+
| A browser navigation | Redirect to sign in again with the same provider, then back to the page. |
|
|
94
|
+
| Any other request | `401` with a `WWW-Authenticate` challenge carrying `insufficient_user_authentication`. The request is not replayed; the client decides whether to retry after the person has signed in again. |
|
|
95
|
+
|
|
96
|
+
- `Path` is matched against the path the backend receives. With `StripPathPrefix` on a service routed by `/reporting`, write `/admin`; with the prefix kept, write `/reporting/admin`. A rule written the other way never matches and the path goes unprotected.
|
|
97
|
+
- `Prefix: true` also covers every path below it.
|
|
98
|
+
- A rule that lists `Methods` also requires `FreshAuthenticationMethodOverrideUnsupported: true` on the service, or the proxy refuses to start. Set it only when the backend honors no HTTP method override. Otherwise leave `Methods` out so the rule covers every method.
|
|
99
|
+
- It works for sessions from an OIDC provider or an e-mail code (`Type: Code`). A session from an OAuth provider such as GitHub cannot prove when the person signed in, so a path with a rule answers `403` for it. Do not put a rule on a service whose users sign in through an OAuth provider.
|
|
100
|
+
- Use it instead of shortening the whole session.
|
|
101
|
+
|
|
102
|
+
## Tell the backend when someone signs in
|
|
103
|
+
|
|
104
|
+
`Services:<name>:SignInCallback` has the proxy call the service's backend, in the background, without delaying the browser:
|
|
105
|
+
|
|
106
|
+
```json
|
|
107
|
+
"SignInCallback": { "Path": "/internal/sign-in", "Interval": "12:00:00" }
|
|
108
|
+
```
|
|
109
|
+
|
|
110
|
+
| Kind | When |
|
|
111
|
+
|---|---|
|
|
112
|
+
| `SignedIn` | A sign-in at a provider completes. |
|
|
113
|
+
| `Returned` | An existing browser session makes a request to the service and no callback was sent for that person and service within `Interval`. A `SignedIn` starts the interval, so the request that follows a sign-in is not a `Returned`. |
|
|
114
|
+
|
|
115
|
+
- Delivery is best-effort: a callback can be dropped, and each proxy instance tracks `Interval` on its own, so several instances can each send one. Make the receiver tolerate both a missing and a repeated callback.
|
|
116
|
+
- `Path` is a path on the service's `Backend`. A service without a backend cannot receive the callback.
|
|
117
|
+
- Set `Secret` from a secret store so the service can tell the proxy from any other caller on its network.
|
|
118
|
+
- Use it to record activity or start per-person work. It is a notification, not a gate: admission stays with [required claims and `/.cratis/me`](admission.md).
|
|
119
|
+
|
|
120
|
+
## Anti-patterns
|
|
121
|
+
|
|
122
|
+
- Calling `/.cratis/logout` with `fetch`. The redirects to the provider need a navigation.
|
|
123
|
+
- Following a `401` from a command or query as if it were a redirect, or expecting a login page in the response.
|
|
124
|
+
- Reading `.cratis-identity` to make an authorization decision.
|
|
125
|
+
- A very short `Session:Lifetime` to protect one sensitive operation. Use `FreshAuthentication` on that path.
|
|
126
|
+
- Expecting a removed person to be locked out on the next request while `IdentityRevalidationInterval` or `IdentityResultCacheDuration` still lets the earlier verdict be reused.
|