Skip to content

AIFACTORY-FEAT-162: Authorization server template: the Factory token contract, workload identity and delegation

Generated from the architecture model

This page is rendered from model/**/*.yaml by tools/docs_model during mkdocs build. Edit the YAML, not this page; hand-written design lives on the linked service, platform and plane pages.

A design artefact, not a tracker

This backlog is generated from model/backlog/ and validated against the architecture model. No work item exists in any tracker, and no item carries a date, an estimate or an assignee (ADR-0029).

Epic Ecosystem component extensions · Increment I0 Readiness · State elaborated · Route backend-developer · Phase before development · Build order 14 of 185 (Templates and libraries)

Before development

Template or library work: every task of this feature changes a template or a shared library the Factory builds on, and it lands before the Factory's own repositories of I0 are developed. The mark travels with every task (tag phase:before-development).

The Authorization Server is the sole token issuer of the Factory (canonical ADR-0101, ADR-0008). Its template issues standard OpenID Connect tokens with tenant claims, but not yet what the Factory needs on every call: role claims scoped to a project, audiences for the Factory gateways, registered Factory scopes, client-credential identities for services and agents (workload identity, D44) and the RFC 8693 actor claim that lets an agent act for a person with the delegated scope (ADR-0023). The template's findings page records the delegation gap with two leads, a seeded service client that shares the development secret, a missing Scripts sync guard and the stronger test-completeness check the Identity template already has. Component: Authorization Server (extend).

Delivers —
Stubs —
Realizes components: cmp-auth-server
adrs: ADR-0008, ADR-0015, ADR-0023
bounded contexts: BC-32
Requirements —
Depends on AIFACTORY-FEAT-161 Identity template: the Factory role model with per-project assignments and delegation records
Sources model/components.yaml, docs/architecture/adr/0015-factory-tenancy-under-canonical-adr-0100.md, ConnectSoft.AuthorizationServerTemplate/Docs/Consumer-Reported-Findings.md

AIFACTORY-US-244: Authorization server template: an access token for a Factory client carries the tenant, project-scoped role claims, valid delegations, registered Factory scopes and the audience of one gateway

enabling · persona asset-maintainer As an asset maintainer, I want the authorization server to issue the claims, scopes and audiences every Factory call is validated against, so that a gateway and a service can decide a call from the token alone and a token for one gateway is useless at another.

The authorization server is the sole token issuer of the Factory (ADR-0008) and ADR-0015 decision 6 has it issue the seven Factory roles as claims that every backend enforces. The template issues standard OpenID Connect tokens with the tenant claim today. What a Factory call needs beyond that is not issued yet, and this PBI adds it. On issuance the server reads the role assignments and the valid delegations of the subject from the identity service through the contracts of the identity template feature, with its HTTP client pinned to the published ServiceModel version, and writes one role claim per assignment with its project or tenant scope and one per valid delegation with the identifier of the delegation. The claim type names, the role names and the formatter of the scoped role value come from the pinned ConnectSoft.Extensions.AI.Factory.Abstractions package (AIFACTORY-TASK-1173 of AIFACTORY-US-220 in feature component-extensions-ai), which the identity, base and gateway templates pin as well; the template holds none of them as constants of its own. The audience is not a request parameter. The claims contract page of the template (Docs/Claims-and-Token-Contract.md of the template) states that OpenIddict derives aud from the resources attached to the principal and that those resources come from the API resources registered against the granted scopes. Factory scopes are therefore registered from a registration file that lists the scopes the service files of the model name under their operations (for example model/services/control-plane/ProjectService.yaml) and maps each to the resource of the gateway of model/gateways.yaml that fronts its service. The template holds no Factory name in code. The amendment of ADR-0015 (D114) decides the audience: a user token has one audience, the resource of the gateway that fronts its granted scopes, so a client that calls two gateways requests two tokens. A request that combines scopes of two gateways is refused by the authorization server with the standard scope error and no token, as is a request for a scope that is not registered or that the client is not allowed. When the identity service cannot be reached, issuance fails instead of producing a token without roles. The same page warns that access encoded as a claim cannot be revoked before the token expires. The lifetime of an access token that carries a delegated role therefore never exceeds the remaining validity of the delegation, and a revocation takes effect at the next issuance, a refresh included; the page documents that bound. It documents every claim with its type, value shape and source, and issuance stays recorded by the audit path the template already has, with its bounded write.

Acceptance criteria

AC1 Given a member with role assignments in two projects and one valid delegation, when a Factory client obtains an access token for the member, then the token carries the tenant claim, one role claim per assignment with its scope, one delegated role claim with the identifier of the delegation and the granted Factory scopes, all under the claim type names of the pinned Factory abstractions package, and the HTTP client that read them pins the published ServiceModel version and builds with no downgrade warning (ADR-0015 decisions 5 and 6, ADR-0008).
AC2 Given the registration file that maps each Factory scope to the resource of the gateway that fronts its service, when a user token is issued, then it has one audience, the resource of the gateway that fronts its granted scopes, and a resource server that validates another audience rejects it; a request that combines scopes of two gateways, a request for a scope that is not registered and a request for a scope the client is not allowed are each refused with the standard error and no token is issued (ADR-0008, ADR-0015 amendment on the one audience of a user token, FR-01, model/gateways.yaml).
AC3 Given the identity service cannot be reached during issuance, when a token is requested, then the request fails with a server error and no token without role claims is issued; given an expired delegation, when a token is issued, then it holds no claim for it (ADR-0015 decision 6).
AC4 Given a valid delegation whose remaining validity is shorter than the configured access token lifetime, when a token that carries the delegated role is issued, then the lifetime of the token does not exceed the remaining validity of the delegation; given the delegation is revoked, when the next token is issued or refreshed, then it holds no claim for it; the claims contract page documents the bound (ADR-0015 decision 6, docs/templates-docs/authorization-server-template.md).
AC5 Given the claims contract page of the template, when it is compared with an issued Factory token by the contract test, then every claim of the token is documented with type, value shape and source and the page names no claim the token lacks (ADR-0008, docs/templates-docs/authorization-server-template.md).
Traces: adrs ADR-0008, ADR-0015
Traces: requirements FR-01
Depends on feature:component-identity-template-factory-roles, feature:component-extensions-ai
Sources model/components.yaml, docs/architecture/adr/0015-factory-tenancy-under-canonical-adr-0100.md, docs/architecture/adr/0008-openiddict-identity.md, model/gateways.yaml, model/services/control-plane/ProjectService.yaml, docs/templates-docs/authorization-server-template.md

