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

Feature: Define security in autorest #4018

Merged
merged 25 commits into from
Apr 21, 2021
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
Prev Previous commit
Next Next commit
update
  • Loading branch information
timotheeguerin committed Apr 6, 2021
commit b5950b43bb258f1a33e39d5506c8a449ddaf5e89
24 changes: 13 additions & 11 deletions packages/libs/codemodel/.resources/all-in-one/json/code-model.json
Original file line number Diff line number Diff line change
Expand Up @@ -2211,15 +2211,6 @@
"properties": {
"type": {
"type": "string"
},
"scopes": {
"type": "array",
"items": {
"type": "string"
}
},
"headerName": {
"type": "string"
}
},
"defaultProperties": [],
Expand All @@ -2230,7 +2221,14 @@
},
"AADTokenSecurityScheme": {
"type": "object",
"properties": {},
"properties": {
"scopes": {
"type": "array",
"items": {
"type": "string"
}
}
},
"defaultProperties": [],
"additionalProperties": false,
"required": [
Expand All @@ -2245,7 +2243,11 @@
},
"AzureKeySecurityScheme": {
"type": "object",
"properties": {},
"properties": {
"headerName": {
"type": "string"
}
},
"defaultProperties": [],
"additionalProperties": false,
"required": [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,11 @@ definitions:
additionalProperties: false
allOf:
- $ref: '#/definitions/SecurityScheme'
properties:
scopes:
type: array
items:
type: string
required:
- scopes
- type
Expand Down Expand Up @@ -160,6 +165,9 @@ definitions:
additionalProperties: false
allOf:
- $ref: '#/definitions/SecurityScheme'
properties:
headerName:
type: string
required:
- headerName
- type
Expand Down Expand Up @@ -1886,12 +1894,6 @@ definitions:
properties:
type:
type: string
headerName:
type: string
scopes:
type: array
items:
type: string
required:
- type
SecurityType:
Expand Down
9 changes: 0 additions & 9 deletions packages/libs/codemodel/.resources/model/json/http.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,6 @@
"properties": {
"type": {
"type": "string"
},
"scopes": {
"type": "array",
"items": {
"type": "string"
}
},
"headerName": {
"type": "string"
}
},
"defaultProperties": [],
Expand Down
15 changes: 13 additions & 2 deletions packages/libs/codemodel/.resources/model/json/master.json
Original file line number Diff line number Diff line change
Expand Up @@ -931,7 +931,14 @@
},
"AADTokenSecurityScheme": {
"type": "object",
"properties": {},
"properties": {
"scopes": {
"type": "array",
"items": {
"type": "string"
}
}
},
"defaultProperties": [],
"additionalProperties": false,
"required": [
Expand All @@ -946,7 +953,11 @@
},
"AzureKeySecurityScheme": {
"type": "object",
"properties": {},
"properties": {
"headerName": {
"type": "string"
}
},
"defaultProperties": [],
"additionalProperties": false,
"required": [
Expand Down
6 changes: 0 additions & 6 deletions packages/libs/codemodel/.resources/model/yaml/http.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -447,11 +447,5 @@ definitions:
properties:
type:
type: string
headerName:
type: string
scopes:
type: array
items:
type: string
required:
- type
8 changes: 8 additions & 0 deletions packages/libs/codemodel/.resources/model/yaml/master.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,11 @@ definitions:
additionalProperties: false
allOf:
- $ref: ./http.yaml#/definitions/SecurityScheme
properties:
scopes:
type: array
items:
type: string
required:
- scopes
- type
Expand Down Expand Up @@ -47,6 +52,9 @@ definitions:
additionalProperties: false
allOf:
- $ref: ./http.yaml#/definitions/SecurityScheme
properties:
headerName:
type: string
required:
- headerName
- type
Expand Down
2 changes: 0 additions & 2 deletions packages/libs/codemodel/src/model/common/security.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,6 @@ export class Security extends Initializer implements Security {

export interface SecurityScheme {
type: string;
scopes?: string[];
headerName?: string;
}

export interface AADTokenSecurityScheme extends SecurityScheme {
Expand Down