Skip to content

Commit

Permalink
feat: define new security mechanism (#316)
Browse files Browse the repository at this point in the history
  • Loading branch information
magicmatatjahu authored Feb 7, 2023
1 parent b3a5c8e commit 03e4545
Show file tree
Hide file tree
Showing 7 changed files with 37 additions and 25 deletions.
12 changes: 0 additions & 12 deletions definitions/3.0.0/SecurityRequirement.json

This file was deleted.

2 changes: 1 addition & 1 deletion definitions/3.0.0/oauth2Flow.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"type": "string",
"format": "uri"
},
"scopes": {
"availableScopes": {
"$ref": "http://asyncapi.com/definitions/3.0.0/oauth2Scopes.json"
}
},
Expand Down
15 changes: 11 additions & 4 deletions definitions/3.0.0/oauth2Flows.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
{
"required": [
"authorizationUrl",
"scopes"
"availableScopes"
]
},
{
Expand All @@ -45,7 +45,7 @@
{
"required": [
"tokenUrl",
"scopes"
"availableScopes"
]
},
{
Expand All @@ -65,7 +65,7 @@
{
"required": [
"tokenUrl",
"scopes"
"availableScopes"
]
},
{
Expand All @@ -86,13 +86,20 @@
"required": [
"authorizationUrl",
"tokenUrl",
"scopes"
"availableScopes"
]
}
]
}
},
"additionalProperties": false
},
"scopes": {
"type": "array",
"description": "List of the needed scope names.",
"items": {
"type": "string"
}
}
},
"patternProperties": {
Expand Down
7 changes: 7 additions & 0 deletions definitions/3.0.0/openIdConnect.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,13 @@
"openIdConnectUrl": {
"type": "string",
"format": "uri"
},
"scopes": {
"type": "array",
"description": "List of the needed scope names.",
"items": {
"type": "string"
}
}
},
"patternProperties": {
Expand Down
5 changes: 1 addition & 4 deletions definitions/3.0.0/operation.json
Original file line number Diff line number Diff line change
Expand Up @@ -64,10 +64,7 @@
"description": "A longer description of the operation. CommonMark is allowed."
},
"security": {
"type": "array",
"items": {
"$ref": "http://asyncapi.com/definitions/3.0.0/SecurityRequirement.json"
}
"$ref": "http://asyncapi.com/definitions/3.0.0/securityRequirements.json"
},
"tags": {
"type": "array",
Expand Down
16 changes: 16 additions & 0 deletions definitions/3.0.0/securityRequirements.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{
"description": "An array representing security requirements.",
"type": "array",
"items": {
"oneOf": [
{
"$ref": "http://asyncapi.com/definitions/3.0.0/Reference.json"
},
{
"$ref": "http://asyncapi.com/definitions/3.0.0/SecurityScheme.json"
}
]
},
"$schema": "http://json-schema.org/draft-07/schema#",
"$id": "http://asyncapi.com/definitions/3.0.0/securityRequirements.json"
}
5 changes: 1 addition & 4 deletions definitions/3.0.0/server.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,7 @@
"$ref": "http://asyncapi.com/definitions/3.0.0/serverVariables.json"
},
"security": {
"type": "array",
"items": {
"$ref": "http://asyncapi.com/definitions/3.0.0/SecurityRequirement.json"
}
"$ref": "http://asyncapi.com/definitions/3.0.0/securityRequirements.json"
},
"bindings": {
"$ref": "http://asyncapi.com/definitions/3.0.0/serverBindingsObject.json"
Expand Down

0 comments on commit 03e4545

Please sign in to comment.