Tasks

Task Kind Expected output Repository
AIFACTORY-TASK-1128 Pins of the Factory token contract and of the published ServiceModel, and the scope registration file contract The template pins ConnectSoft.Extensions.AI.Factory.Abstractions for the claim type names, the role names and the formatter of the scoped role value and holds none of them as constants; its identity client pins the published ServiceModel version with no downgrade warning; the schema of a registration file lists each Factory scope with the one resource of the gateway that fronts its service, and a scope mapped to two gateways fails the seed with the scope named; the seed reads the file, registers the resources against the scopes, and the template names no Factory scope or gateway in code. ConnectSoft.AuthorizationServerTemplate
AIFACTORY-TASK-597 Factory claims, scopes and audiences in the issued tokens implementation An access token for a Factory client carries the tenant, the project-scoped role claims and the valid delegations read from Identity, the registered Factory scopes and one audience, the resource of the gateway that fronts those scopes; a request that combines scopes of two gateways is refused and a token for one audience is rejected by another; a token that carries a delegated role does not outlive the delegation and a revocation takes effect at the next issuance; the claims contract page of the template documents every claim. ConnectSoft.AuthorizationServerTemplate
AIFACTORY-TASK-1129 Claims contract page checked against an issued token documentation Docs/Claims-and-Token-Contract.md of the template lists every Factory claim with type, value shape and source, states that a user token has one audience, the resource of the gateway that fronts its granted scopes, that a request for scopes of two gateways is refused and that a token with a delegated role is bounded by the remaining validity of the delegation, and a contract test of the acceptance suite fails when an issued Factory token and the page differ. ConnectSoft.AuthorizationServerTemplate
AIFACTORY-TASK-1130 Verify the Factory token contract on issued tokens verification Run the acceptance scenarios for a member with two assignments and a delegation, for a resource server that validates another audience, for a request that combines scopes of two gateways, for an unregistered scope, for a delegation that ends before the token lifetime, for a revoked delegation at the next issuance and for an unreachable identity service; the tokens and refusals are as stated, which proves AC1 to AC5 of AIFACTORY-US-244 (ADR-0015, ADR-0008). ConnectSoft.AuthorizationServerTemplate

AIFACTORY-US-245: Authorization server template: every Factory service and agent host has its own client-credentials client with only its svc. scopes, and no seeded development secret works outside Development

enabling · persona asset-maintainer As an asset maintainer, I want the authorization server to hold one workload identity per Factory service and per agent host, so that a service authenticates as itself with a credential that no other workload shares.

ADR-0023 decision 4 makes workload identity the authentication of callers: they present tokens issued by the authorization server. Item 8 of the findings page of the template (Docs/Consumer-Reported-Findings.md of the template) records the state today: the migration seeds one service client with the same secret hash as the demo client, the secret of the service token is intentionally empty in the settings, and both must be replaced at deploy time, which the page asks to make an explicit deployment checklist item because a service credential is shared across a deployment. This PBI turns the single seeded client into one client-credentials client per Factory service and per agent host. The clients are seeded from a workload registration file that names each client with its service scopes, so the template holds no Factory service name in code. The claims contract page of the template (Docs/Claims-and-Token-Contract.md of the template) sets the rule for such scopes: a scope prefixed svc. addresses the internal API of another service and is deliberately registered without API resources, because an audience would make a machine-to-machine token indistinguishable from a user API token, and the seeding logic relies on the prefix to withhold resources. Every Factory service scope of the workload registration file is therefore svc. prefixed and registered without a resource, and a workload token carries no audience of a user API. It carries no role claim and no tenant claim either: a workload serves every tenant and takes the tenant of a call from the scope it forwards, and a service reads the tenant and project a workload forwards only when the token holds the svc. scope that names that service (ADR-0015 amendment of D114). Each client has its own secret or certificate, no two seeded clients share a secret, and a client is granted only the scopes the file gives it. Outside the Development environment a token request of a client that still holds a seeded development secret is refused as an invalid client, and a startup check names every such client without printing a secret. A request for a scope the client does not hold is refused with the standard error. The deployment checklist of the template names each credential the operator replaces and how the replacement is verified.

Acceptance criteria

AC1 Given a workload registration file with two services and one agent host, when the server is seeded, then three client-credentials clients exist, each with its own secret or certificate and only the svc. scopes the file gives it, each scope is registered without a resource, no two seeded clients share a secret, and a file entry whose scope lacks the svc. prefix fails the seed with the entry named (ADR-0023 decision 4, ADR-0008).
AC2 Given a seeded client, when it requests a token with its own scope, then the token carries the client as subject, client_id, its svc. scopes, no role claim, no tenant claim and no audience of a user API; when it requests a scope the file does not give it, then the request is refused with the standard error (ADR-0023 decision 4, ADR-0015 decision 6 and its amendment on workload tokens).
AC3 Given an environment other than Development, when a client that still holds a seeded development secret requests a token, then the request is refused as an invalid client, the startup check names the client without its secret, and the same request succeeds in Development (ADR-0008, FR-01).
AC4 Given the deployment checklist of the template, when an operator follows it, then it names each seeded credential, the setting or secret store entry that replaces it and the check that proves the replacement, which closes item 8 of the findings page (ADR-0023, docs/architecture/adr/0023-a2a-interoperability.md).
Traces: adrs ADR-0008, ADR-0015, ADR-0023
Traces: requirements FR-01
Depends on AIFACTORY-US-244
Sources model/components.yaml, docs/architecture/adr/0023-a2a-interoperability.md, docs/architecture/adr/0008-openiddict-identity.md, docs/architecture/adr/0015-factory-tenancy-under-canonical-adr-0100.md, docs/templates-docs/authorization-server-template.md

