Skip to content

Commit fdc3360

Browse files
Merge pull request #1075 from dagoroz/master
Onboarding authorization for autogeneration
2 parents 91952bf + 25ff278 commit fdc3360

File tree

11 files changed

+831
-38
lines changed

11 files changed

+831
-38
lines changed

generator/autogenlist.ts

Lines changed: 42 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ const autogenlist: AutogenlistConfig[] = [
1414
basePath: 'adhybridhealthservice/resource-manager',
1515
namespace: 'Microsoft.ADHybridHealthService',
1616
},
17-
{
17+
{
1818
basePath: 'cdn/resource-manager',
1919
namespace: 'Microsoft.Cdn',
2020
},
@@ -50,6 +50,20 @@ const autogenlist: AutogenlistConfig[] = [
5050
basePath: 'attestation/resource-manager',
5151
namespace: 'Microsoft.Attestation',
5252
},
53+
{
54+
basePath: 'authorization/resource-manager',
55+
namespace: 'Microsoft.Authorization',
56+
resourceConfig: [
57+
{
58+
type: 'roleAssignments',
59+
scopes: ScopeType.Tenant | ScopeType.Subcription | ScopeType.ResourceGroup | ScopeType.ManagementGroup,
60+
},
61+
{
62+
type: 'roleDefinitions',
63+
scopes: ScopeType.Tenant | ScopeType.Subcription | ScopeType.ResourceGroup | ScopeType.ManagementGroup,
64+
},
65+
]
66+
},
5367
{
5468
basePath: 'automation/resource-manager',
5569
namespace: 'Microsoft.Automation',
@@ -62,11 +76,11 @@ const autogenlist: AutogenlistConfig[] = [
6276
basePath: 'azurestack/resource-manager',
6377
namespace: 'Microsoft.AzureStack',
6478
},
65-
{
79+
{
6680
basePath: 'batch/resource-manager',
6781
namespace: 'Microsoft.Batch',
6882
},
69-
{
83+
{
7084
basePath: 'batchai/resource-manager',
7185
namespace: 'Microsoft.BatchAI',
7286
},
@@ -142,7 +156,7 @@ const autogenlist: AutogenlistConfig[] = [
142156
basePath: 'databox/resource-manager',
143157
namespace: 'Microsoft.DataBox',
144158
},
145-
{
159+
{
146160
basePath: 'operationalinsights/resource-manager',
147161
namespace: 'Microsoft.OperationalInsights',
148162
},
@@ -205,14 +219,14 @@ const autogenlist: AutogenlistConfig[] = [
205219
namespace: 'Microsoft.DesktopVirtualization',
206220
},
207221
{
208-
basePath: 'digitaltwins/resource-manager',
209-
namespace: 'Microsoft.DigitalTwins',
210-
resourceConfig: [
211-
{
212-
type: 'integrationResources',
213-
scopes: ScopeType.Extension,
214-
}
215-
]
222+
basePath: 'digitaltwins/resource-manager',
223+
namespace: 'Microsoft.DigitalTwins',
224+
resourceConfig: [
225+
{
226+
type: 'integrationResources',
227+
scopes: ScopeType.Extension,
228+
}
229+
]
216230
},
217231
{
218232
basePath: 'deviceprovisioningservices/resource-manager',
@@ -239,7 +253,7 @@ const autogenlist: AutogenlistConfig[] = [
239253
basePath: 'resourcegraph/resource-manager',
240254
namespace: 'Microsoft.ResourceGraph',
241255
},
242-
{
256+
{
243257
basePath: 'redis/resource-manager',
244258
namespace: 'Microsoft.Cache',
245259
},
@@ -252,14 +266,14 @@ const autogenlist: AutogenlistConfig[] = [
252266
namespace: 'Microsoft.HDInsight',
253267
},
254268
{
255-
        basePath: 'resourcehealth/resource-manager',
256-
        namespace: 'Microsoft.ResourceHealth',
257-
    },
269+
basePath: 'resourcehealth/resource-manager',
270+
namespace: 'Microsoft.ResourceHealth',
271+
},
258272
{
259273
basePath: 'EnterpriseKnowledgeGraph/resource-manager',
260274
namespace: 'Microsoft.EnterpriseKnowledgeGraph',
261275
},
262-
{
276+
{
263277
basePath: 'domainservices/resource-manager',
264278
namespace: 'Microsoft.AAD',
265279
},
@@ -312,7 +326,7 @@ const autogenlist: AutogenlistConfig[] = [
312326
basePath: 'labservices/resource-manager',
313327
namespace: 'Microsoft.LabServices',
314328
},
315-
{
329+
{
316330
basePath: 'eventgrid/resource-manager',
317331
namespace: 'Microsoft.EventGrid',
318332
resourceConfig: [
@@ -394,8 +408,8 @@ const autogenlist: AutogenlistConfig[] = [
394408
namespace: 'Microsoft.NetApp',
395409
},
396410
{
397-
basePath: 'notificationhubs/resource-manager',
398-
namespace: 'Microsoft.NotificationHubs'
411+
basePath: 'notificationhubs/resource-manager',
412+
namespace: 'Microsoft.NotificationHubs'
399413
},
400414
{
401415
basePath: 'policyinsights/resource-manager',
@@ -503,10 +517,10 @@ const autogenlist: AutogenlistConfig[] = [
503517
namespace: 'Microsoft.ImportExport'
504518
},
505519
{
506-
        basePath: 'storSimple1200Series/resource-manager',
507-
        namespace: 'Microsoft.StorSimple',
520+
basePath: 'storSimple1200Series/resource-manager',
521+
namespace: 'Microsoft.StorSimple',
508522
suffix: '1200'
509-
    },
523+
},
510524
{
511525
basePath: 'storage/resource-manager',
512526
namespace: 'Microsoft.Storage',
@@ -520,28 +534,28 @@ const autogenlist: AutogenlistConfig[] = [
520534
basePath: 'visualstudio/resource-manager',
521535
namespace: 'Microsoft.VisualStudio',
522536
},
523-
{
537+
{
524538
basePath: 'sql/resource-manager',
525539
namespace: 'Microsoft.Sql',
526540
},
527-
{
541+
{
528542
basePath: 'scheduler/resource-manager',
529543
namespace: 'Microsoft.Scheduler',
530544
},
531545
{
532546
basePath: 'search/resource-manager',
533547
namespace: 'Microsoft.Search',
534548
},
535-
{
549+
{
536550
basePath: 'subscription/resource-manager',
537551
namespace: 'Microsoft.Subscription',
538552
},
539-
{
553+
{
540554
basePath: 'storsimple8000series/resource-manager',
541555
namespace: 'Microsoft.StorSimple',
542556
suffix: '8000',
543557
},
544-
{
558+
{
545559
basePath: 'support/resource-manager',
546560
namespace: 'Microsoft.Support',
547561
},
Lines changed: 187 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,187 @@
1+
{
2+
"id": "https://schema.management.azure.com/schemas/2015-07-01/Microsoft.Authorization.json#",
3+
"$schema": "http://json-schema.org/draft-04/schema#",
4+
"title": "Microsoft.Authorization",
5+
"description": "Microsoft Authorization Resource Types",
6+
"resourceDefinitions": {},
7+
"unknown_resourceDefinitions": {
8+
"roleAssignments": {
9+
"type": "object",
10+
"properties": {
11+
"apiVersion": {
12+
"type": "string",
13+
"enum": [
14+
"2015-07-01"
15+
]
16+
},
17+
"name": {
18+
"type": "string",
19+
"description": "The name of the role assignment to create. It can be any valid GUID."
20+
},
21+
"properties": {
22+
"oneOf": [
23+
{
24+
"$ref": "#/definitions/RoleAssignmentProperties"
25+
},
26+
{
27+
"$ref": "https://schema.management.azure.com/schemas/common/definitions.json#/definitions/expression"
28+
}
29+
],
30+
"description": "Role assignment properties."
31+
},
32+
"type": {
33+
"type": "string",
34+
"enum": [
35+
"Microsoft.Authorization/roleAssignments"
36+
]
37+
}
38+
},
39+
"required": [
40+
"apiVersion",
41+
"name",
42+
"properties",
43+
"type"
44+
],
45+
"description": "Microsoft.Authorization/roleAssignments"
46+
},
47+
"roleDefinitions": {
48+
"type": "object",
49+
"properties": {
50+
"apiVersion": {
51+
"type": "string",
52+
"enum": [
53+
"2015-07-01"
54+
]
55+
},
56+
"name": {
57+
"type": "string",
58+
"description": "The ID of the role definition."
59+
},
60+
"properties": {
61+
"oneOf": [
62+
{
63+
"$ref": "#/definitions/RoleDefinitionProperties"
64+
},
65+
{
66+
"$ref": "https://schema.management.azure.com/schemas/common/definitions.json#/definitions/expression"
67+
}
68+
],
69+
"description": "Role definition properties."
70+
},
71+
"type": {
72+
"type": "string",
73+
"enum": [
74+
"Microsoft.Authorization/roleDefinitions"
75+
]
76+
}
77+
},
78+
"required": [
79+
"apiVersion",
80+
"name",
81+
"properties",
82+
"type"
83+
],
84+
"description": "Microsoft.Authorization/roleDefinitions"
85+
}
86+
},
87+
"definitions": {
88+
"Permission": {
89+
"type": "object",
90+
"properties": {
91+
"actions": {
92+
"oneOf": [
93+
{
94+
"type": "array",
95+
"items": {
96+
"type": "string"
97+
}
98+
},
99+
{
100+
"$ref": "https://schema.management.azure.com/schemas/common/definitions.json#/definitions/expression"
101+
}
102+
],
103+
"description": "Allowed actions."
104+
},
105+
"notActions": {
106+
"oneOf": [
107+
{
108+
"type": "array",
109+
"items": {
110+
"type": "string"
111+
}
112+
},
113+
{
114+
"$ref": "https://schema.management.azure.com/schemas/common/definitions.json#/definitions/expression"
115+
}
116+
],
117+
"description": "Denied actions."
118+
}
119+
},
120+
"description": "Role definition permissions."
121+
},
122+
"RoleAssignmentProperties": {
123+
"type": "object",
124+
"properties": {
125+
"principalId": {
126+
"type": "string",
127+
"description": "The principal ID assigned to the role. This maps to the ID inside the Active Directory. It can point to a user, service principal, or security group."
128+
},
129+
"roleDefinitionId": {
130+
"type": "string",
131+
"description": "The role definition ID used in the role assignment."
132+
}
133+
},
134+
"required": [
135+
"principalId",
136+
"roleDefinitionId"
137+
],
138+
"description": "Role assignment properties."
139+
},
140+
"RoleDefinitionProperties": {
141+
"type": "object",
142+
"properties": {
143+
"assignableScopes": {
144+
"oneOf": [
145+
{
146+
"type": "array",
147+
"items": {
148+
"type": "string"
149+
}
150+
},
151+
{
152+
"$ref": "https://schema.management.azure.com/schemas/common/definitions.json#/definitions/expression"
153+
}
154+
],
155+
"description": "Role definition assignable scopes."
156+
},
157+
"description": {
158+
"type": "string",
159+
"description": "The role definition description."
160+
},
161+
"permissions": {
162+
"oneOf": [
163+
{
164+
"type": "array",
165+
"items": {
166+
"$ref": "#/definitions/Permission"
167+
}
168+
},
169+
{
170+
"$ref": "https://schema.management.azure.com/schemas/common/definitions.json#/definitions/expression"
171+
}
172+
],
173+
"description": "Role definition permissions."
174+
},
175+
"roleName": {
176+
"type": "string",
177+
"description": "The role name."
178+
},
179+
"type": {
180+
"type": "string",
181+
"description": "The role type."
182+
}
183+
},
184+
"description": "Role definition properties."
185+
}
186+
}
187+
}

0 commit comments

Comments
 (0)