@wildo-ai/wildo-cli 1.1.12 → 1.1.13
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/dist/src/commands/config/sync.command.d.ts.map +1 -1
- package/dist/src/commands/config/sync.command.js +1 -0
- package/dist/src/commands/config/sync.command.js.map +1 -1
- package/dist/src/commands/context/journey.command.d.ts.map +1 -1
- package/dist/src/commands/context/journey.command.js +8 -0
- package/dist/src/commands/context/journey.command.js.map +1 -1
- package/dist/src/commands/creation/drive.command.d.ts.map +1 -1
- package/dist/src/commands/creation/drive.command.js +2 -0
- package/dist/src/commands/creation/drive.command.js.map +1 -1
- package/dist/src/commands/fwk/publish-all.command.d.ts.map +1 -1
- package/dist/src/commands/fwk/publish-all.command.js +8 -0
- package/dist/src/commands/fwk/publish-all.command.js.map +1 -1
- package/dist/src/commands/local/dev.command.d.ts +68 -0
- package/dist/src/commands/local/dev.command.d.ts.map +1 -1
- package/dist/src/commands/local/dev.command.js +216 -8
- package/dist/src/commands/local/dev.command.js.map +1 -1
- package/dist/src/commands/local/doctor.command.d.ts +22 -9
- package/dist/src/commands/local/doctor.command.d.ts.map +1 -1
- package/dist/src/commands/local/doctor.command.js +45 -42
- package/dist/src/commands/local/doctor.command.js.map +1 -1
- package/dist/src/commands/providers/connect.command.d.ts.map +1 -1
- package/dist/src/commands/providers/connect.command.js +11 -1
- package/dist/src/commands/providers/connect.command.js.map +1 -1
- package/dist/src/commands/seal/currency.command.d.ts +13 -0
- package/dist/src/commands/seal/currency.command.d.ts.map +1 -0
- package/dist/src/commands/seal/currency.command.js +52 -0
- package/dist/src/commands/seal/currency.command.js.map +1 -0
- package/dist/src/commands/seal/seal-admin-door.utils.d.ts.map +1 -1
- package/dist/src/commands/seal/seal-admin-door.utils.js +2 -0
- package/dist/src/commands/seal/seal-admin-door.utils.js.map +1 -1
- package/dist/src/commands/seal/verify.command.d.ts +5 -0
- package/dist/src/commands/seal/verify.command.d.ts.map +1 -1
- package/dist/src/commands/seal/verify.command.js +26 -2
- package/dist/src/commands/seal/verify.command.js.map +1 -1
- package/dist/src/services/application/content-guardrail-classifier.service.d.ts +19 -0
- package/dist/src/services/application/content-guardrail-classifier.service.d.ts.map +1 -1
- package/dist/src/services/application/content-guardrail-classifier.service.js +75 -11
- package/dist/src/services/application/content-guardrail-classifier.service.js.map +1 -1
- package/dist/src/services/application/local-provider-doubles.service.d.ts +98 -0
- package/dist/src/services/application/local-provider-doubles.service.d.ts.map +1 -0
- package/dist/src/services/application/local-provider-doubles.service.js +214 -0
- package/dist/src/services/application/local-provider-doubles.service.js.map +1 -0
- package/dist/src/services/application/system-of-record-simulators.service.d.ts +21 -2
- package/dist/src/services/application/system-of-record-simulators.service.d.ts.map +1 -1
- package/dist/src/services/application/system-of-record-simulators.service.js +21 -12
- package/dist/src/services/application/system-of-record-simulators.service.js.map +1 -1
- package/dist/src/services/companion/creation-drive.service.d.ts +32 -2
- package/dist/src/services/companion/creation-drive.service.d.ts.map +1 -1
- package/dist/src/services/companion/creation-drive.service.js +61 -4
- package/dist/src/services/companion/creation-drive.service.js.map +1 -1
- package/dist/src/services/credentials/credentials.schemas.d.ts +6 -0
- package/dist/src/services/credentials/credentials.schemas.d.ts.map +1 -1
- package/dist/src/services/credentials/credentials.schemas.js +7 -1
- package/dist/src/services/credentials/credentials.schemas.js.map +1 -1
- package/dist/src/services/credentials/provider-env-vars.utils.d.ts.map +1 -1
- package/dist/src/services/credentials/provider-env-vars.utils.js +11 -3
- package/dist/src/services/credentials/provider-env-vars.utils.js.map +1 -1
- package/dist/src/services/data-services/data-services.schemas.d.ts +9 -0
- package/dist/src/services/data-services/data-services.schemas.d.ts.map +1 -1
- package/dist/src/services/data-services/data-services.schemas.js +9 -0
- package/dist/src/services/data-services/data-services.schemas.js.map +1 -1
- package/dist/src/services/deployment/docker/docker-compose-generator.service.d.ts.map +1 -1
- package/dist/src/services/deployment/docker/docker-compose-generator.service.js +7 -2
- package/dist/src/services/deployment/docker/docker-compose-generator.service.js.map +1 -1
- package/dist/src/services/deployment/local-dev-session-lease.service.d.ts.map +1 -1
- package/dist/src/services/deployment/local-dev-session-lease.service.js +22 -1
- package/dist/src/services/deployment/local-dev-session-lease.service.js.map +1 -1
- package/dist/src/services/environment/authored-infra-config.utils.d.ts.map +1 -1
- package/dist/src/services/environment/authored-infra-config.utils.js +1 -0
- package/dist/src/services/environment/authored-infra-config.utils.js.map +1 -1
- package/dist/src/services/environment/authored-infra-member-authority.d.ts.map +1 -1
- package/dist/src/services/environment/authored-infra-member-authority.js +5 -0
- package/dist/src/services/environment/authored-infra-member-authority.js.map +1 -1
- package/dist/src/services/environment/env-configuration-generator.service.d.ts.map +1 -1
- package/dist/src/services/environment/env-configuration-generator.service.js +6 -3
- package/dist/src/services/environment/env-configuration-generator.service.js.map +1 -1
- package/dist/src/services/environment/env-vars-builder.service.d.ts +6 -0
- package/dist/src/services/environment/env-vars-builder.service.d.ts.map +1 -1
- package/dist/src/services/environment/env-vars-builder.service.js +24 -1
- package/dist/src/services/environment/env-vars-builder.service.js.map +1 -1
- package/dist/src/services/environment/environment-hydration.utils.d.ts.map +1 -1
- package/dist/src/services/environment/environment-hydration.utils.js +1 -0
- package/dist/src/services/environment/environment-hydration.utils.js.map +1 -1
- package/dist/src/services/environment/environment.schemas.d.ts +7 -1
- package/dist/src/services/environment/environment.schemas.d.ts.map +1 -1
- package/dist/src/services/environment/environment.schemas.js.map +1 -1
- package/dist/src/services/environment/runtime-bootstrap.service.d.ts +2 -0
- package/dist/src/services/environment/runtime-bootstrap.service.d.ts.map +1 -1
- package/dist/src/services/environment/runtime-bootstrap.service.js +4 -0
- package/dist/src/services/environment/runtime-bootstrap.service.js.map +1 -1
- package/dist/src/services/framework/framework-docker-publish.service.d.ts +13 -0
- package/dist/src/services/framework/framework-docker-publish.service.d.ts.map +1 -1
- package/dist/src/services/framework/framework-docker-publish.service.js +24 -7
- package/dist/src/services/framework/framework-docker-publish.service.js.map +1 -1
- package/dist/src/services/registry/provider-connect.service.d.ts +57 -1
- package/dist/src/services/registry/provider-connect.service.d.ts.map +1 -1
- package/dist/src/services/registry/provider-connect.service.js +63 -2
- package/dist/src/services/registry/provider-connect.service.js.map +1 -1
- package/dist/tsconfig.build.tsbuildinfo +1 -1
- package/package.json +18 -18
- package/scripts/app-dependency-alignment/propagated-engine-overrides.json +1 -1
- package/wildo-framework.info.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"framework-docker-publish.service.js","sourceRoot":"","sources":["../../../../src/services/framework/framework-docker-publish.service.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,eAAe,CAAC;AAC1C,OAAO,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,IAAI,CAAC;AAC9C,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,MAAM,CAAC;AACtC,OAAO,EACL,sBAAsB,EACtB,6BAA6B,EAC7B,gCAAgC,GAGjC,MAAM,+BAA+B,CAAC;AACvC,OAAO,EACL,kCAAkC,EAClC,sCAAsC,GACvC,MAAM,+BAA+B,CAAC;AACvC,OAAO,EAAE,uBAAuB,EAAE,MAAM,yDAAyD,CAAC;AAClG,OAAO,EAAE,WAAW,EAAE,MAAM,sDAAsD,CAAC;AAEnF,iIAAiI;AACjI,MAAM,CAAC,MAAM,8BAA8B,GAAG,mCAAmC,CAAC;AAClF,MAAM,CAAC,MAAM,6BAA6B,GAAG,kCAAkC,CAAC;AAChF;;;GAGG;AACH,MAAM,CAAC,MAAM,6BAA6B,GAAG,kCAAkC,CAAC;AAChF,kGAAkG;AAClG,MAAM,CAAC,MAAM,4BAA4B,GAAG,iCAAiC,CAAC;AAE9E;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,gCAAgC,GAAG,CAAC,uBAAuB,EAAE,aAAa,CAAU,CAAC;AAQlG,oGAAoG;AACpG,SAAS,iBAAiB,CAAC,OAAe;IACxC,OAAO,CAAC,SAAS,CAAC,IAAI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["import { spawnSync } from 'child_process';\nimport { existsSync, readFileSync } from 'fs';\nimport { join, relative } from 'path';\nimport {\n resolveFrameworkLayout,\n WildoFrameworkDockerImageRole,\n WildoFrameworkDockerImageVariant,\n type FrameworkLayoutPaths,\n type WildoFrameworkReleaseDockerImage,\n} from '@wildo-ai/platform-config-lib';\nimport {\n FRAMEWORK_RELEASE_DOCKER_NAMESPACE,\n FRAMEWORK_RELEASE_DOCKER_REGISTRY_HOST,\n} from '@wildo-ai/platform-config-lib';\nimport { FrameworkReleaseService } from '~wildo-cli/services/framework/framework-release.service';\nimport { DockerUtils } from '~wildo-cli/services/deployment/docker/docker.service';\n\n/** OCI annotation keys (image-spec `annotations.md`, dead-plan-citation: the OCI spec's own file), used here as build labels. */\nexport const FRAMEWORK_IMAGE_REVISION_LABEL = 'org.opencontainers.image.revision';\nexport const FRAMEWORK_IMAGE_CREATED_LABEL = 'org.opencontainers.image.created';\n/**\n * The release the image IS: the immutable tag it is pushed under (the framework version, or a channel's\n * own identity such as `test-<sha>`), so an image pulled by an alias or by digest still names its release.\n */\nexport const FRAMEWORK_IMAGE_VERSION_LABEL = 'org.opencontainers.image.version';\n/** The repository the image is built from: the framework config's `publish.npm.repositoryUrl`. */\nexport const FRAMEWORK_IMAGE_SOURCE_LABEL = 'org.opencontainers.image.source';\n\n/**\n * The BuildKit attestations pushed beside every framework image, inside the same image index: SLSA\n * provenance in `max` mode (the full build definition: Dockerfile, build args, source materials) and an\n * SPDX SBOM of each platform's filesystem. Registries and scanners (Docker Scout, `docker buildx\n * imagetools inspect --format '{{json .Provenance}}'`/`'{{json .SBOM}}'`) read them from there, and\n * `imagetools create` carries them along when an alias is repointed at the index.\n */\nexport const FRAMEWORK_IMAGE_ATTESTATION_ARGS = ['--provenance=mode=max', '--sbom=true'] as const;\n\n/** What the identity labels say: the release and the repository it was built from. */\ninterface FrameworkImageIdentity {\n version: string;\n sourceUrl: string;\n}\n\n/** A `.dockerignore` pattern that names no wildcard — a plain path, rather than a glob pathspec. */\nfunction isPlainIgnorePath(pattern: string): boolean {\n return !/[*?[\\]]/.test(pattern);\n}\n\n/**\n * The git pathspecs covering what a Docker build SENDS from its context, derived from the ignore file\n * the build itself obeys: `<Dockerfile>.dockerignore` when present (BuildKit prefers it), else the\n * context's `.dockerignore`. What the image was built from is then asked of those paths only — whether\n * they were dirty at build time, and how many commits touched them since — instead of the whole\n * repository, which several sessions edit at once and would mark nearly every image dirty.\n *\n * - A deny-all file (`*` then `!path` re-includes) scopes to its re-includes — a plain one as a path, a\n * wildcard one as a `:(glob)` pathspec, since the build sends what it matches; otherwise the whole\n * context is in scope.\n * - Its `**\\/…` exclusions become git `:(exclude,glob)` pathspecs, as `…/**` so a directory pattern\n * excludes the files under it (a bare `**\\/__tests__` glob matches no file — measured). EXCEPT those\n * under `src/`: the image excludes TypeScript source only because it ships the `dist/` compiled from\n * it, and `dist/` is gitignored — so the source IS the tracked form of what the image carries.\n *\n * Paths are relative to the framework root, where git runs. Pure over the ignore file's text, so a\n * new re-include there widens the scope with no edit here.\n */\nexport function dockerContextSourcePathspecs(frameworkRoot: string, contextPath: string, dockerfilePath: string): string[] {\n const contextRelative = relative(frameworkRoot, contextPath) || '.';\n const ignorePath = [`${dockerfilePath}.dockerignore`, join(contextPath, '.dockerignore')].find((candidate) => existsSync(candidate));\n const lines = ignorePath === undefined ? [] : readFileSync(ignorePath, 'utf8').split('\\n')\n .map((line) => line.trim())\n .filter((line) => line.length > 0 && !line.startsWith('#'));\n const inContext = (path: string): string => (contextRelative === '.' ? path : `${contextRelative}/${path}`);\n const includes = lines.includes('*')\n ? lines\n .filter((line) => line.startsWith('!'))\n .map((line) => (isPlainIgnorePath(line.slice(1)) ? inContext(line.slice(1)) : `:(glob)${inContext(line.slice(1))}`))\n : [contextRelative];\n const excludes = lines\n .filter((line) => line.startsWith('**/') && !line.slice(3).startsWith('src/'))\n .flatMap((line) => [`:(exclude,glob)${line}`, `:(exclude,glob)${line}/**`]);\n return [...(includes.length > 0 ? includes : [contextRelative]), ...excludes];\n}\n\nexport interface FrameworkDockerPublishOptions {\n frameworkRoot?: string;\n targets?: string[];\n dryRun?: boolean;\n /**\n * The IMMUTABLE tag every selected image is published under. Defaults to the\n * framework version.\n *\n * A channel that publishes per-commit supplies its own identity here — e.g.\n * `test-<sha>` — because on that channel the commit, not the version, is what\n * makes the artifact unique. Two pushes of the same framework version from\n * different commits must not collide on one tag.\n */\n immutableTag?: string;\n /**\n * MUTABLE aliases repointed at the image after every immutable push has\n * succeeded — `latest`, `test`, `next`.\n *\n * Kept as one list rather than a boolean per alias: an alias is a pointer, and\n * the set of pointers a channel maintains is channel policy, not a fixed\n * vocabulary this service should enumerate.\n */\n aliasTags?: string[];\n}\n\nexport interface FrameworkDockerPublishTargetResult {\n imageName: string;\n imageRef: string;\n aliasImageRefs: string[];\n buildContextPath: string;\n dockerfilePath: string;\n commands: string[];\n}\n\nexport interface FrameworkDockerPublishResult {\n frameworkVersion: string;\n namespace: string;\n targets: FrameworkDockerPublishTargetResult[];\n}\n\ninterface FrameworkDockerBuildContract {\n contextPath: string;\n dockerfilePath: string;\n}\n\ninterface FrameworkDockerBuildDefinition {\n role: WildoFrameworkDockerImageRole;\n variant: WildoFrameworkDockerImageVariant;\n resolveContextPath: (layout: FrameworkLayoutPaths) => string;\n resolveDockerfilePath: (layout: FrameworkLayoutPaths) => string;\n}\n\nconst FRAMEWORK_DOCKER_IMAGE_BUILD_DEFINITIONS: Record<string, FrameworkDockerBuildDefinition> = {\n 'wildo-platform': {\n role: WildoFrameworkDockerImageRole.PLATFORM_SERVICE,\n variant: WildoFrameworkDockerImageVariant.DEFAULT,\n resolveContextPath: (layout) => layout.repositoryRoot,\n resolveDockerfilePath: (layout) => layout.platformBaseDockerfilePath,\n },\n 'wildo-backend-base': {\n role: WildoFrameworkDockerImageRole.APPLICATION_BACKEND,\n variant: WildoFrameworkDockerImageVariant.DEFAULT,\n resolveContextPath: (layout) => layout.repositoryRoot,\n resolveDockerfilePath: (layout) => layout.backendBaseDockerfilePath,\n },\n 'wildo-backend-base-java': {\n role: WildoFrameworkDockerImageRole.APPLICATION_BACKEND,\n variant: WildoFrameworkDockerImageVariant.JAVA,\n resolveContextPath: (layout) => layout.repositoryRoot,\n resolveDockerfilePath: (layout) => layout.backendJavaDockerfilePath,\n },\n};\n\n/**\n * Publishes the framework-owned Docker image contract declared in framework\n * config. Each publishable image must resolve to a truthful framework-owned\n * Dockerfile so the release lane stays explicit about what the framework ships.\n */\n/**\n * The platforms every published framework image is built for, as ONE multi-platform\n * manifest list under the immutable tag.\n *\n * Decided 2026-09-03 (Paul): the Apple-Silicon-versus-x86 split is handled by the\n * registry, never by an operator. A host pulls its native image from the same\n * `docker.io/wildoai/<image>:<version>` reference, so compose files and k8s manifests carry\n * no architecture knowledge. The previous lane built `linux/amd64` only, which put every\n * Apple Silicon developer under emulation and could never produce a native arm64 image.\n *\n * Native modules (argon2, sharp, canvas, esbuild) are installed INSIDE each platform's\n * builder stage, so the binaries match by construction — see `Dockerfile.platform-base`.\n * Building the non-native half runs under QEMU on a laptop; if that becomes too slow the\n * same command moves to a CI matrix with native runners, and this list does not change.\n */\nexport const FRAMEWORK_DOCKER_IMAGE_PLATFORMS = ['linux/amd64', 'linux/arm64'] as const;\n\nexport class FrameworkDockerPublishService {\n static async publishImages(\n options: FrameworkDockerPublishOptions = {},\n ): Promise<FrameworkDockerPublishResult> {\n const resolvedFrameworkRoot = options.frameworkRoot ?? FrameworkReleaseService.getFrameworkRoot();\n await FrameworkReleaseService.assertCliCompatibility(resolvedFrameworkRoot);\n const dryRun = options.dryRun === true;\n const aliasTags = (options.aliasTags ?? []).map((tag) => tag.trim()).filter((tag) => tag.length > 0);\n const frameworkConfig = await FrameworkDockerPublishService.loadFrameworkConfigOrThrow(\n resolvedFrameworkRoot,\n );\n const immutableTag = options.immutableTag?.trim() || frameworkConfig.frameworkVersion;\n const allTargets = frameworkConfig.publish.docker.images;\n const requestedTargets = new Set(options.targets ?? []);\n const selectedTargets = allTargets.filter(\n (image) => requestedTargets.size === 0 || requestedTargets.has(image.imageName),\n );\n\n FrameworkDockerPublishService.assertLockedDockerRegistryIdentity(\n frameworkConfig.publish.docker.registryHost,\n frameworkConfig.publish.docker.namespace,\n );\n\n if (requestedTargets.size > 0) {\n const missingTargets = [...requestedTargets].filter(\n (target) => !selectedTargets.some((image) => image.imageName === target),\n );\n if (missingTargets.length > 0) {\n throw new Error(`Unknown Docker publish target(s): ${missingTargets.join(', ')}.`);\n }\n }\n\n const result: FrameworkDockerPublishResult = {\n frameworkVersion: frameworkConfig.frameworkVersion,\n namespace: frameworkConfig.publish.docker.namespace,\n targets: selectedTargets.map((image) => {\n const buildContract = FrameworkDockerPublishService.resolveBuildContract(\n resolvedFrameworkRoot,\n image,\n );\n /**\n * Fully qualified, including the registry host. A bare\n * `<namespace>/<image>` reference resolves to Docker Hub by default, so\n * omitting the host would push these images somewhere other than the\n * registry the config declares — silently, and only discoverably by a\n * consumer failing to pull.\n */\n const imageRepository = `${frameworkConfig.publish.docker.registryHost}/${frameworkConfig.publish.docker.namespace}/${image.imageName}`;\n const imageRef = `${imageRepository}:${immutableTag}`;\n const aliasImageRefs = aliasTags.map((tag) => `${imageRepository}:${tag}`);\n\n return {\n imageName: image.imageName,\n imageRef,\n aliasImageRefs,\n buildContextPath: FrameworkDockerPublishService.asFrameworkRelativePath(\n resolvedFrameworkRoot,\n buildContract.contextPath,\n ),\n dockerfilePath: FrameworkDockerPublishService.asFrameworkRelativePath(\n resolvedFrameworkRoot,\n buildContract.dockerfilePath,\n ),\n commands: FrameworkDockerPublishService.buildCommandPreview(\n buildContract.contextPath,\n buildContract.dockerfilePath,\n imageRef,\n aliasImageRefs,\n { version: immutableTag, sourceUrl: frameworkConfig.publish.npm.repositoryUrl },\n ),\n };\n }),\n };\n\n if (dryRun || result.targets.length === 0) {\n return result;\n }\n\n FrameworkDockerPublishService.assertDockerReady();\n\n const secrets = FrameworkReleaseService.loadFrameworkDockerSecrets(resolvedFrameworkRoot);\n const publishToken = secrets?.publishToken ?? null;\n if (!publishToken) {\n throw new Error(\n `Docker publish requires docker.publishToken in ${FrameworkReleaseService.resolveFrameworkSecretsPath(resolvedFrameworkRoot)}.`,\n );\n }\n const publishUsername = secrets?.publishUsername ?? frameworkConfig.publish.docker.namespace;\n\n FrameworkDockerPublishService.runDockerLogin(\n frameworkConfig.publish.docker.registryHost,\n publishUsername,\n publishToken,\n );\n\n for (const target of result.targets) {\n const configuredTarget = selectedTargets.find((image) => image.imageName === target.imageName);\n if (!configuredTarget) {\n throw new Error(`Missing Docker target definition for \"${target.imageName}\".`);\n }\n const buildContract = FrameworkDockerPublishService.resolveBuildContract(\n resolvedFrameworkRoot,\n configuredTarget,\n );\n\n /*\n * ONE buildx invocation builds every platform in `FRAMEWORK_DOCKER_IMAGE_PLATFORMS` and\n * pushes them as a single manifest list under the immutable tag. A multi-platform result\n * cannot be `--load`ed into the local daemon (it is not one image), which is why this is\n * `--push` rather than the old build-then-push pair. No CLI lane builds into the local daemon\n * since #2988 removed `wildo local up --rebuild`, whose image no runtime ran; the registry host's\n * `--fromCheckout` builds there, on the host's own platform.\n *\n * The push carries the SLSA provenance and SBOM attestations (`FRAMEWORK_IMAGE_ATTESTATION_ARGS`)\n * in the same index, and the OCI labels name the release, the repository, the revision and the\n * build instant (`provenanceLabelArgs`).\n */\n FrameworkDockerPublishService.runDockerCommand('buildx build --push', [\n 'buildx',\n 'build',\n '--platform',\n FRAMEWORK_DOCKER_IMAGE_PLATFORMS.join(','),\n '-f',\n buildContract.dockerfilePath,\n '-t',\n target.imageRef,\n ...FrameworkDockerPublishService.provenanceLabelArgs(\n resolvedFrameworkRoot,\n dockerContextSourcePathspecs(resolvedFrameworkRoot, buildContract.contextPath, buildContract.dockerfilePath),\n { version: immutableTag, sourceUrl: frameworkConfig.publish.npm.repositoryUrl },\n ),\n ...FRAMEWORK_IMAGE_ATTESTATION_ARGS,\n '--push',\n buildContract.contextPath,\n ]);\n }\n\n /*\n * Aliases are repointed only after EVERY immutable push has succeeded.\n *\n * The previous shape moved each image's alias inside the per-image loop, so\n * a failure on image N left images 1..N-1 already advertising the new\n * release through `latest` while the release as a whole had not happened —\n * a partial release that looks complete to anyone pulling the alias. With\n * one image in the publish set that was unobservable; it returns the moment\n * a second image is re-added, which is exactly when nobody would be looking\n * for it.\n */\n for (const target of result.targets) {\n for (const aliasRef of target.aliasImageRefs) {\n // `imagetools create` repoints the alias at the whole MANIFEST LIST in the registry, its\n // attestation manifests included; a local `docker tag` + `push` would only ever carry the one\n // platform the daemon holds, and no attestation.\n FrameworkDockerPublishService.runDockerCommand('imagetools create alias', [\n 'buildx',\n 'imagetools',\n 'create',\n '-t',\n aliasRef,\n target.imageRef,\n ]);\n }\n }\n\n return result;\n }\n\n private static async loadFrameworkConfigOrThrow(frameworkRoot: string) {\n const frameworkConfig = await FrameworkReleaseService.loadFrameworkConfig(frameworkRoot);\n if (!frameworkConfig) {\n throw new Error(\n `Framework release config not found at ${FrameworkReleaseService.resolveFrameworkConfigPath(frameworkRoot)}`,\n );\n }\n return frameworkConfig;\n }\n\n private static resolveBuildContract(\n frameworkRoot: string,\n target: WildoFrameworkReleaseDockerImage,\n ): FrameworkDockerBuildContract {\n const buildDefinition = FRAMEWORK_DOCKER_IMAGE_BUILD_DEFINITIONS[target.imageName];\n if (!buildDefinition) {\n throw new Error(\n `Docker publish target \"${target.imageName}\" is not mapped to a framework Dockerfile yet.`,\n );\n }\n if (buildDefinition.role !== target.role || buildDefinition.variant !== target.variant) {\n throw new Error(\n `Docker publish target \"${target.imageName}\" must use ${buildDefinition.role}/${buildDefinition.variant}.`,\n );\n }\n\n const frameworkLayout = resolveFrameworkLayout(frameworkRoot);\n const contextPath = buildDefinition.resolveContextPath(frameworkLayout);\n const dockerfilePath = buildDefinition.resolveDockerfilePath(frameworkLayout);\n\n if (!existsSync(dockerfilePath)) {\n throw new Error(\n `Dockerfile for \"${target.imageName}\" not found at ${dockerfilePath}.`,\n );\n }\n\n return { contextPath, dockerfilePath };\n }\n\n /**\n * Both halves of the published image identity are locked, not just the\n * namespace. The registry host is the half that used to be implicit, and an\n * unlocked host is the more dangerous of the two: a wrong namespace fails\n * loudly on push permissions, while a wrong host can succeed and publish the\n * framework to a registry nobody is watching.\n */\n private static assertLockedDockerRegistryIdentity(registryHost: string, namespace: string): void {\n if (registryHost !== FRAMEWORK_RELEASE_DOCKER_REGISTRY_HOST) {\n throw new Error(\n `Docker publish currently supports only the locked registry host \"${FRAMEWORK_RELEASE_DOCKER_REGISTRY_HOST}\".`,\n );\n }\n if (namespace !== FRAMEWORK_RELEASE_DOCKER_NAMESPACE) {\n throw new Error(\n `Docker publish currently supports only the locked namespace \"${FRAMEWORK_RELEASE_DOCKER_NAMESPACE}\".`,\n );\n }\n }\n\n /**\n * The OCI labels stamped on every pushed image: the release it is (`identity.version`, the immutable\n * tag), the repository it comes from (`identity.sourceUrl`), the source revision and the build instant.\n *\n * Read back by `fwk publish all --skipDocker`, which resumes a release whose image is already pushed:\n * existence proves the tag is there, not that it was built from the source now being published, so the\n * resume prints what the image was built from and how many commits touched its inputs since. The\n * revision is HEAD, marked `-dirty` when the image's own inputs (`sourcePathspecs`) held uncommitted\n * edits or untracked files — the image then carries content no commit has. Edits elsewhere in the\n * shared tree do not mark it.\n *\n * The version is the immutable tag even when it is not a semver version (`test-<sha>` on a per-commit\n * channel): it is the one reference that always resolves to this image, so it is what the label names.\n */\n private static provenanceLabelArgs(\n frameworkRoot: string,\n sourcePathspecs: string[],\n identity: FrameworkImageIdentity,\n ): string[] {\n const labels = [\n '--label', `${FRAMEWORK_IMAGE_VERSION_LABEL}=${identity.version}`,\n '--label', `${FRAMEWORK_IMAGE_SOURCE_LABEL}=${identity.sourceUrl}`,\n '--label', `${FRAMEWORK_IMAGE_CREATED_LABEL}=${new Date().toISOString()}`,\n ];\n const head = spawnSync('git', ['rev-parse', 'HEAD'], { cwd: frameworkRoot, encoding: 'utf8' });\n if (head.status === 0 && head.stdout.trim()) {\n const status = spawnSync('git', ['status', '--porcelain', '--untracked-files=all', '--', ...sourcePathspecs], { cwd: frameworkRoot, encoding: 'utf8' });\n const dirty = status.status !== 0 || status.stdout.trim() !== '';\n labels.push('--label', `${FRAMEWORK_IMAGE_REVISION_LABEL}=${head.stdout.trim()}${dirty ? '-dirty' : ''}`);\n }\n return labels;\n }\n\n /**\n * The source pathspecs of a configured image, by name — what `fwk publish all --skipDocker` asks git\n * about. `null` for an image this lane has no build definition for.\n */\n static imageSourcePathspecs(frameworkRoot: string, imageName: string): string[] | null {\n const buildDefinition = FRAMEWORK_DOCKER_IMAGE_BUILD_DEFINITIONS[imageName];\n if (!buildDefinition) return null;\n const frameworkLayout = resolveFrameworkLayout(frameworkRoot);\n return dockerContextSourcePathspecs(\n frameworkRoot,\n buildDefinition.resolveContextPath(frameworkLayout),\n buildDefinition.resolveDockerfilePath(frameworkLayout),\n );\n }\n\n private static buildCommandPreview(\n contextPath: string,\n dockerfilePath: string,\n imageRef: string,\n aliasImageRefs: string[],\n identity: FrameworkImageIdentity,\n ): string[] {\n return [\n `docker buildx build --platform ${FRAMEWORK_DOCKER_IMAGE_PLATFORMS.join(',')} -f \"${dockerfilePath}\" -t \"${imageRef}\" --label ${FRAMEWORK_IMAGE_VERSION_LABEL}=${identity.version} --label ${FRAMEWORK_IMAGE_SOURCE_LABEL}=${identity.sourceUrl} --label ${FRAMEWORK_IMAGE_CREATED_LABEL}=<build instant> --label ${FRAMEWORK_IMAGE_REVISION_LABEL}=<HEAD>[-dirty] ${FRAMEWORK_IMAGE_ATTESTATION_ARGS.join(' ')} --push \"${contextPath}\"`,\n ...aliasImageRefs.map((aliasRef) => `docker buildx imagetools create -t \"${aliasRef}\" \"${imageRef}\"`),\n ];\n }\n\n private static asFrameworkRelativePath(frameworkRoot: string, absolutePath: string): string {\n return relative(frameworkRoot, absolutePath) || '.';\n }\n\n private static assertDockerReady(): void {\n const dockerState = DockerUtils.checkDockerRunning();\n if (!dockerState.available || !dockerState.running) {\n throw new Error(dockerState.error ?? 'Docker must be running to publish framework images.');\n }\n }\n\n /**\n * `docker login` with no host argument authenticates against Docker Hub, so\n * the registry host must be passed explicitly or the credential is sent to\n * the wrong registry and the later push fails as unauthenticated.\n */\n private static runDockerLogin(registryHost: string, username: string, publishToken: string): void {\n const loginResult = spawnSync(\n 'docker',\n ['login', registryHost, '--username', username, '--password-stdin'],\n {\n input: publishToken,\n encoding: 'utf8',\n stdio: ['pipe', 'inherit', 'inherit'],\n },\n );\n if (loginResult.status !== 0) {\n throw new Error(`Docker login failed for username \"${username}\" at ${registryHost}.`);\n }\n }\n\n private static runDockerCommand(label: string, args: string[]): void {\n const result = spawnSync('docker', args, {\n encoding: 'utf8',\n stdio: 'inherit',\n });\n if (result.status !== 0) {\n throw new Error(`Docker ${label} failed.`);\n }\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"framework-docker-publish.service.js","sourceRoot":"","sources":["../../../../src/services/framework/framework-docker-publish.service.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,eAAe,CAAC;AAC1C,OAAO,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,IAAI,CAAC;AAC9C,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,MAAM,CAAC;AACtC,OAAO,EACL,sBAAsB,EACtB,6BAA6B,EAC7B,gCAAgC,GAGjC,MAAM,+BAA+B,CAAC;AACvC,OAAO,EACL,kCAAkC,EAClC,sCAAsC,GACvC,MAAM,+BAA+B,CAAC;AACvC,OAAO,EAAE,uBAAuB,EAAE,MAAM,yDAAyD,CAAC;AAClG,OAAO,EAAE,WAAW,EAAE,MAAM,sDAAsD,CAAC;AAEnF,iIAAiI;AACjI,MAAM,CAAC,MAAM,8BAA8B,GAAG,mCAAmC,CAAC;AAClF,MAAM,CAAC,MAAM,6BAA6B,GAAG,kCAAkC,CAAC;AAChF;;;GAGG;AACH,MAAM,CAAC,MAAM,6BAA6B,GAAG,kCAAkC,CAAC;AAChF,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AAM;YAChB,KAAK,EAAE,CAAC,MAAM,EAAE,SAAS,EAAE,SAAS,CAAC;SACtC,CACF,CAAC;QACF,IAAI,WAAW,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;YAC7B,MAAM,IAAI,KAAK,CAAC,qCAAqC,QAAQ,QAAQ,YAAY,GAAG,CAAC,CAAC;QACxF,CAAC;IACH,CAAC;IAEO,MAAM,CAAC,gBAAgB,CAAC,KAAa,EAAE,IAAc;QAC3D,MAAM,MAAM,GAAG,SAAS,CAAC,QAAQ,EAAE,IAAI,EAAE;YACvC,QAAQ,EAAE,MAAM;YAChB,KAAK,EAAE,SAAS;SACjB,CAAC,CAAC;QACH,IAAI,MAAM,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;YACxB,MAAM,IAAI,KAAK,CAAC,UAAU,KAAK,UAAU,CAAC,CAAC;QAC7C,CAAC;IACH,CAAC;CACF","sourcesContent":["import { spawnSync } from 'child_process';\nimport { existsSync, readFileSync } from 'fs';\nimport { join, relative } from 'path';\nimport {\n resolveFrameworkLayout,\n WildoFrameworkDockerImageRole,\n WildoFrameworkDockerImageVariant,\n type FrameworkLayoutPaths,\n type WildoFrameworkReleaseDockerImage,\n} from '@wildo-ai/platform-config-lib';\nimport {\n FRAMEWORK_RELEASE_DOCKER_NAMESPACE,\n FRAMEWORK_RELEASE_DOCKER_REGISTRY_HOST,\n} from '@wildo-ai/platform-config-lib';\nimport { FrameworkReleaseService } from '~wildo-cli/services/framework/framework-release.service';\nimport { DockerUtils } from '~wildo-cli/services/deployment/docker/docker.service';\n\n/** OCI annotation keys (image-spec `annotations.md`, dead-plan-citation: the OCI spec's own file), used here as build labels. */\nexport const FRAMEWORK_IMAGE_REVISION_LABEL = 'org.opencontainers.image.revision';\nexport const FRAMEWORK_IMAGE_CREATED_LABEL = 'org.opencontainers.image.created';\n/**\n * The release the image IS: the immutable tag it is pushed under (the framework version, or a channel's\n * own identity such as `test-<sha>`), so an image pulled by an alias or by digest still names its release.\n */\nexport const FRAMEWORK_IMAGE_VERSION_LABEL = 'org.opencontainers.image.version';\n/** The repository the image is built from: the framework config's `publish.npm.repositoryUrl`. */\nexport const FRAMEWORK_IMAGE_SOURCE_LABEL = 'org.opencontainers.image.source';\n\n/**\n * The BuildKit attestations pushed beside every framework image, inside the same image index: SLSA\n * provenance in `max` mode (the full build definition: Dockerfile, build args, source materials) and an\n * SPDX SBOM of each platform's filesystem. Registries and scanners (Docker Scout, `docker buildx\n * imagetools inspect --format '{{json .Provenance}}'`/`'{{json .SBOM}}'`) read them from there, and\n * `imagetools create` carries them along when an alias is repointed at the index.\n */\nexport const FRAMEWORK_IMAGE_ATTESTATION_ARGS = ['--provenance=mode=max', '--sbom=true'] as const;\n\n/** What the identity labels say: the release and the repository it was built from. */\ninterface FrameworkImageIdentity {\n version: string;\n sourceUrl: string;\n}\n\n/** A `.dockerignore` pattern that names no wildcard — a plain path, rather than a glob pathspec. */\nfunction isPlainIgnorePath(pattern: string): boolean {\n return !/[*?[\\]]/.test(pattern);\n}\n\n/**\n * The git pathspecs covering what a Docker build SENDS from its context, derived from the ignore file\n * the build itself obeys: `<Dockerfile>.dockerignore` when present (BuildKit prefers it), else the\n * context's `.dockerignore`. What the image was built from is then asked of those paths only — whether\n * they were dirty at build time, and how many commits touched them since — instead of the whole\n * repository, which several sessions edit at once and would mark nearly every image dirty.\n *\n * - A deny-all file (`*` then `!path` re-includes) scopes to its re-includes — a plain one as a path, a\n * wildcard one as a `:(glob)` pathspec, since the build sends what it matches; otherwise the whole\n * context is in scope.\n * - Its `**\\/…` exclusions become git `:(exclude,glob)` pathspecs, as `…/**` so a directory pattern\n * excludes the files under it (a bare `**\\/__tests__` glob matches no file — measured). EXCEPT those\n * under `src/`: the image excludes TypeScript source only because it ships the `dist/` compiled from\n * it, and `dist/` is gitignored — so the source IS the tracked form of what the image carries.\n *\n * Paths are relative to the framework root, where git runs. Pure over the ignore file's text, so a\n * new re-include there widens the scope with no edit here.\n */\nexport function dockerContextSourcePathspecs(frameworkRoot: string, contextPath: string, dockerfilePath: string): string[] {\n const contextRelative = relative(frameworkRoot, contextPath) || '.';\n const ignorePath = [`${dockerfilePath}.dockerignore`, join(contextPath, '.dockerignore')].find((candidate) => existsSync(candidate));\n const lines = ignorePath === undefined ? [] : readFileSync(ignorePath, 'utf8').split('\\n')\n .map((line) => line.trim())\n .filter((line) => line.length > 0 && !line.startsWith('#'));\n const inContext = (path: string): string => (contextRelative === '.' ? path : `${contextRelative}/${path}`);\n const includes = lines.includes('*')\n ? lines\n .filter((line) => line.startsWith('!'))\n .map((line) => (isPlainIgnorePath(line.slice(1)) ? inContext(line.slice(1)) : `:(glob)${inContext(line.slice(1))}`))\n : [contextRelative];\n const excludes = lines\n .filter((line) => line.startsWith('**/') && !line.slice(3).startsWith('src/'))\n .flatMap((line) => [`:(exclude,glob)${line}`, `:(exclude,glob)${line}/**`]);\n return [...(includes.length > 0 ? includes : [contextRelative]), ...excludes];\n}\n\nexport interface FrameworkDockerPublishOptions {\n frameworkRoot?: string;\n targets?: string[];\n dryRun?: boolean;\n /**\n * The IMMUTABLE tag every selected image is published under. Defaults to the\n * framework version.\n *\n * A channel that publishes per-commit supplies its own identity here — e.g.\n * `test-<sha>` — because on that channel the commit, not the version, is what\n * makes the artifact unique. Two pushes of the same framework version from\n * different commits must not collide on one tag.\n */\n immutableTag?: string;\n /**\n * MUTABLE aliases repointed at the image after every immutable push has\n * succeeded — `latest`, `test`, `next`.\n *\n * Kept as one list rather than a boolean per alias: an alias is a pointer, and\n * the set of pointers a channel maintains is channel policy, not a fixed\n * vocabulary this service should enumerate.\n */\n aliasTags?: string[];\n}\n\nexport interface FrameworkDockerPublishTargetResult {\n imageName: string;\n imageRef: string;\n aliasImageRefs: string[];\n buildContextPath: string;\n dockerfilePath: string;\n commands: string[];\n}\n\nexport interface FrameworkDockerPublishResult {\n frameworkVersion: string;\n namespace: string;\n targets: FrameworkDockerPublishTargetResult[];\n}\n\ninterface FrameworkDockerBuildContract {\n contextPath: string;\n dockerfilePath: string;\n}\n\ninterface FrameworkDockerBuildDefinition {\n role: WildoFrameworkDockerImageRole;\n variant: WildoFrameworkDockerImageVariant;\n resolveContextPath: (layout: FrameworkLayoutPaths) => string;\n resolveDockerfilePath: (layout: FrameworkLayoutPaths) => string;\n}\n\nconst FRAMEWORK_DOCKER_IMAGE_BUILD_DEFINITIONS: Record<string, FrameworkDockerBuildDefinition> = {\n 'wildo-platform': {\n role: WildoFrameworkDockerImageRole.PLATFORM_SERVICE,\n variant: WildoFrameworkDockerImageVariant.DEFAULT,\n resolveContextPath: (layout) => layout.repositoryRoot,\n resolveDockerfilePath: (layout) => layout.platformBaseDockerfilePath,\n },\n 'wildo-backend-base': {\n role: WildoFrameworkDockerImageRole.APPLICATION_BACKEND,\n variant: WildoFrameworkDockerImageVariant.DEFAULT,\n resolveContextPath: (layout) => layout.repositoryRoot,\n resolveDockerfilePath: (layout) => layout.backendBaseDockerfilePath,\n },\n 'wildo-backend-base-java': {\n role: WildoFrameworkDockerImageRole.APPLICATION_BACKEND,\n variant: WildoFrameworkDockerImageVariant.JAVA,\n resolveContextPath: (layout) => layout.repositoryRoot,\n resolveDockerfilePath: (layout) => layout.backendJavaDockerfilePath,\n },\n};\n\n/**\n * Publishes the framework-owned Docker image contract declared in framework\n * config. Each publishable image must resolve to a truthful framework-owned\n * Dockerfile so the release lane stays explicit about what the framework ships.\n */\n/**\n * The platforms every published framework image is built for, as ONE multi-platform\n * manifest list under the immutable tag.\n *\n * Decided 2026-09-03 (Paul): the Apple-Silicon-versus-x86 split is handled by the\n * registry, never by an operator. A host pulls its native image from the same\n * `docker.io/wildoai/<image>:<version>` reference, so compose files and k8s manifests carry\n * no architecture knowledge. The previous lane built `linux/amd64` only, which put every\n * Apple Silicon developer under emulation and could never produce a native arm64 image.\n *\n * Native modules (argon2, sharp, canvas, esbuild) are installed INSIDE each platform's\n * builder stage, so the binaries match by construction — see `Dockerfile.platform-base`.\n * Building the non-native half runs under QEMU on a laptop; if that becomes too slow the\n * same command moves to a CI matrix with native runners, and this list does not change.\n */\nexport const FRAMEWORK_DOCKER_IMAGE_PLATFORMS = ['linux/amd64', 'linux/arm64'] as const;\n\nexport class FrameworkDockerPublishService {\n static async publishImages(\n options: FrameworkDockerPublishOptions = {},\n ): Promise<FrameworkDockerPublishResult> {\n const resolvedFrameworkRoot = options.frameworkRoot ?? FrameworkReleaseService.getFrameworkRoot();\n await FrameworkReleaseService.assertCliCompatibility(resolvedFrameworkRoot);\n const dryRun = options.dryRun === true;\n const aliasTags = (options.aliasTags ?? []).map((tag) => tag.trim()).filter((tag) => tag.length > 0);\n const frameworkConfig = await FrameworkDockerPublishService.loadFrameworkConfigOrThrow(\n resolvedFrameworkRoot,\n );\n const immutableTag = options.immutableTag?.trim() || frameworkConfig.frameworkVersion;\n const allTargets = frameworkConfig.publish.docker.images;\n const requestedTargets = new Set(options.targets ?? []);\n const selectedTargets = allTargets.filter(\n (image) => requestedTargets.size === 0 || requestedTargets.has(image.imageName),\n );\n\n FrameworkDockerPublishService.assertLockedDockerRegistryIdentity(\n frameworkConfig.publish.docker.registryHost,\n frameworkConfig.publish.docker.namespace,\n );\n\n if (requestedTargets.size > 0) {\n const missingTargets = [...requestedTargets].filter(\n (target) => !selectedTargets.some((image) => image.imageName === target),\n );\n if (missingTargets.length > 0) {\n throw new Error(`Unknown Docker publish target(s): ${missingTargets.join(', ')}.`);\n }\n }\n\n const result: FrameworkDockerPublishResult = {\n frameworkVersion: frameworkConfig.frameworkVersion,\n namespace: frameworkConfig.publish.docker.namespace,\n targets: selectedTargets.map((image) => {\n const buildContract = FrameworkDockerPublishService.resolveBuildContract(\n resolvedFrameworkRoot,\n image,\n );\n /**\n * Fully qualified, including the registry host. A bare\n * `<namespace>/<image>` reference resolves to Docker Hub by default, so\n * omitting the host would push these images somewhere other than the\n * registry the config declares — silently, and only discoverably by a\n * consumer failing to pull.\n */\n const imageRepository = `${frameworkConfig.publish.docker.registryHost}/${frameworkConfig.publish.docker.namespace}/${image.imageName}`;\n const imageRef = `${imageRepository}:${immutableTag}`;\n const aliasImageRefs = aliasTags.map((tag) => `${imageRepository}:${tag}`);\n\n return {\n imageName: image.imageName,\n imageRef,\n aliasImageRefs,\n buildContextPath: FrameworkDockerPublishService.asFrameworkRelativePath(\n resolvedFrameworkRoot,\n buildContract.contextPath,\n ),\n dockerfilePath: FrameworkDockerPublishService.asFrameworkRelativePath(\n resolvedFrameworkRoot,\n buildContract.dockerfilePath,\n ),\n commands: FrameworkDockerPublishService.buildCommandPreview(\n buildContract.contextPath,\n buildContract.dockerfilePath,\n imageRef,\n aliasImageRefs,\n { version: immutableTag, sourceUrl: frameworkConfig.publish.npm.repositoryUrl },\n ),\n };\n }),\n };\n\n if (dryRun || result.targets.length === 0) {\n return result;\n }\n\n FrameworkDockerPublishService.assertDockerReady();\n FrameworkDockerPublishService.loginWithFrameworkSecrets(resolvedFrameworkRoot, frameworkConfig.publish.docker);\n\n for (const target of result.targets) {\n const configuredTarget = selectedTargets.find((image) => image.imageName === target.imageName);\n if (!configuredTarget) {\n throw new Error(`Missing Docker target definition for \"${target.imageName}\".`);\n }\n const buildContract = FrameworkDockerPublishService.resolveBuildContract(\n resolvedFrameworkRoot,\n configuredTarget,\n );\n\n /*\n * ONE buildx invocation builds every platform in `FRAMEWORK_DOCKER_IMAGE_PLATFORMS` and\n * pushes them as a single manifest list under the immutable tag. A multi-platform result\n * cannot be `--load`ed into the local daemon (it is not one image), which is why this is\n * `--push` rather than the old build-then-push pair. No CLI lane builds into the local daemon\n * since #2988 removed `wildo local up --rebuild`, whose image no runtime ran; the registry host's\n * `--fromCheckout` builds there, on the host's own platform.\n *\n * The push carries the SLSA provenance and SBOM attestations (`FRAMEWORK_IMAGE_ATTESTATION_ARGS`)\n * in the same index, and the OCI labels name the release, the repository, the revision and the\n * build instant (`provenanceLabelArgs`).\n */\n FrameworkDockerPublishService.runDockerCommand('buildx build --push', [\n 'buildx',\n 'build',\n '--platform',\n FRAMEWORK_DOCKER_IMAGE_PLATFORMS.join(','),\n '-f',\n buildContract.dockerfilePath,\n '-t',\n target.imageRef,\n ...FrameworkDockerPublishService.provenanceLabelArgs(\n resolvedFrameworkRoot,\n dockerContextSourcePathspecs(resolvedFrameworkRoot, buildContract.contextPath, buildContract.dockerfilePath),\n { version: immutableTag, sourceUrl: frameworkConfig.publish.npm.repositoryUrl },\n ),\n ...FRAMEWORK_IMAGE_ATTESTATION_ARGS,\n '--push',\n buildContract.contextPath,\n ]);\n }\n\n /*\n * Aliases are repointed only after EVERY immutable push has succeeded.\n *\n * The previous shape moved each image's alias inside the per-image loop, so\n * a failure on image N left images 1..N-1 already advertising the new\n * release through `latest` while the release as a whole had not happened —\n * a partial release that looks complete to anyone pulling the alias. With\n * one image in the publish set that was unobservable; it returns the moment\n * a second image is re-added, which is exactly when nobody would be looking\n * for it.\n */\n for (const target of result.targets) {\n for (const aliasRef of target.aliasImageRefs) {\n // `imagetools create` repoints the alias at the whole MANIFEST LIST in the registry, its\n // attestation manifests included; a local `docker tag` + `push` would only ever carry the one\n // platform the daemon holds, and no attestation.\n FrameworkDockerPublishService.runDockerCommand('imagetools create alias', [\n 'buildx',\n 'imagetools',\n 'create',\n '-t',\n aliasRef,\n target.imageRef,\n ]);\n }\n }\n\n return result;\n }\n\n /**\n * Log the Docker CLI in to the framework's registry with `docker.publishToken` from the framework secrets file.\n *\n * Every step that WRITES to the registry calls it itself: the image push, and moving the `latest` alias\n * (`wildo fwk publish all` step 8). A resumed release (`--skipDocker`) skips the push, so an alias move that relied\n * on the push's login ran unauthenticated: on a developer machine an earlier `docker login` hid that, and on a fresh\n * CI runner Docker Hub answered 401 (framework-release run 43278280537, 2026-11-12, #3063).\n *\n * @param frameworkRoot the framework checkout whose secrets file and release config are read\n */\n static async loginToRegistry(frameworkRoot: string): Promise<void> {\n const frameworkConfig = await FrameworkDockerPublishService.loadFrameworkConfigOrThrow(frameworkRoot);\n FrameworkDockerPublishService.loginWithFrameworkSecrets(frameworkRoot, frameworkConfig.publish.docker);\n }\n\n /** The login itself; `docker` gives the registry host, and the namespace used as the username when the secrets name none. */\n private static loginWithFrameworkSecrets(frameworkRoot: string, docker: { registryHost: string; namespace: string }): void {\n const secrets = FrameworkReleaseService.loadFrameworkDockerSecrets(frameworkRoot);\n const publishToken = secrets?.publishToken ?? null;\n if (!publishToken) {\n throw new Error(`Docker publish requires docker.publishToken in ${FrameworkReleaseService.resolveFrameworkSecretsPath(frameworkRoot)}.`);\n }\n FrameworkDockerPublishService.runDockerLogin(docker.registryHost, secrets?.publishUsername ?? docker.namespace, publishToken);\n }\n\n private static async loadFrameworkConfigOrThrow(frameworkRoot: string) {\n const frameworkConfig = await FrameworkReleaseService.loadFrameworkConfig(frameworkRoot);\n if (!frameworkConfig) {\n throw new Error(\n `Framework release config not found at ${FrameworkReleaseService.resolveFrameworkConfigPath(frameworkRoot)}`,\n );\n }\n return frameworkConfig;\n }\n\n private static resolveBuildContract(\n frameworkRoot: string,\n target: WildoFrameworkReleaseDockerImage,\n ): FrameworkDockerBuildContract {\n const buildDefinition = FRAMEWORK_DOCKER_IMAGE_BUILD_DEFINITIONS[target.imageName];\n if (!buildDefinition) {\n throw new Error(\n `Docker publish target \"${target.imageName}\" is not mapped to a framework Dockerfile yet.`,\n );\n }\n if (buildDefinition.role !== target.role || buildDefinition.variant !== target.variant) {\n throw new Error(\n `Docker publish target \"${target.imageName}\" must use ${buildDefinition.role}/${buildDefinition.variant}.`,\n );\n }\n\n const frameworkLayout = resolveFrameworkLayout(frameworkRoot);\n const contextPath = buildDefinition.resolveContextPath(frameworkLayout);\n const dockerfilePath = buildDefinition.resolveDockerfilePath(frameworkLayout);\n\n if (!existsSync(dockerfilePath)) {\n throw new Error(\n `Dockerfile for \"${target.imageName}\" not found at ${dockerfilePath}.`,\n );\n }\n\n return { contextPath, dockerfilePath };\n }\n\n /**\n * Both halves of the published image identity are locked, not just the\n * namespace. The registry host is the half that used to be implicit, and an\n * unlocked host is the more dangerous of the two: a wrong namespace fails\n * loudly on push permissions, while a wrong host can succeed and publish the\n * framework to a registry nobody is watching.\n */\n private static assertLockedDockerRegistryIdentity(registryHost: string, namespace: string): void {\n if (registryHost !== FRAMEWORK_RELEASE_DOCKER_REGISTRY_HOST) {\n throw new Error(\n `Docker publish currently supports only the locked registry host \"${FRAMEWORK_RELEASE_DOCKER_REGISTRY_HOST}\".`,\n );\n }\n if (namespace !== FRAMEWORK_RELEASE_DOCKER_NAMESPACE) {\n throw new Error(\n `Docker publish currently supports only the locked namespace \"${FRAMEWORK_RELEASE_DOCKER_NAMESPACE}\".`,\n );\n }\n }\n\n /**\n * The OCI labels stamped on every pushed image: the release it is (`identity.version`, the immutable\n * tag), the repository it comes from (`identity.sourceUrl`), the source revision and the build instant.\n *\n * Read back by `fwk publish all --skipDocker`, which resumes a release whose image is already pushed:\n * existence proves the tag is there, not that it was built from the source now being published, so the\n * resume prints what the image was built from and how many commits touched its inputs since. The\n * revision is HEAD, marked `-dirty` when the image's own inputs (`sourcePathspecs`) held uncommitted\n * edits or untracked files — the image then carries content no commit has. Edits elsewhere in the\n * shared tree do not mark it.\n *\n * The version is the immutable tag even when it is not a semver version (`test-<sha>` on a per-commit\n * channel): it is the one reference that always resolves to this image, so it is what the label names.\n */\n private static provenanceLabelArgs(\n frameworkRoot: string,\n sourcePathspecs: string[],\n identity: FrameworkImageIdentity,\n ): string[] {\n const labels = [\n '--label', `${FRAMEWORK_IMAGE_VERSION_LABEL}=${identity.version}`,\n '--label', `${FRAMEWORK_IMAGE_SOURCE_LABEL}=${identity.sourceUrl}`,\n '--label', `${FRAMEWORK_IMAGE_CREATED_LABEL}=${new Date().toISOString()}`,\n ];\n const head = spawnSync('git', ['rev-parse', 'HEAD'], { cwd: frameworkRoot, encoding: 'utf8' });\n if (head.status === 0 && head.stdout.trim()) {\n const status = spawnSync('git', ['status', '--porcelain', '--untracked-files=all', '--', ...sourcePathspecs], { cwd: frameworkRoot, encoding: 'utf8' });\n const dirty = status.status !== 0 || status.stdout.trim() !== '';\n labels.push('--label', `${FRAMEWORK_IMAGE_REVISION_LABEL}=${head.stdout.trim()}${dirty ? '-dirty' : ''}`);\n }\n return labels;\n }\n\n /**\n * The source pathspecs of a configured image, by name — what `fwk publish all --skipDocker` asks git\n * about. `null` for an image this lane has no build definition for.\n */\n static imageSourcePathspecs(frameworkRoot: string, imageName: string): string[] | null {\n const buildDefinition = FRAMEWORK_DOCKER_IMAGE_BUILD_DEFINITIONS[imageName];\n if (!buildDefinition) return null;\n const frameworkLayout = resolveFrameworkLayout(frameworkRoot);\n return dockerContextSourcePathspecs(\n frameworkRoot,\n buildDefinition.resolveContextPath(frameworkLayout),\n buildDefinition.resolveDockerfilePath(frameworkLayout),\n );\n }\n\n private static buildCommandPreview(\n contextPath: string,\n dockerfilePath: string,\n imageRef: string,\n aliasImageRefs: string[],\n identity: FrameworkImageIdentity,\n ): string[] {\n return [\n `docker buildx build --platform ${FRAMEWORK_DOCKER_IMAGE_PLATFORMS.join(',')} -f \"${dockerfilePath}\" -t \"${imageRef}\" --label ${FRAMEWORK_IMAGE_VERSION_LABEL}=${identity.version} --label ${FRAMEWORK_IMAGE_SOURCE_LABEL}=${identity.sourceUrl} --label ${FRAMEWORK_IMAGE_CREATED_LABEL}=<build instant> --label ${FRAMEWORK_IMAGE_REVISION_LABEL}=<HEAD>[-dirty] ${FRAMEWORK_IMAGE_ATTESTATION_ARGS.join(' ')} --push \"${contextPath}\"`,\n ...aliasImageRefs.map((aliasRef) => `docker buildx imagetools create -t \"${aliasRef}\" \"${imageRef}\"`),\n ];\n }\n\n private static asFrameworkRelativePath(frameworkRoot: string, absolutePath: string): string {\n return relative(frameworkRoot, absolutePath) || '.';\n }\n\n private static assertDockerReady(): void {\n const dockerState = DockerUtils.checkDockerRunning();\n if (!dockerState.available || !dockerState.running) {\n throw new Error(dockerState.error ?? 'Docker must be running to publish framework images.');\n }\n }\n\n /**\n * `docker login` with no host argument authenticates against Docker Hub, so\n * the registry host must be passed explicitly or the credential is sent to\n * the wrong registry and the later push fails as unauthenticated.\n */\n private static runDockerLogin(registryHost: string, username: string, publishToken: string): void {\n const loginResult = spawnSync(\n 'docker',\n ['login', registryHost, '--username', username, '--password-stdin'],\n {\n input: publishToken,\n encoding: 'utf8',\n stdio: ['pipe', 'inherit', 'inherit'],\n },\n );\n if (loginResult.status !== 0) {\n throw new Error(`Docker login failed for username \"${username}\" at ${registryHost}.`);\n }\n }\n\n private static runDockerCommand(label: string, args: string[]): void {\n const result = spawnSync('docker', args, {\n encoding: 'utf8',\n stdio: 'inherit',\n });\n if (result.status !== 0) {\n throw new Error(`Docker ${label} failed.`);\n }\n }\n}\n"]}
|
|
@@ -65,13 +65,59 @@ export interface ProviderConnectScopePlan {
|
|
|
65
65
|
readonly refused: readonly ProviderConnectRefusedScope[];
|
|
66
66
|
/** Admitted scopes only an administrator can grant: never put on a person's consent. */
|
|
67
67
|
readonly administratorConsent: readonly string[];
|
|
68
|
+
/**
|
|
69
|
+
* Admitted scopes NOT put on the request because the provider's own scopes ask for static consent (a
|
|
70
|
+
* `<resource>/.default`, see {@link isProviderStaticConsentScope}): the consent then grants what the app registration
|
|
71
|
+
* lists, so each of these must be registered there (and granted by an administrator where the tenant requires it).
|
|
72
|
+
* Empty for a provider that asks for permissions one by one (Google).
|
|
73
|
+
*/
|
|
74
|
+
readonly staticConsentRegistrationScopes: readonly string[];
|
|
68
75
|
}
|
|
76
|
+
/**
|
|
77
|
+
* Whether `scope` is the Microsoft identity platform's STATIC consent scope for a resource: the resource's identifier
|
|
78
|
+
* URI, `/`, then `.default` (`https://graph.microsoft.com/.default`, a Dataverse `<environment-url>/.default`, an
|
|
79
|
+
* `api://…/.default`). Such a scope asks for no permission by name; it asks for every permission the app registration
|
|
80
|
+
* lists.
|
|
81
|
+
* spec-cite: https://learn.microsoft.com/en-us/entra/identity-platform/scopes-oidc — "The `.default` scope": "The scope
|
|
82
|
+
* parameter value is constructed by using the identifier URI for the resource and `.default`, separated by a forward
|
|
83
|
+
* slash (`/`)." Fetched 2026-11-11.
|
|
84
|
+
*/
|
|
85
|
+
export declare function isProviderStaticConsentScope(scope: string): boolean;
|
|
69
86
|
/**
|
|
70
87
|
* The scopes one consent asks for: the contract's `oauth2.scopes` UNION every scope the catalogue's operations need,
|
|
71
88
|
* so one consent covers every operation a probe calls. The additions go through the engine's connection ceiling
|
|
72
89
|
* (`computeProviderConnectionScopeCeiling`), the same admission a host applies to an augmentation's scopes: an addition
|
|
73
90
|
* must name a resource among the provider's declared audiences, so a module cannot widen a consent to a resource its
|
|
74
91
|
* base never declared.
|
|
92
|
+
*
|
|
93
|
+
* ## Static consent: the additions are REGISTERED, never requested
|
|
94
|
+
*
|
|
95
|
+
* When the provider's own scopes ask for static consent (Microsoft's `https://graph.microsoft.com/.default`), no admitted
|
|
96
|
+
* addition goes on the request; each is returned in `staticConsentRegistrationScopes`, for the person to list on the app
|
|
97
|
+
* registration before consenting. Microsoft refuses the mix outright (`AADSTS70011 … .default scope can't be combined
|
|
98
|
+
* with resource-specific scopes`, observed 2026-11-11 on `microsoft-outlook`):
|
|
99
|
+
* spec-cite: https://learn.microsoft.com/en-us/entra/identity-platform/scopes-oidc — "The `.default` scope": "Clients
|
|
100
|
+
* can't combine static (`.default`) consent and dynamic consent in a single request. So
|
|
101
|
+
* `scope=https://graph.microsoft.com/.default Mail.Read` results in an error because it combines scope types."; and
|
|
102
|
+
* "consent should be prompted for all required permissions listed in the application registration (for all APIs in the
|
|
103
|
+
* list)". Fetched 2026-11-11.
|
|
104
|
+
*
|
|
105
|
+
* This is what a running application does too. Its connect asks for the base's own scopes and nothing more (the ceiling
|
|
106
|
+
* is what a LATER re-authorization may ask for), and Microsoft's incremental consent asks for one missing scope beside
|
|
107
|
+
* the declared `restatedScopes`, never beside `.default` (`planProviderIncrementalAuthorization`). So a grant this
|
|
108
|
+
* command stores is the grant an application's connection holds: whatever the registration lists, consented through
|
|
109
|
+
* `.default`.
|
|
110
|
+
*
|
|
111
|
+
* The rule covers every addition, not only those naming the `.default`'s own resource. The sentence above forbids the
|
|
112
|
+
* mix in one request, whatever resource the dynamic scope names, and an application never puts a non-primary audience's
|
|
113
|
+
* scope on a person's consent either (`classifyProviderConnectionScopes` refuses it `NOT_PRIMARY_AUDIENCE`): static
|
|
114
|
+
* consent covers "all APIs in the list", so registering it is how such a scope is granted.
|
|
115
|
+
*
|
|
116
|
+
* Rejected: drop `.default` and request the operations' scopes by name (dynamic consent). The request would then be
|
|
117
|
+
* accepted, but the base and every application are built on static consent (the token for a second audience, such as a
|
|
118
|
+
* Dataverse environment, is minted from the same refresh token because the registration lists it), so the stored grant
|
|
119
|
+
* would hold a different consent from the one an application's connection holds, and a probe would prove a grant no
|
|
120
|
+
* application has.
|
|
75
121
|
*/
|
|
76
122
|
export declare function planProviderConnectScopes(engine: Pick<EngineOAuth2Exchange, 'computeProviderConnectionScopeCeiling' | 'resolveProviderOAuth2Scopes'>, input: {
|
|
77
123
|
readonly providerRef: string;
|
|
@@ -135,8 +181,18 @@ export interface ProviderOAuth2ConnectResult {
|
|
|
135
181
|
readonly storedNames: readonly string[];
|
|
136
182
|
readonly requestedScopes: readonly string[];
|
|
137
183
|
readonly grantedScopes: readonly string[];
|
|
138
|
-
/**
|
|
184
|
+
/**
|
|
185
|
+
* Requested and not reported as granted. A static-consent scope (`<resource>/.default`) is never counted: the vendor
|
|
186
|
+
* answers with the permissions it granted, never with `.default` itself.
|
|
187
|
+
*/
|
|
139
188
|
readonly missingScopes: readonly string[];
|
|
189
|
+
/** See {@link ProviderConnectScopePlan.staticConsentRegistrationScopes}: registered on the app, not on the request. */
|
|
190
|
+
readonly staticConsentRegistrationScopes: readonly string[];
|
|
191
|
+
/**
|
|
192
|
+
* Of {@link staticConsentRegistrationScopes}, those the vendor did not report as granted, compared as exact strings,
|
|
193
|
+
* as an application's per-operation scope check compares an operation's `requiredScopes` with a stored grant (#979).
|
|
194
|
+
*/
|
|
195
|
+
readonly staticConsentScopesNotGranted: readonly string[];
|
|
140
196
|
readonly accountRef?: string;
|
|
141
197
|
readonly accessTokenExpiresAt?: string;
|
|
142
198
|
readonly refreshable: boolean;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"provider-connect.service.d.ts","sourceRoot":"","sources":["../../../../src/services/registry/provider-connect.service.ts"],"names":[],"mappings":"AA4CA,OAAO,EAAgC,KAAK,kBAAkB,EAAE,MAAM,sCAAsC,CAAC;AAE7G,OAAO,KAAK,KAAK,cAAc,MAAM,4BAA4B,CAAC;AAOlE,OAAO,EASL,KAAK,cAAc,EACnB,KAAK,yBAAyB,EAC9B,KAAK,kBAAkB,EACvB,KAAK,kBAAkB,EACvB,KAAK,mBAAmB,EACzB,MAAM,qDAAqD,CAAC;AAC7D,OAAO,EAEL,4BAA4B,EAE5B,KAAK,4BAA4B,EAClC,MAAM,iEAAiE,CAAC;AAEzE,2FAA2F;AAC3F,eAAO,MAAM,uBAAuB,uBAAuB,CAAC;AAE5D;;;GAGG;AACH,wBAAgB,wBAAwB,CAAC,KAAK,EAAE;IAC9C,QAAQ,CAAC,aAAa,EAAE,MAAM,GAAG,SAAS,CAAC;IAC3C,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,QAAQ,CAAC,EAAE,MAAM,CAAC;IAC3B,QAAQ,CAAC,GAAG,CAAC,EAAE,MAAM,CAAC;CACvB,GAAG,MAAM,GAAG,SAAS,CAOrB;AAED,0GAA0G;AAC1G,eAAO,MAAM,6BAA6B,QAAQ,CAAC;AACnD,8EAA8E;AAC9E,eAAO,MAAM,8BAA8B,cAAc,CAAC;AAC1D,wEAAwE;AACxE,eAAO,MAAM,mCAAmC,QAAgB,CAAC;AAIjE,uHAAuH;AACvH,oBAAY,2BAA2B;IACrC,SAAS,cAAc;IACvB,aAAa,cAAc;CAC5B;AAED,uFAAuF;AACvF,MAAM,WAAW,sBAAsB;IACrC,iEAAiE;IACjE,OAAO,CAAC,OAAO,EAAE,MAAM,EAAE,YAAY,CAAC,EAAE,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OAAO,EAAE,SAAS,2BAA2B,EAAE,CAAC;IACzD,wFAAwF;IACxF,QAAQ,CAAC,oBAAoB,EAAE,SAAS,MAAM,EAAE,CAAC;
|
|
1
|
+
{"version":3,"file":"provider-connect.service.d.ts","sourceRoot":"","sources":["../../../../src/services/registry/provider-connect.service.ts"],"names":[],"mappings":"AA4CA,OAAO,EAAgC,KAAK,kBAAkB,EAAE,MAAM,sCAAsC,CAAC;AAE7G,OAAO,KAAK,KAAK,cAAc,MAAM,4BAA4B,CAAC;AAOlE,OAAO,EASL,KAAK,cAAc,EACnB,KAAK,yBAAyB,EAC9B,KAAK,kBAAkB,EACvB,KAAK,kBAAkB,EACvB,KAAK,mBAAmB,EACzB,MAAM,qDAAqD,CAAC;AAC7D,OAAO,EAEL,4BAA4B,EAE5B,KAAK,4BAA4B,EAClC,MAAM,iEAAiE,CAAC;AAEzE,2FAA2F;AAC3F,eAAO,MAAM,uBAAuB,uBAAuB,CAAC;AAE5D;;;GAGG;AACH,wBAAgB,wBAAwB,CAAC,KAAK,EAAE;IAC9C,QAAQ,CAAC,aAAa,EAAE,MAAM,GAAG,SAAS,CAAC;IAC3C,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,QAAQ,CAAC,EAAE,MAAM,CAAC;IAC3B,QAAQ,CAAC,GAAG,CAAC,EAAE,MAAM,CAAC;CACvB,GAAG,MAAM,GAAG,SAAS,CAOrB;AAED,0GAA0G;AAC1G,eAAO,MAAM,6BAA6B,QAAQ,CAAC;AACnD,8EAA8E;AAC9E,eAAO,MAAM,8BAA8B,cAAc,CAAC;AAC1D,wEAAwE;AACxE,eAAO,MAAM,mCAAmC,QAAgB,CAAC;AAIjE,uHAAuH;AACvH,oBAAY,2BAA2B;IACrC,SAAS,cAAc;IACvB,aAAa,cAAc;CAC5B;AAED,uFAAuF;AACvF,MAAM,WAAW,sBAAsB;IACrC,iEAAiE;IACjE,OAAO,CAAC,OAAO,EAAE,MAAM,EAAE,YA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
|
94
94
|
return { probed, contract, operationRequiredScopes: [...scopes].sort() };
|
|
95
95
|
}
|
|
96
|
+
/**
|
|
97
|
+
* Whether `scope` is the Microsoft identity platform's STATIC consent scope for a resource: the resource's identifier
|
|
98
|
+
* URI, `/`, then `.default` (`https://graph.microsoft.com/.default`, a Dataverse `<environment-url>/.default`, an
|
|
99
|
+
* `api://…/.default`). Such a scope asks for no permission by name; it asks for every permission the app registration
|
|
100
|
+
* lists.
|
|
101
|
+
* spec-cite: https://learn.microsoft.com/en-us/entra/identity-platform/scopes-oidc — "The `.default` scope": "The scope
|
|
102
|
+
* parameter value is constructed by using the identifier URI for the resource and `.default`, separated by a forward
|
|
103
|
+
* slash (`/`)." Fetched 2026-11-11.
|
|
104
|
+
*/
|
|
105
|
+
export function isProviderStaticConsentScope(scope) {
|
|
106
|
+
return scope.length > '/.default'.length && scope.endsWith('/.default');
|
|
107
|
+
}
|
|
108
|
+
/**
|
|
109
|
+
* The OpenID Connect scope that asks for a refresh token (OpenID Connect Core 1.0, section 11, "Offline Access"). Its
|
|
110
|
+
* grant is the refresh token itself, and a vendor need not list it among the granted scopes: Microsoft's token answer
|
|
111
|
+
* omitted it on 2026-11-11 while issuing a refresh token. So it counts as granted whenever a refresh token arrived, and
|
|
112
|
+
* as missing when none did, which is the case the warning exists for.
|
|
113
|
+
*/
|
|
114
|
+
const OPENID_OFFLINE_ACCESS_SCOPE = 'offline_access';
|
|
96
115
|
/**
|
|
97
116
|
* The scopes one consent asks for: the contract's `oauth2.scopes` UNION every scope the catalogue's operations need,
|
|
98
117
|
* so one consent covers every operation a probe calls. The additions go through the engine's connection ceiling
|
|
99
118
|
* (`computeProviderConnectionScopeCeiling`), the same admission a host applies to an augmentation's scopes: an addition
|
|
100
119
|
* must name a resource among the provider's declared audiences, so a module cannot widen a consent to a resource its
|
|
101
120
|
* base never declared.
|
|
121
|
+
*
|
|
122
|
+
* ## Static consent: the additions are REGISTERED, never requested
|
|
123
|
+
*
|
|
124
|
+
* When the provider's own scopes ask for static consent (Microsoft's `https://graph.microsoft.com/.default`), no admitted
|
|
125
|
+
* addition goes on the request; each is returned in `staticConsentRegistrationScopes`, for the person to list on the app
|
|
126
|
+
* registration before consenting. Microsoft refuses the mix outright (`AADSTS70011 … .default scope can't be combined
|
|
127
|
+
* with resource-specific scopes`, observed 2026-11-11 on `microsoft-outlook`):
|
|
128
|
+
* spec-cite: https://learn.microsoft.com/en-us/entra/identity-platform/scopes-oidc — "The `.default` scope": "Clients
|
|
129
|
+
* can't combine static (`.default`) consent and dynamic consent in a single request. So
|
|
130
|
+
* `scope=https://graph.microsoft.com/.default Mail.Read` results in an error because it combines scope types."; and
|
|
131
|
+
* "consent should be prompted for all required permissions listed in the application registration (for all APIs in the
|
|
132
|
+
* list)". Fetched 2026-11-11.
|
|
133
|
+
*
|
|
134
|
+
* This is what a running application does too. Its connect asks for the base's own scopes and nothing more (the ceiling
|
|
135
|
+
* is what a LATER re-authorization may ask for), and Microsoft's incremental consent asks for one missing scope beside
|
|
136
|
+
* the declared `restatedScopes`, never beside `.default` (`planProviderIncrementalAuthorization`). So a grant this
|
|
137
|
+
* command stores is the grant an application's connection holds: whatever the registration lists, consented through
|
|
138
|
+
* `.default`.
|
|
139
|
+
*
|
|
140
|
+
* The rule covers every addition, not only those naming the `.default`'s own resource. The sentence above forbids the
|
|
141
|
+
* mix in one request, whatever resource the dynamic scope names, and an application never puts a non-primary audience's
|
|
142
|
+
* scope on a person's consent either (`classifyProviderConnectionScopes` refuses it `NOT_PRIMARY_AUDIENCE`): static
|
|
143
|
+
* consent covers "all APIs in the list", so registering it is how such a scope is granted.
|
|
144
|
+
*
|
|
145
|
+
* Rejected: drop `.default` and request the operations' scopes by name (dynamic consent). The request would then be
|
|
146
|
+
* accepted, but the base and every application are built on static consent (the token for a second audience, such as a
|
|
147
|
+
* Dataverse environment, is minted from the same refresh token because the registration lists it), so the stored grant
|
|
148
|
+
* would hold a different consent from the one an application's connection holds, and a probe would prove a grant no
|
|
149
|
+
* application has.
|
|
102
150
|
*/
|
|
103
151
|
export function planProviderConnectScopes(engine, input) {
|
|
104
152
|
const owner = engine.resolveProviderOAuth2Scopes({
|
|
@@ -113,12 +161,16 @@ export function planProviderConnectScopes(engine, input) {
|
|
|
113
161
|
sources: [{ providerRef: input.providerRef, scopes: input.operationRequiredScopes }],
|
|
114
162
|
});
|
|
115
163
|
const ownerTokens = new Set(owner.flatMap((scope) => scope.split(/\s+/)).filter((token) => token.length > 0));
|
|
116
|
-
const
|
|
164
|
+
const admitted = ceiling.admittedAdditionalScopes.filter((scope) => !ownerTokens.has(scope));
|
|
165
|
+
// Static consent: the additions are registered on the app, never put beside `.default` (see the JSDoc above).
|
|
166
|
+
const staticConsent = [...ownerTokens].some(isProviderStaticConsentScope);
|
|
167
|
+
const additions = staticConsent ? [] : admitted;
|
|
117
168
|
return {
|
|
118
169
|
scopes: [...owner, ...additions],
|
|
119
170
|
additionallyAdmittedScopes: additions,
|
|
120
171
|
refused: ceiling.refusedScopes.map((entry) => ({ scope: entry.scope, refusal: String(entry.refusal) })),
|
|
121
172
|
administratorConsent: input.operationRequiredScopes.filter((scope) => ceiling.administratorConsentScopes.includes(scope) && !ownerTokens.has(scope)),
|
|
173
|
+
staticConsentRegistrationScopes: staticConsent ? admitted : [],
|
|
122
174
|
};
|
|
123
175
|
}
|
|
124
176
|
/** The deployment-side answers the engine's OAuth2 functions read, from the environment first, then the store. */
|
|
@@ -369,6 +421,11 @@ export async function connectProviderOAuth2(input) {
|
|
|
369
421
|
input.report(`Not asked for: ${refused.scope} (${refused.refusal}); an operation needing it will be refused.`);
|
|
370
422
|
for (const scope of plan.administratorConsent)
|
|
371
423
|
input.report(`Not asked for: ${scope} (only an administrator grants it).`);
|
|
424
|
+
if (plan.staticConsentRegistrationScopes.length > 0) {
|
|
425
|
+
input.report(`Not asked for by name, because the consent asks for static consent (.default), which grants what the app registration lists: `
|
|
426
|
+
+ `register these delegated permissions on the app registration, and grant admin consent where the tenant requires it `
|
|
427
|
+
+ `(${plan.staticConsentRegistrationScopes.length}): ${plan.staticConsentRegistrationScopes.join(' ')}`);
|
|
428
|
+
}
|
|
372
429
|
await prompts.proceed('Press Enter when the redirect URI and the scopes are registered, to open the consent');
|
|
373
430
|
input.report(`Opening the consent (if no browser opens, visit it yourself): ${authorizeUrl}`);
|
|
374
431
|
input.openAuthorizeUrl(authorizeUrl);
|
|
@@ -433,7 +490,11 @@ export async function connectProviderOAuth2(input) {
|
|
|
433
490
|
storedNames: [...Object.keys(values), ...(answer.grant.refreshToken === undefined ? [] : ['oauth2.refreshToken'])],
|
|
434
491
|
requestedScopes,
|
|
435
492
|
grantedScopes,
|
|
436
|
-
missingScopes: requestedScopes.flatMap((scope) => scope.split(/\s+/))
|
|
493
|
+
missingScopes: requestedScopes.flatMap((scope) => scope.split(/\s+/))
|
|
494
|
+
.filter((scope) => scope.length > 0 && !isProviderStaticConsentScope(scope) && !granted.has(scope))
|
|
495
|
+
.filter((scope) => !(scope === OPENID_OFFLINE_ACCESS_SCOPE && answer.grant.refreshToken !== undefined)),
|
|
496
|
+
staticConsentRegistrationScopes: plan.staticConsentRegistrationScopes,
|
|
497
|
+
staticConsentScopesNotGranted: plan.staticConsentRegistrationScopes.filter((scope) => !granted.has(scope)),
|
|
437
498
|
...(answer.grant.accountRef === undefined ? {} : { accountRef: answer.grant.accountRef }),
|
|
438
499
|
...(answer.grant.expiresAt === undefined ? {} : { accessTokenExpiresAt: answer.grant.expiresAt }),
|
|
439
500
|
refreshable: answer.grant.refreshToken !== undefined,
|