Tasks

Task Kind Expected output Repository
AIFACTORY-TASK-1131 Workload registration file and its seed contract The template holds the schema of a workload registration file with client identifier, credential kind and svc. scopes, and the migration seeds one client-credentials client per entry with a distinct secret hash and registers each scope without a resource; a file with a duplicate client, a scope without the svc. prefix or a scope that is not registered fails the seed with the entry named. ConnectSoft.AuthorizationServerTemplate
AIFACTORY-TASK-598 Workload identity for services and agents implementation A client-credentials client exists per Factory service and per agent host with its own secret or certificate and only its svc. service scopes, and its token carries no audience of a user API; the seeded development secret is refused outside the Development environment and no two seeded clients share a secret; the deployment checklist names the credential the operator replaces. ConnectSoft.AuthorizationServerTemplate
AIFACTORY-TASK-1132 Deployment checklist of the credentials an operator replaces documentation A deployment checklist page of the template lists every seeded client and the service token secret with the setting or secret store entry that replaces each and the check that proves it; item 8 of Docs/Consumer-Reported-Findings.md of the template is marked resolved. ConnectSoft.AuthorizationServerTemplate
AIFACTORY-TASK-1133 Verify workload clients and the refusal of the development secret verification Run the acceptance scenarios for a workload token without an audience of a user API, a scope outside the registration and a seeded secret in a non-Development environment; the token and the two refusals are as stated, which proves AC1 to AC4 of AIFACTORY-US-245 (ADR-0023). ConnectSoft.AuthorizationServerTemplate

AIFACTORY-US-246: Authorization server template: a token exchange with an actor token issues a token whose act claim names the actor and whose scope is no wider than the delegated one

enabling · persona asset-maintainer As an asset maintainer, I want the token exchange of the authorization server to perform the delegation it advertises, so that an agent can act for a person with the scope the person delegated and every backend can see who acted for whom.

ADR-0023 decision 4 lets the delegated user scope travel with a task and be narrowed per step, and the feature names the actor claim of RFC 8693 as the means. Item 1 of the findings page of the template (Docs/Consumer-Reported-Findings.md of the template) records that the grant advertises delegation it does not perform: the token-exchange endpoint accepts an actor token and validates it, but the issued access token carries no act claim. The acceptance scenario for it holds a real assertion and is quarantined rather than weakened. Two routes were tried and failed silently, and the page leaves two leads: the actor token types option of the server has never been configured, so the actor principal may not be populated at all, and a handler order declared only on the handler type is ignored unless it is set in the registration. It also asks whether the scope, audience and resource calls of the same controller branch have any effect. This PBI implements the exchange. A workload client of an agent host that is permitted to exchange presents the token of the person as subject token and its own token as actor token; the issued token keeps the person as subject, names the actor in act, and carries a scope that is contained in the scope of the subject token and in what the actor may request, with the one audience of the gateway that fronts that scope. A wider scope is refused, never silently narrowed to something else; a missing, expired or foreign actor token and a client without the exchange permission are refused with the standard errors. The quarantined scenario runs unchanged. The two leads and the effect of the three calls are confirmed or ruled out in the findings record, each with a negative control.

Acceptance criteria

AC1 Given a subject token of a person and an actor token of an agent host client that is permitted to exchange, when the client calls the token-exchange endpoint, then the issued access token keeps the person as subject, carries an act claim that names the actor client, a scope contained in the scope of the subject token and the one audience of the gateway that fronts that scope (ADR-0023 decision 4, ADR-0015 decision 6).
AC2 Given the same exchange, when the request asks for a scope the subject token does not hold or the actor may not request, then it is refused with the standard scope error; when the actor token is missing, expired or issued by another authority, or the client lacks the exchange permission, then it is refused with the standard grant or client error and no token is issued (ADR-0023 decision 4, ADR-0008).
AC3 Given the quarantined acceptance scenario for an exchange with an actor token, when its quarantine tag is removed and nothing else in the scenario changes, then it passes in the full acceptance run (ADR-0023; item 1 of Docs/Consumer-Reported-Findings.md of the template; docs/architecture/adr/0023-a2a-interoperability.md).
AC4 Given the two leads of the findings page and the scope, audience and resource calls of the exchange branch, when the work is done, then the findings record states for each whether it was the cause or had no effect, with the negative control that shows it, and item 1 is marked resolved (ADR-0008, docs/templates-docs/authorization-server-template.md).
Traces: adrs ADR-0008, ADR-0015, ADR-0023
Depends on AIFACTORY-US-244, AIFACTORY-US-245
Sources model/components.yaml, docs/architecture/adr/0023-a2a-interoperability.md, docs/architecture/adr/0008-openiddict-identity.md, docs/architecture/adr/0015-factory-tenancy-under-canonical-adr-0100.md, docs/templates-docs/authorization-server-template.md

Tasks

