From 8b072f446da46573f0a1bdf0b2ce9b1c7209fd54 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 6 Feb 2024 18:45:56 +0000 Subject: [PATCH] Bump core from `1d6d1ce` to `8ed1d82` (#225) Bumps [core](https://github.com/microsoft/typespec) from `1d6d1ce` to `8ed1d82`.
Commits

Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting `@dependabot rebase`. [//]: # (dependabot-automerge-start) [//]: # (dependabot-automerge-end) ---
Dependabot commands and options
You can trigger Dependabot actions by commenting on this PR: - `@dependabot rebase` will rebase this PR - `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it - `@dependabot merge` will merge this PR after your CI passes on it - `@dependabot squash and merge` will squash and merge this PR after your CI passes on it - `@dependabot cancel merge` will cancel a previously requested merge and block automerging - `@dependabot reopen` will reopen this PR if it is closed - `@dependabot close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually - `@dependabot show ignore conditions` will show all of the ignore conditions of the specified dependency - `@dependabot ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
--------- Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Timothee Guerin --- .changeset/sour-brooms-mix.md | 5 +++++ core | 2 +- package.json | 2 +- packages/typespec-autorest/src/lib.ts | 6 ++++++ packages/typespec-autorest/src/openapi.ts | 11 +++++++++-- 5 files changed, 22 insertions(+), 4 deletions(-) create mode 100644 .changeset/sour-brooms-mix.md diff --git a/.changeset/sour-brooms-mix.md b/.changeset/sour-brooms-mix.md new file mode 100644 index 0000000000..6c20620422 --- /dev/null +++ b/.changeset/sour-brooms-mix.md @@ -0,0 +1,5 @@ +--- +"@azure-tools/typespec-autorest": patch +--- + +Emit warning if using opendIdConnect http auth scheme diff --git a/core b/core index 1d6d1ce739..8ed1d82e7c 160000 --- a/core +++ b/core @@ -1 +1 @@ -Subproject commit 1d6d1ce739d87a4411b3136b2beb67132bcb821d +Subproject commit 8ed1d82e7ccb0a8b72ae902149b86d68ac684872 diff --git a/package.json b/package.json index 297781d978..b6cbf63933 100644 --- a/package.json +++ b/package.json @@ -4,7 +4,7 @@ "private": true, "packageManager": "pnpm@8.13.1", "scripts": { - "run-all": "pnpm -r --filter='!./core'", + "run-all": "pnpm -r --filter=!./core/", "build": "pnpm run-all --workspace-concurrency=Infinity --aggregate-output --reporter=append-only build ", "check-format": "pnpm run prettier --check", "check-version-mismatch": "syncpack list-mismatches", diff --git a/packages/typespec-autorest/src/lib.ts b/packages/typespec-autorest/src/lib.ts index d4a63b446e..92c647287d 100644 --- a/packages/typespec-autorest/src/lib.ts +++ b/packages/typespec-autorest/src/lib.ts @@ -316,6 +316,12 @@ const libDef = { default: paramMessage`'${"schema"}' format '${"format"}' is not supported in Autorest. It will not be emitted.`, }, }, + "unsupported-auth": { + severity: "warning", + messages: { + default: paramMessage`Authentication "${"authType"}" is not a known authentication by the openapi3 emitter, it will be ignored.`, + }, + }, }, emitter: { options: EmitterOptionsSchema as JSONSchemaType, diff --git a/packages/typespec-autorest/src/openapi.ts b/packages/typespec-autorest/src/openapi.ts index f148cb986a..0a57f14d74 100644 --- a/packages/typespec-autorest/src/openapi.ts +++ b/packages/typespec-autorest/src/openapi.ts @@ -282,6 +282,7 @@ function createOAPIEmitter( }, }; let root: OpenAPI2Document; + let currentService: Service; let currentEndpoint: OpenAPI2Operation; let currentConsumes: Set; let currentProduces: Set; @@ -327,6 +328,7 @@ function createOAPIEmitter( services.push({ type: program.getGlobalNamespaceType() }); } for (const service of services) { + currentService = service; const originalProgram = program; const versions = buildVersionProjections(program, service.type).filter( (v) => !options.version || options.version === v.version @@ -2228,9 +2230,14 @@ function createOAPIEmitter( } as any, flow.scopes.map((x) => x.value), ]; + case "openIdConnect": default: - const _assertNever: never = auth; - compilerAssert(false, "Unreachable"); + reportDiagnostic(program, { + code: "unsupported-auth", + format: { authType: (auth as any).type }, + target: currentService.type, + }); + return undefined; } }