Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix: Only act as a warning if using AND security schemes #4110

Merged
merged 2 commits into from
May 4, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view

This file was deleted.

2 changes: 1 addition & 1 deletion packages/apps/autorest/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
"typings": "./dist/exports.d.ts",
"devDependencies": {
"@autorest/configuration": "~1.3.0",
"@autorest/core": "~3.4.0",
"@autorest/core": "~3.4.1",
"@azure-tools/async-io": "~3.0.0",
"@azure-tools/extension": "~3.2.6",
"@azure-tools/tasks": "~3.0.0",
Expand Down
12 changes: 12 additions & 0 deletions packages/extensions/core/CHANGELOG.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,18 @@
{
"name": "@autorest/core",
"entries": [
{
"version": "3.4.1",
"tag": "@autorest/core_v3.4.1",
"date": "Tue, 04 May 2021 18:18:45 GMT",
"comments": {
"patch": [
{
"comment": "**Fix** Uncaught promise exception"
}
]
}
},
{
"version": "3.4.0",
"tag": "@autorest/core_v3.4.0",
Expand Down
9 changes: 8 additions & 1 deletion packages/extensions/core/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,13 @@
# Change Log - @autorest/core

This log was last generated on Tue, 27 Apr 2021 17:48:43 GMT and should not be manually modified.
This log was last generated on Tue, 04 May 2021 18:18:45 GMT and should not be manually modified.

## 3.4.1
Tue, 04 May 2021 18:18:45 GMT

### Patches

- **Fix** Uncaught promise exception

## 3.4.0
Tue, 27 Apr 2021 17:48:43 GMT
Expand Down
2 changes: 1 addition & 1 deletion packages/extensions/core/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@autorest/core",
"version": "3.4.0",
"version": "3.4.1",
"description": "AutoRest core module",
"engines": {
"node": ">=10.13.0"
Expand Down
12 changes: 12 additions & 0 deletions packages/extensions/modelerfour/CHANGELOG.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,18 @@
{
"name": "@autorest/modelerfour",
"entries": [
{
"version": "4.19.1",
"tag": "@autorest/modelerfour_v4.19.1",
"date": "Tue, 04 May 2021 18:18:45 GMT",
"comments": {
"patch": [
{
"comment": "**Fix** Using multiple security layers(`AND`) now produce warning instead of error."
}
]
}
},
{
"version": "4.19.0",
"tag": "@autorest/modelerfour_v4.19.0",
Expand Down
9 changes: 8 additions & 1 deletion packages/extensions/modelerfour/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,13 @@
# Change Log - @autorest/modelerfour

This log was last generated on Tue, 27 Apr 2021 17:48:43 GMT and should not be manually modified.
This log was last generated on Tue, 04 May 2021 18:18:45 GMT and should not be manually modified.

## 4.19.1
Tue, 04 May 2021 18:18:45 GMT

### Patches

- **Fix** Using multiple security layers(`AND`) now produce warning instead of error.

## 4.19.0
Tue, 27 Apr 2021 17:48:43 GMT
Expand Down
2 changes: 1 addition & 1 deletion packages/extensions/modelerfour/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@autorest/modelerfour",
"version": "4.19.0",
"version": "4.19.1",
"description": "AutoRest Modeler Version Four (component)",
"directories": {
"doc": "docs"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ export class SecurityProcessor {
for (const oai3SecurityRequirement of security) {
const names = Object.keys(oai3SecurityRequirement);
if (names.length > 1) {
throw new Error(
this.session.warning(
[
`Security defines multiple requirements at the same time which is not supported(${names.join(",")}).`,
`Did you meant to have multiple authentication options instead? Define each option seperately in your spec:`,
Expand All @@ -120,8 +120,11 @@ export class SecurityProcessor {
2,
),
].join("\n"),
["MultipleSecurityLayerUnsupported"],
);
continue;
}

if (names.length === 0) {
throw new Error(`Invalid empty security requirement`);
}
Expand Down
2 changes: 1 addition & 1 deletion packages/testing/test-public-packages/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
},
"homepage": "https://github.com/Azure/autorest#readme",
"dependencies": {
"@autorest/core": "~3.4.0",
"@autorest/core": "~3.4.1",
"autorest": "~3.2.0",
"source-map-support": "^0.5.19"
},
Expand Down