Task Kind Expected output Repository
AIFACTORY-TASK-599 RFC 8693 token exchange with the act claim implementation A token exchange with an actor token issues a token whose act claim names the actor and whose scope is no wider than the delegated one; the quarantined acceptance scenario of the template runs unchanged and passes; the two leads of the findings page (ActorTokenTypes, handler order set at registration) are confirmed or ruled out in the record. ConnectSoft.AuthorizationServerTemplate
AIFACTORY-TASK-1134 Token exchange acceptance scenarios for the restored case and the refusals fixture The token-exchange feature of the acceptance suite runs the formerly quarantined scenario without its quarantine tag and holds scenarios for a wider scope, a missing, an expired and a foreign actor token and a client without the exchange permission, each with a negative control. ConnectSoft.AuthorizationServerTemplate
AIFACTORY-TASK-1135 Findings record of the two leads and the three calls documentation Item 1 of Docs/Consumer-Reported-Findings.md of the template states for the actor token types option, the handler order and the scope, audience and resource calls whether each was the cause or had no effect, with the test that shows it, and is marked resolved. ConnectSoft.AuthorizationServerTemplate
AIFACTORY-TASK-1136 Verify the actor claim and the refusals in the full acceptance run verification Run the full acceptance suite through the shared application steps; the restored scenario and the refusal scenarios pass and the report is complete, which proves AC1 to AC4 of AIFACTORY-US-246 (ADR-0023). ConnectSoft.AuthorizationServerTemplate

AIFACTORY-US-1506: Authorization server template: a permitted workload client exchanges its token for a short-lived token bound to registered claim values, the token of an attempt of the Factory

enabling · persona asset-maintainer As an asset maintainer, I want the authorization server to issue a short-lived token bound to a run, a step and an attempt by a token exchange, so that a model call of an attempt is recognised as run-bound by the gateway and the router without any other service minting a token.

Decision D125 settles how a run-bound call of the OpenAI-compatible route of the model gateway is recognised: it presents the token of an attempt. RunControlService hands that token out in the required member attemptToken of the lease answer lease-v1 (docs/reference/schemas/attempt-outcome.schema.json), and the token names the run, the step and the attempt in the claims run_id, step_id and attempt_id beside the tenant claim tid. The Authorization Server is the sole token issuer of the Factory (ADR-0101), so no service mints the token itself: RunControlService obtains it by a token exchange that it makes with its own workload identity when it grants the lease, and the token lives no longer than the lease. This PBI delivers that exchange in the template. The template already performs the exchange with an actor token for a delegation (AIFACTORY-US-246); the bound exchange is a second kind of the same grant, kept apart from the delegation by its registration. The registration data that make a generated server the authorization server of the Factory gain a fourth file beside the scope, workload and public client registration files of AIFACTORY-US-244, AIFACTORY-US-245 and AIFACTORY-US-526, the bound exchange registration file. An entry names the workload client permitted to exchange, the claim names the issued token carries and whose values the request supplies, the one audience of the issued token and the maximum lifetime. The template names no client, claim or audience of the Factory in code. The Factory seeds one entry: the client of RunControlService, the claims run_id, step_id and attempt_id, the tenant claim tid, and the audience of the gateway on which a run-bound call is made, the model gateway. The permitted client presents its own workload token as subject token, the values of the registered claims and the lifetime it asks for, the lifetime of the lease it grants. The issued access token has the client as its subject, carries exactly the registered claims with the values of the request and the one audience of the entry, holds no svc. scope and no role claim, and expires at the lower of the requested lifetime and the maximum of the entry. Refusals are the standard errors of the grant and no token is issued: a client without an entry, a missing value of a registered claim, a claim the entry does not name, another audience than the one of the entry, and a lifetime above the maximum. An entry that names a user scope, an svc. scope or no claim fails the seed with the entry named. The exchange writes no token value to a log, an activity or a metric, and the claims contract page of the template documents the kind with its registration file.

Acceptance criteria

AC1 Given a bound exchange registration file with one entry for a workload client, three bound claims, the tenant claim, one audience and a maximum lifetime, when the server is seeded and that client presents its workload token with the values of the claims and a lifetime below the maximum, then the issued access token has the client as its subject, carries exactly the registered claims with the values of the request, the one audience of the entry and no svc. scope and no role claim, and expires at the requested lifetime (ADR-0015, docs/reference/schemas/attempt-outcome.schema.json).
AC2 Given the same entry, when a client without an entry asks for the exchange, a registered claim has no value, the request names a claim the entry does not hold, another audience or a lifetime above the maximum, then each request is refused with the standard error of the grant and no token is issued; an entry that names a user scope, an svc. scope or no claim fails the seed with the entry named (ADR-0008, ADR-0015).
AC3 Given the exchange with an actor token of AIFACTORY-US-246 and the bound exchange in one generated server, when both are requested, then each issues the token of its own kind, a delegation never carries the bound claims and a bound token never carries an act claim, and no token value appears in a log line, an activity or a metric of the server (ADR-0023 decision 4, ADR-0019).
AC4 Given the claims contract page of the template, when the contract test compares it with a seeded server, then the page names the bound exchange registration file, its fields and the claims and the audience of the issued token, and a difference fails the test (ADR-0008, docs/templates-docs/authorization-server-template.md).
Traces: descriptors lease-v1
Traces: adrs ADR-0008, ADR-0015, ADR-0019, ADR-0023
Depends on AIFACTORY-US-244, AIFACTORY-US-245, AIFACTORY-US-246
Sources model/components.yaml, docs/reference/schemas/attempt-outcome.schema.json, docs/architecture/adr/0015-factory-tenancy-under-canonical-adr-0100.md, docs/architecture/adr/0008-openiddict-identity.md, docs/templates-docs/authorization-server-template.md

Tasks

