Skip to content

Commit

Permalink
fix(rulesets): add scopes to required in oauth2 security schemes (#2035)
Browse files Browse the repository at this point in the history
* fix(rulesets): add scopes to required in oauth2 security schemes

* style(rulesets): run prettier

* chore(repo): lint schemas using prettier

Co-authored-by: Jakub Rożek <jakub@stoplight.io>
  • Loading branch information
mkistler and P0lip committed Feb 1, 2022
1 parent 869510f commit 7090de0
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 8 deletions.
5 changes: 4 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
"lint": "yarn lint.prettier && yarn lint.eslint",
"lint.fix": "yarn lint.prettier --write && yarn lint.eslint --fix",
"lint.eslint": "eslint --cache --cache-location .cache/.eslintcache --ext=.js,.mjs,.ts packages test-harness",
"lint.prettier": "prettier --ignore-path .eslintignore --ignore-unknown --check packages/core/src/meta/*.json packages/*/CHANGELOG.md docs/**/*.md README.md",
"lint.prettier": "prettier --ignore-path .eslintignore --ignore-unknown --check packages/core/src/meta/*.json packages/rulesets/src/{asyncapi,oas}/schemas/*.json packages/*/CHANGELOG.md docs/**/*.md README.md",
"pretest": "yarn workspace @stoplight/spectral-ruleset-migrator pretest",
"test": "yarn pretest && yarn test.karma && yarn test.jest",
"test.harness": "jest -c ./test-harness/jest.config.js",
Expand Down Expand Up @@ -111,6 +111,9 @@
],
"packages/core/src/meta/*.json": [
"prettier --ignore-path .eslintignore --write"
],
"packages/rulesets/src/{asyncapi,oas}/schemas/*.json": [
"prettier --ignore-path .eslintignore --write"
]
},
"packageManager": "yarn@3.1.0"
Expand Down
8 changes: 4 additions & 4 deletions packages/rulesets/src/oas/schemas/2.0.json
Original file line number Diff line number Diff line change
Expand Up @@ -1253,7 +1253,7 @@
"oauth2ImplicitSecurity": {
"type": "object",
"additionalProperties": false,
"required": ["type", "flow", "authorizationUrl"],
"required": ["type", "flow", "authorizationUrl", "scopes"],
"properties": {
"type": {
"type": "string",
Expand Down Expand Up @@ -1283,7 +1283,7 @@
"oauth2PasswordSecurity": {
"type": "object",
"additionalProperties": false,
"required": ["type", "flow", "tokenUrl"],
"required": ["type", "flow", "tokenUrl", "scopes"],
"properties": {
"type": {
"type": "string",
Expand Down Expand Up @@ -1313,7 +1313,7 @@
"oauth2ApplicationSecurity": {
"type": "object",
"additionalProperties": false,
"required": ["type", "flow", "tokenUrl"],
"required": ["type", "flow", "tokenUrl", "scopes"],
"properties": {
"type": {
"type": "string",
Expand Down Expand Up @@ -1343,7 +1343,7 @@
"oauth2AccessCodeSecurity": {
"type": "object",
"additionalProperties": false,
"required": ["type", "flow", "authorizationUrl", "tokenUrl"],
"required": ["type", "flow", "authorizationUrl", "tokenUrl", "scopes"],
"properties": {
"type": {
"type": "string",
Expand Down
6 changes: 3 additions & 3 deletions packages/rulesets/src/oas/schemas/3.0.json
Original file line number Diff line number Diff line change
Expand Up @@ -1335,7 +1335,7 @@
},
"PasswordOAuthFlow": {
"type": "object",
"required": ["tokenUrl"],
"required": ["tokenUrl", "scopes"],
"properties": {
"tokenUrl": {
"type": "string",
Expand All @@ -1359,7 +1359,7 @@
},
"ClientCredentialsFlow": {
"type": "object",
"required": ["tokenUrl"],
"required": ["tokenUrl", "scopes"],
"properties": {
"tokenUrl": {
"type": "string",
Expand All @@ -1383,7 +1383,7 @@
},
"AuthorizationCodeOAuthFlow": {
"type": "object",
"required": ["authorizationUrl", "tokenUrl"],
"required": ["authorizationUrl", "tokenUrl", "scopes"],
"properties": {
"authorizationUrl": {
"type": "string",
Expand Down

0 comments on commit 7090de0

Please sign in to comment.