Skip to content

Commit 03e4545

Browse files
feat: define new security mechanism (#316)
1 parent b3a5c8e commit 03e4545

File tree

7 files changed

+37
-25
lines changed

7 files changed

+37
-25
lines changed

definitions/3.0.0/SecurityRequirement.json

Lines changed: 0 additions & 12 deletions
This file was deleted.

definitions/3.0.0/oauth2Flow.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
"type": "string",
1414
"format": "uri"
1515
},
16-
"scopes": {
16+
"availableScopes": {
1717
"$ref": "http://asyncapi.com/definitions/3.0.0/oauth2Scopes.json"
1818
}
1919
},

definitions/3.0.0/oauth2Flows.json

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
{
2626
"required": [
2727
"authorizationUrl",
28-
"scopes"
28+
"availableScopes"
2929
]
3030
},
3131
{
@@ -45,7 +45,7 @@
4545
{
4646
"required": [
4747
"tokenUrl",
48-
"scopes"
48+
"availableScopes"
4949
]
5050
},
5151
{
@@ -65,7 +65,7 @@
6565
{
6666
"required": [
6767
"tokenUrl",
68-
"scopes"
68+
"availableScopes"
6969
]
7070
},
7171
{
@@ -86,13 +86,20 @@
8686
"required": [
8787
"authorizationUrl",
8888
"tokenUrl",
89-
"scopes"
89+
"availableScopes"
9090
]
9191
}
9292
]
9393
}
9494
},
9595
"additionalProperties": false
96+
},
97+
"scopes": {
98+
"type": "array",
99+
"description": "List of the needed scope names.",
100+
"items": {
101+
"type": "string"
102+
}
96103
}
97104
},
98105
"patternProperties": {

definitions/3.0.0/openIdConnect.json

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,13 @@
1717
"openIdConnectUrl": {
1818
"type": "string",
1919
"format": "uri"
20+
},
21+
"scopes": {
22+
"type": "array",
23+
"description": "List of the needed scope names.",
24+
"items": {
25+
"type": "string"
26+
}
2027
}
2128
},
2229
"patternProperties": {

definitions/3.0.0/operation.json

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -64,10 +64,7 @@
6464
"description": "A longer description of the operation. CommonMark is allowed."
6565
},
6666
"security": {
67-
"type": "array",
68-
"items": {
69-
"$ref": "http://asyncapi.com/definitions/3.0.0/SecurityRequirement.json"
70-
}
67+
"$ref": "http://asyncapi.com/definitions/3.0.0/securityRequirements.json"
7168
},
7269
"tags": {
7370
"type": "array",
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
{
2+
"description": "An array representing security requirements.",
3+
"type": "array",
4+
"items": {
5+
"oneOf": [
6+
{
7+
"$ref": "http://asyncapi.com/definitions/3.0.0/Reference.json"
8+
},
9+
{
10+
"$ref": "http://asyncapi.com/definitions/3.0.0/SecurityScheme.json"
11+
}
12+
]
13+
},
14+
"$schema": "http://json-schema.org/draft-07/schema#",
15+
"$id": "http://asyncapi.com/definitions/3.0.0/securityRequirements.json"
16+
}

definitions/3.0.0/server.json

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -38,10 +38,7 @@
3838
"$ref": "http://asyncapi.com/definitions/3.0.0/serverVariables.json"
3939
},
4040
"security": {
41-
"type": "array",
42-
"items": {
43-
"$ref": "http://asyncapi.com/definitions/3.0.0/SecurityRequirement.json"
44-
}
41+
"$ref": "http://asyncapi.com/definitions/3.0.0/securityRequirements.json"
4542
},
4643
"bindings": {
4744
"$ref": "http://asyncapi.com/definitions/3.0.0/serverBindingsObject.json"

0 commit comments

Comments
 (0)