Task Kind Expected output Repository
AIFACTORY-TASK-6134 Bound exchange registration file and its seed contract The template holds the schema of a bound exchange registration file with the permitted workload client, the bound claim names, the one audience and the maximum lifetime, and the migration seeds one exchange permission per entry; an entry that names a user scope, an svc. scope or no claim fails the seed with the entry named; the template names no client, claim or audience of the Factory in code. ConnectSoft.AuthorizationServerTemplate
AIFACTORY-TASK-6135 Bound token exchange that issues a short-lived token with the registered claim values implementation The token-exchange endpoint serves the bound kind beside the delegation of AIFACTORY-TASK-599: for a permitted client presenting its workload token it issues an access token with the client as subject, exactly the registered claims with the values of the request, the one audience of the entry and an expiry at the lower of the requested lifetime and the maximum; every other request is refused with the standard error and no token value is logged. ConnectSoft.AuthorizationServerTemplate
AIFACTORY-TASK-6136 Acceptance scenarios of the bound exchange and its refusals fixture The token-exchange feature of the acceptance suite holds scenarios for a bound exchange with a seeded entry, a client without an entry, a missing claim value, a claim outside the entry, another audience, a lifetime above the maximum and a faulty entry in the seed, each with a negative control, and a scenario that holds a delegation and a bound token apart. ConnectSoft.AuthorizationServerTemplate
AIFACTORY-TASK-6137 Bound exchange on the claims contract page documentation Docs/Claims-and-Token-Contract.md of the template names the bound exchange registration file, its fields, the claims, the audience and the lifetime rule of the issued token, and the contract test of the acceptance suite fails when a seeded server and the page differ. ConnectSoft.AuthorizationServerTemplate
AIFACTORY-TASK-6138 Verify the bound exchange in the full acceptance run verification Run the full acceptance suite through the shared application steps; the bound exchange, its refusals, the faulty seed entry, the separation from the delegation and the contract test pass and the report is complete, which proves AC1 to AC4 of AIFACTORY-US-1506 (ADR-0008, ADR-0015). ConnectSoft.AuthorizationServerTemplate

AIFACTORY-US-247: Authorization server template: the hosted run of the shared application steps is complete, the legacy local runner copies are removed, and a Scripts check keeps the Scripts folder current

enabling · persona asset-maintainer As an asset maintainer, I want the green result of the authorization server template to mean a complete run by the one shared implementation, on current scripts, so that a token contract that passes its suite has passed every scenario of it.

Item 5 of the findings page of the template (Docs/Consumer-Reported-Findings.md of the template) describes how the acceptance suite of the template was cut off by the test session timeout while the run printed a pass, and names as the stronger repair a runner that compares the discovery list with what executed. The item is older than the pages that record what the template has done since. build/Invoke-AuthServerTests.ps1 checks completeness for each assembly and build/Test-AuthServerTestResults.ps1 validates the result files; azure-pipelines.yml imports template-ci/v1/application-steps.yml of the shared template pipeline tooling; the installer verification page (Docs/Installer-Verification.md of the template) requires generated test discovery and completion checks for every case; and the shared pipeline page (Docs/Shared-Template-CI.md of the template) records two runs with matching discovery and result totals. What is open is narrower. The rollout ledger of the shared tooling (template-ci/rollout-status.md of ConnectSoft.AzurePipelines) records the template as passed on the local Domain gate with the normal, service and hosted gates open, and the shared pipeline page keeps the legacy local helpers temporarily, for review and rollback, until equivalent hosted verification has passed. Item 7 is a real gap: the root Scripts folder holds 14 files against 35 in the base template, without the observability toolkit and the dashboards, and a hand copy would only add a second copy that drifts. This PBI closes what remains. The hosted run of the shared application steps passes with complete unit, architecture and acceptance reports, and a synthetic truncated report is rejected by the shared validator. Once that hosted gate has passed, the legacy local runner copies are removed, so that one implementation remains, in the shared tooling. The base-template submodule pointer moves to the base template state the findings feature publishes, and build/MaterializedDirectory.Packages.props is regenerated with the write mode of build/Sync-MaterializedPackages.ps1. The Scripts check of item 7 runs in check mode beside that package snapshot check and fails with the missing or changed files named. Items 5 and 7 of the findings page are updated with this evidence.

Acceptance criteria

AC1 Given the pipeline of the template on a hosted agent, when the unit, architecture and acceptance suites run through the shared application steps, then the three reports are complete with matching discovery and result totals, a synthetic truncated report is rejected by the validator of the shared tooling, and a run that executes fewer tests than were discovered fails the stage with the missing tests named (FR-11; item 5 of Docs/Consumer-Reported-Findings.md of the template; ADR-0008).
AC2 Given the hosted gate has passed, when the template repository is searched, then the legacy local runner copies build/Invoke-AuthServerTests.ps1 and build/Test-AuthServerTestResults.ps1 with their self-test are removed, the documentation names the shared entry point for local runs, and one implementation of the completeness check remains, in the shared tooling (FR-11, model/components.yaml).
AC3 Given the root Scripts folder of the template, when the Scripts check runs in check mode in the pipeline beside the package snapshot check and the folder differs from the Scripts folder of the base-template submodule, then the stage fails with the missing and the changed files named, and after the write mode has written the folder the check passes and the observability toolkit and dashboards are present (FR-11, docs/architecture/ecosystem-composition.md).
AC4 Given the base-template submodule pointer moved to the base template state of the findings feature, when build/Sync-MaterializedPackages.ps1 runs in check mode, then build/MaterializedDirectory.Packages.props matches, and items 5 and 7 of the findings page name the hosted run, the removed copies and the Scripts check as their evidence and are marked resolved (ADR-0008, model/components.yaml).
Traces: adrs ADR-0008
Traces: requirements FR-11
Depends on feature:component-base-template-findings
Sources model/components.yaml, docs/architecture/ecosystem-composition.md, docs/architecture/adr/0008-openiddict-identity.md

Tasks

Task Kind Expected output Repository
AIFACTORY-TASK-600 Test-run completeness check and Scripts sync guard verification The hosted pipeline run shows the three suites complete through the shared application steps, red on a synthetic truncated report and red on a drifted Scripts folder, so a session timeout can no longer report a green incomplete run and the observability toolkit and dashboards stay in step with the base template without a second copy, which proves AC1 to AC4 of AIFACTORY-US-247. ConnectSoft.AuthorizationServerTemplate
AIFACTORY-TASK-1137 Legacy local runner copies removed after the hosted gate implementation After the hosted run of the shared application steps has passed, build/Invoke-AuthServerTests.ps1, build/Test-AuthServerTestResults.ps1 and build/Test-AuthServerTestResults.SelfTest.ps1 are removed, no pipeline or documentation page refers to them, the testing page names the shared entry point for local runs, and the shared pipeline page no longer lists them as kept for rollback. ConnectSoft.AuthorizationServerTemplate
AIFACTORY-TASK-1174 Base-template submodule pointer moved and the materialized package snapshot regenerated operations The base-template submodule of the template points at the base template state the feature component-base-template-findings publishes, build/MaterializedDirectory.Packages.props is regenerated by build/Sync-MaterializedPackages.ps1 with -Write, and the same script passes in check mode; no file inside the submodule is edited. ConnectSoft.AuthorizationServerTemplate
AIFACTORY-TASK-1138 Scripts folder written from the base template and checked in the pipeline operations The manifest of the template holds the entry of the Scripts check, the root Scripts folder is written from the Scripts folder of the base-template submodule, and the pipeline runs the check in check mode beside build/Sync-MaterializedPackages.ps1 and fails on drift with the files named. ConnectSoft.AuthorizationServerTemplate
AIFACTORY-TASK-1139 Items 5 and 7 of the findings page updated with the hosted evidence documentation Item 5 of Docs/Consumer-Reported-Findings.md of the template names the hosted run with its discovery and result totals, the rejected synthetic truncated report and the removal of the local runner copies; item 7 names the Scripts check and its first green and first red run; both are marked resolved, and the rollout ledger entry of the template is quoted with its hosted gate passed. ConnectSoft.AuthorizationServerTemplate

AIFACTORY-US-526: Authorization server template: the registration data seed a public client without a secret that signs in by the authorization code flow with PKCE and by the device code flow

enabling · persona asset-maintainer As an asset maintainer, I want the authorization server to register a public client with the two sign-in flows from registration data, so that the command-line client of the Factory signs a person in with or without a browser and holds no client secret.

The amendment of ADR-0015 on the client sign-in (decision D117) makes the command-line client of the Factory a public client: it signs in with the authorization code flow with PKCE by default and with the device code flow when a switch asks for it, on a machine without a browser. The template implements both flows already. Its flow pages (the Docs/Flows folder of the template) record the authorization code flow with PKCE with its acceptance scenarios and the device authorization flow of RFC 8628 as implemented, and name a command-line tool among the uses of the device flow. What the Factory lacks is the registration of its client. The registration data that make a generated server the authorization server of the Factory are the scope registration file of AIFACTORY-US-244 and the workload registration file of AIFACTORY-US-245, and neither registers a client without a secret that may use these two flows for Factory scopes. This PBI adds a third file to them, the public client registration file. An entry names the client identifier, the flows the client may use out of authorization code with PKCE and device code, whether it may renew its token with a refresh token, its loopback redirect addresses for the authorization code flow and the Factory scopes it may request. The seed registers one public client per entry: without a secret, with a proof key required for the code exchange, and with the permissions of the endpoints and grant types of the named flows and of nothing else. The template holds no client name in code; the Factory seeds one entry, the command-line client, with the scopes of the control plane gateway that the service files of the model name and the scopes factory.recipes.read and factory.recipes.approve of the template catalog gateway, which fronts GenerationRecipeService (decision D123). The audience follows the rule of AIFACTORY-US-244 unchanged: the token has the one audience of the gateway that fronts its granted scopes, and a request for scopes of two gateways is refused, so the command-line client requests the scopes of each gateway as a separate token, one per audience. The refusals are the standard ones. An authorization request of the public client without a code challenge is refused, as is a code exchange with a wrong verifier. A token request that presents a client secret for the public client, a client credentials request by it and a request for a scope its entry does not hold, an svc. scope included, are refused. A device code that the person denied, that expired or that is polled faster than the interval allows is answered with the standard errors of the device flow and no token. An entry that names a secret, a flow outside the two, a redirect address that is not a loopback address or an svc. scope fails the seed with the entry named. A token obtained by either flow carries the claims as AIFACTORY-US-244 issues them: the tenant, the role claims per project and the granted scopes. The claims contract page and the deployment checklist of the template name the public client registration and state that a public client holds no credential an operator replaces.

Acceptance criteria

AC1 Given a public client registration file with one entry that names both flows, a loopback redirect address and scopes of one gateway, when the server is seeded, then one public client exists without a secret, with a proof key required for the code exchange and with the permissions of the authorization code grant, the device code grant and, where the entry allows it, the refresh token grant and of no other grant; an entry that names a secret, another flow, a redirect address that is not a loopback address or an svc. scope fails the seed with the entry named (ADR-0015 amendment on the client sign-in, ADR-0008).
AC2 Given the seeded public client and a member with role assignments, when the client completes the authorization code flow with PKCE, then the issued access token carries the tenant claim, the role claims and the granted Factory scopes with the one audience of the gateway that fronts them; an authorization request without a code challenge, a code exchange with a wrong verifier and a token request that presents a client secret are each refused with the standard error and no token is issued (ADR-0015 amendments on the client sign-in and on the one audience of a user token, FR-01).
AC3 Given the same client, when it starts the device code flow and the member confirms the user code at the verification address, then the token request that polls at the given interval is answered with a token of the same claims and the same one audience; a code the member denied, an expired code and a poll faster than the interval allows are answered with the standard errors of the device flow and no token is issued (ADR-0015 amendment on the client sign-in, ADR-0008).
AC4 Given the seeded public client, when it requests a token by client credentials, a scope its entry does not hold or an svc. scope, then the request is refused with the standard error; and the claims contract page of the template names the public client registration with its two flows, which the contract test compares with a seeded server (ADR-0008, docs/templates-docs/authorization-server-template.md).
Traces: adrs ADR-0008, ADR-0015
Traces: requirements FR-01
Depends on AIFACTORY-US-244, AIFACTORY-US-245
Sources model/components.yaml, docs/architecture/adr/0015-factory-tenancy-under-canonical-adr-0100.md, docs/architecture/adr/0008-openiddict-identity.md, docs/templates-docs/authorization-server-template.md

Tasks

Task Kind Expected output Repository
AIFACTORY-TASK-2115 Public client registration file and its seed contract The template holds the schema of a public client registration file with client identifier, the flows out of authorization code with PKCE and device code, the refresh token permission, the loopback redirect addresses and the Factory scopes, and the migration seeds one public client per entry without a secret, with a proof key required and with the permissions of the named flows only; an entry with a secret, a flow outside the two, a redirect address that is not a loopback address, an svc. scope or a scope that is not registered fails the seed with the entry named; the template names no client in code. ConnectSoft.AuthorizationServerTemplate
AIFACTORY-TASK-2116 Acceptance scenarios of the seeded public client for both flows and their refusals fixture The acceptance suite of the template holds scenarios for the seeded public client: the authorization code flow with PKCE to a token with the Factory claims and one audience, the device code flow with a confirmed, a denied and an expired code and a poll faster than the interval, and the refusals of a request without a code challenge, a wrong verifier, a presented client secret, a client credentials request and a scope outside the entry, each with a negative control. ConnectSoft.AuthorizationServerTemplate
AIFACTORY-TASK-2117 Public client registration on the claims contract page and the deployment checklist documentation Docs/Claims-and-Token-Contract.md of the template names the public client registration file, the two flows a public client may use and the claims and the one audience of its token, the deployment checklist states that a public client holds no credential an operator replaces, and the contract test of the acceptance suite fails when a seeded public client and the page differ. ConnectSoft.AuthorizationServerTemplate
AIFACTORY-TASK-2118 Verify the public client by both flows and by its refusals verification Run the acceptance scenarios of the seeded public client for the authorization code flow with PKCE, the device code flow with a confirmed, a denied and an expired code, a request without a code challenge, a presented client secret, a client credentials request and a scope outside the entry, and the seed with a faulty entry; the tokens and the refusals are as stated, which proves AC1 to AC4 of AIFACTORY-US-526 (ADR-0015, ADR-0008). ConnectSoft.AuthorizationServerTemplate

AIFACTORY-US-248: Authorization server template: the Factory token contract passes the full suites of the authoring pipeline and the Domain cases of the installer pipeline before the package publishes

evidence · persona asset-maintainer As an asset maintainer, I want the Factory token contract to be proven by the two pipelines the template has, so that the sole token issuer of the Factory is scaffolded from a package whose token scenarios all ran and passed.

The installer verification page of the template (Docs/Installer-Verification.md of the template) states how the template gates itself. The template pipeline is the import of the shared installer jobs with the cases of build/template-ci.json: the Domain cases run generated unit and contract tests with local test doubles and not live endpoint or database acceptance tests, the authoring pipeline retains responsibility for full application acceptance, and publication already requires complete reports bound to the candidate hash and a credential check of the candidate. This PBI is the proof of the feature in those two pipelines as they are. The authoring pipeline runs the full unit, architecture and acceptance suites with the Factory claims, workload identity, public client sign-in and token exchange scenarios through the shared application steps. The installer pipeline generates the Domain cases, whose test filter in the manifest gains contract-level tests of the Factory claims, the workload registration, the public client registration and the exchange with the actor claim, and audits each case, which is clean only on a base template whose findings are closed. Item 2 of the findings page records that the package once held a developer-local folder and that the pipeline, which packs a fresh clone, would not notice such content on its own. The package protection check of the shared tooling is the place that refuses such a candidate. ConnectSoft.AzurePipelines is a before-development repository (D114), so the extension of Protect-TemplatePackage.ps1 to developer-local folders is a task of this PBI in that repository; the template proves the refusal with a planted folder and adds no content check of its own. A stage that fails stops the run with the stage named and the package is not published. Publication requires the reports of both pipelines and pushes a version that is not yet on the ConnectSoft feed. The PBI proves ADR-0008 and decision 4 of ADR-0023 on the template and the release gate of FR-11.

Acceptance criteria

AC1 Given a change of the authorization server template, when its authoring pipeline runs, then the full unit, architecture and acceptance suites run with the Factory claims, workload identity, public client sign-in, token exchange and bound exchange scenarios of AIFACTORY-US-1506 through the shared application steps and their reports are complete (ADR-0008, ADR-0023 decision 4, FR-11).
AC2 Given the same change, when the installer pipeline runs the shared installer jobs, then it generates the Domain cases of build/template-ci.json, whose test filter holds contract-level tests of the Factory claims, the workload registration, the public client registration and the exchange with the actor claim, restores and builds each case in Release, runs the filtered tests with the discovery and completion checks and audits each case (ADR-0008, ADR-0015, FR-11).
AC3 Given a failing scenario, an incomplete report, an audit finding or a candidate that holds a developer-local folder, when the pipelines evaluate the run, then the run fails with the stage named and the package is not published; a planted failing token exchange scenario and a planted developer-local folder prove the refusals (FR-11, docs/architecture/ecosystem-composition.md).
AC4 Given complete reports of both pipelines bound to the candidate hash, when the publication job runs, then the package is pushed with a version that was not on the feed, and a fresh install of that version generates the Domain cases whose contract tests of the Factory claims, the workload registration, the public client registration and the exchange with the act claim pass unchanged (ADR-0008, ADR-0015, ADR-0023, model/template-parameters/connectsoft-authorization-server.yaml).
Traces: adrs ADR-0008, ADR-0015, ADR-0023
Traces: requirements FR-11
Depends on AIFACTORY-US-244, AIFACTORY-US-245, AIFACTORY-US-246, AIFACTORY-US-247, AIFACTORY-US-526, AIFACTORY-US-1506, feature:component-base-template-findings
Sources model/components.yaml, docs/architecture/ecosystem-composition.md, docs/architecture/adr/0008-openiddict-identity.md, docs/architecture/adr/0023-a2a-interoperability.md, model/template-parameters/connectsoft-authorization-server.yaml, docs/architecture/catalogs/templates.md

Tasks

Task Kind Expected output Repository
AIFACTORY-TASK-1140 Factory token contract tests in the test filter of the Domain cases operations The generated test projects hold contract-level tests of the Factory claims, the workload registration, the public client registration and the token exchange with the actor claim that run with local test doubles, and the test filter of each Domain case in build/template-ci.json selects them; the Factory claims, workload identity, public client sign-in and token exchange acceptance scenarios stay in the authoring pipeline and run through the shared application steps; the template pipeline gains no stage of its own. ConnectSoft.AuthorizationServerTemplate
AIFACTORY-TASK-1463 Package protection check of the shared tooling extended to developer-local folders implementation Protect-TemplatePackage.ps1 of template-ci/v1 refuses a candidate that holds a developer-local folder, such as an assistant worktree folder or an editor settings folder, with the entry named, beside the package source credentials it refuses today; Test-TemplatePackageProtection.SelfTest.ps1 covers a candidate with a planted local folder that is refused and a clean candidate that is accepted. ConnectSoft.AzurePipelines
AIFACTORY-TASK-1141 Planted developer-local folder refused by the package protection check fixture A self-test of the template packs a candidate with a planted developer-local folder through the pack action of the shared tooling and asserts that the package protection check refuses it and publication is not reached; the pack action runs at a tooling commit that carries the extension of AIFACTORY-TASK-1463. ConnectSoft.AuthorizationServerTemplate
AIFACTORY-TASK-1142 Verify the gate of the authorization server template on a green and a planted run verification One green run of both pipelines publishes the package and a fresh install generates the Domain cases whose token contract tests pass; a run with a planted failing token exchange scenario stops before publication; both prove AC1 to AC4 of AIFACTORY-US-248 (ADR-0008, ADR-0023, FR-11). ConnectSoft.AuthorizationServerTemplate

AIFACTORY-US-108: Authorization server template: the Factory token contract, workload identity and delegation is delivered and proven on a generated solution

enabling · persona asset-maintainer As an asset maintainer, I want Authorization Server to carry the Factory token contract, workload identity and delegation, so that it serves sole token issuer (ADR-0101) without later rework.

This is the integration PBI of the feature. The authorization server is the sole token issuer of the Factory, and its template issues standard OpenID Connect tokens with tenant claims but not yet what a Factory call needs. With project-scoped role claims, registered scopes and the one audience of the gateway that fronts them in the issued tokens, one workload identity per service and agent host with svc. scopes and no audience of a user API, the public client of the command-line client with the authorization code flow with PKCE and the device code flow (AIFACTORY-US-526), the token exchange with its actor claim, the bound exchange that issues the token of an attempt to RunControlService (AIFACTORY-US-1506, decision D125), the complete hosted run with one completeness implementation and the Scripts check, and the gate of the two pipelines, the asset maintainer runs the pipelines end to end: the full suites in the authoring pipeline, then pack, install, generate the Domain cases, build, test and audit, then publish. A failing stage blocks publication. The migrated tasks sit under the PBIs that deliver them, and the verification task of this PBI is the proof on the published package. The feature is done when a server generated from the published package issues a Factory token, a token for the public client by each of its two flows, a workload token, an exchanged token and a bound token as the claims contract page documents them, and the open items of the findings page that the Factory needs are resolved.

Acceptance criteria

AC1 Given the template repository ConnectSoft.AuthorizationServerTemplate with the work of this feature, when the template is packed, installed and instantiated in its pipeline, then the generated solution builds and its tests pass before the package publishes with a verified version (ADR-0008, model/components.yaml).
AC2 Given the work of AIFACTORY-TASK-597 (Factory claims, scopes and audiences in the issued tokens) is done, then an access token for a Factory client carries the tenant, the project-scoped role claims and the valid delegations read from the identity service, the registered Factory scopes and one audience, the resource of the gateway that fronts those scopes, a request that combines scopes of two gateways is refused, a token for one audience is rejected by another, and the claims contract page of the template documents every claim (ADR-0015 decision 6).
AC3 Given the work of AIFACTORY-TASK-598 (workload identity for services and agents) is done, then a client-credentials client exists per Factory service and per agent host with its own secret or certificate and only its svc. service scopes, the seeded development secret is refused outside the Development environment, no two seeded clients share a secret, and the deployment checklist names the credential the operator replaces (ADR-0023 decision 4).
AC4 Given the work of AIFACTORY-TASK-599 (RFC 8693 token exchange with the act claim) is done, then a token exchange with an actor token issues a token whose act claim names the actor and whose scope is no wider than the delegated one, the quarantined acceptance scenario of the template runs unchanged and passes, and the two leads of the findings page are confirmed or ruled out in the record (ADR-0023).
AC5 Given the work of AIFACTORY-TASK-600 (test-run completeness check and Scripts sync guard) is done, then the hosted run compares the discovered tests with the executed ones through the shared application steps and fails on a difference, so a session timeout can no longer report a green incomplete run, the legacy local runner copies are removed, and a Scripts check in the pipeline keeps the observability toolkit and dashboards in step with the base template without a second copy (ADR-0008, docs/architecture/ecosystem-composition.md).
Traces: adrs ADR-0008, ADR-0015, ADR-0023
Depends on AIFACTORY-US-244, AIFACTORY-US-245, AIFACTORY-US-246, AIFACTORY-US-247, AIFACTORY-US-248, AIFACTORY-US-526, AIFACTORY-US-1506
Sources model/components.yaml, docs/architecture/adr/0015-factory-tenancy-under-canonical-adr-0100.md, docs/templates-docs/authorization-server-template.md

Tasks

Task Kind Expected output Repository
AIFACTORY-TASK-671 Verify auth-server-template-factory-tokens-delivered by running the declared command verification Run dotnet build -c Release and dotnet test -c Release --no-build on the server generated from the published package; they pass with a complete run and prove AC1 to AC5 of AIFACTORY-US-108. ConnectSoft.AuthorizationServerTemplate