Skip to content

Commit

Permalink
Merge pull request #1075 from dagoroz/master
Browse files Browse the repository at this point in the history
Onboarding authorization for autogeneration
  • Loading branch information
anthony-c-martin authored Nov 5, 2020
2 parents 91952bf + 25ff278 commit fdc3360
Show file tree
Hide file tree
Showing 11 changed files with 831 additions and 38 deletions.
70 changes: 42 additions & 28 deletions generator/autogenlist.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ const autogenlist: AutogenlistConfig[] = [
basePath: 'adhybridhealthservice/resource-manager',
namespace: 'Microsoft.ADHybridHealthService',
},
{
{
basePath: 'cdn/resource-manager',
namespace: 'Microsoft.Cdn',
},
Expand Down Expand Up @@ -50,6 +50,20 @@ const autogenlist: AutogenlistConfig[] = [
basePath: 'attestation/resource-manager',
namespace: 'Microsoft.Attestation',
},
{
basePath: 'authorization/resource-manager',
namespace: 'Microsoft.Authorization',
resourceConfig: [
{
type: 'roleAssignments',
scopes: ScopeType.Tenant | ScopeType.Subcription | ScopeType.ResourceGroup | ScopeType.ManagementGroup,
},
{
type: 'roleDefinitions',
scopes: ScopeType.Tenant | ScopeType.Subcription | ScopeType.ResourceGroup | ScopeType.ManagementGroup,
},
]
},
{
basePath: 'automation/resource-manager',
namespace: 'Microsoft.Automation',
Expand All @@ -62,11 +76,11 @@ const autogenlist: AutogenlistConfig[] = [
basePath: 'azurestack/resource-manager',
namespace: 'Microsoft.AzureStack',
},
{
{
basePath: 'batch/resource-manager',
namespace: 'Microsoft.Batch',
},
{
{
basePath: 'batchai/resource-manager',
namespace: 'Microsoft.BatchAI',
},
Expand Down Expand Up @@ -142,7 +156,7 @@ const autogenlist: AutogenlistConfig[] = [
basePath: 'databox/resource-manager',
namespace: 'Microsoft.DataBox',
},
{
{
basePath: 'operationalinsights/resource-manager',
namespace: 'Microsoft.OperationalInsights',
},
Expand Down Expand Up @@ -205,14 +219,14 @@ const autogenlist: AutogenlistConfig[] = [
namespace: 'Microsoft.DesktopVirtualization',
},
{
basePath: 'digitaltwins/resource-manager',
namespace: 'Microsoft.DigitalTwins',
resourceConfig: [
{
type: 'integrationResources',
scopes: ScopeType.Extension,
}
]
basePath: 'digitaltwins/resource-manager',
namespace: 'Microsoft.DigitalTwins',
resourceConfig: [
{
type: 'integrationResources',
scopes: ScopeType.Extension,
}
]
},
{
basePath: 'deviceprovisioningservices/resource-manager',
Expand All @@ -239,7 +253,7 @@ const autogenlist: AutogenlistConfig[] = [
basePath: 'resourcegraph/resource-manager',
namespace: 'Microsoft.ResourceGraph',
},
{
{
basePath: 'redis/resource-manager',
namespace: 'Microsoft.Cache',
},
Expand All @@ -252,14 +266,14 @@ const autogenlist: AutogenlistConfig[] = [
namespace: 'Microsoft.HDInsight',
},
{
        basePath: 'resourcehealth/resource-manager',
        namespace: 'Microsoft.ResourceHealth',
    },
basePath: 'resourcehealth/resource-manager',
namespace: 'Microsoft.ResourceHealth',
},
{
basePath: 'EnterpriseKnowledgeGraph/resource-manager',
namespace: 'Microsoft.EnterpriseKnowledgeGraph',
},
{
{
basePath: 'domainservices/resource-manager',
namespace: 'Microsoft.AAD',
},
Expand Down Expand Up @@ -312,7 +326,7 @@ const autogenlist: AutogenlistConfig[] = [
basePath: 'labservices/resource-manager',
namespace: 'Microsoft.LabServices',
},
{
{
basePath: 'eventgrid/resource-manager',
namespace: 'Microsoft.EventGrid',
resourceConfig: [
Expand Down Expand Up @@ -394,8 +408,8 @@ const autogenlist: AutogenlistConfig[] = [
namespace: 'Microsoft.NetApp',
},
{
basePath: 'notificationhubs/resource-manager',
namespace: 'Microsoft.NotificationHubs'
basePath: 'notificationhubs/resource-manager',
namespace: 'Microsoft.NotificationHubs'
},
{
basePath: 'policyinsights/resource-manager',
Expand Down Expand Up @@ -503,10 +517,10 @@ const autogenlist: AutogenlistConfig[] = [
namespace: 'Microsoft.ImportExport'
},
{
        basePath: 'storSimple1200Series/resource-manager',
        namespace: 'Microsoft.StorSimple',
basePath: 'storSimple1200Series/resource-manager',
namespace: 'Microsoft.StorSimple',
suffix: '1200'
    },
},
{
basePath: 'storage/resource-manager',
namespace: 'Microsoft.Storage',
Expand All @@ -520,28 +534,28 @@ const autogenlist: AutogenlistConfig[] = [
basePath: 'visualstudio/resource-manager',
namespace: 'Microsoft.VisualStudio',
},
{
{
basePath: 'sql/resource-manager',
namespace: 'Microsoft.Sql',
},
{
{
basePath: 'scheduler/resource-manager',
namespace: 'Microsoft.Scheduler',
},
{
basePath: 'search/resource-manager',
namespace: 'Microsoft.Search',
},
{
{
basePath: 'subscription/resource-manager',
namespace: 'Microsoft.Subscription',
},
{
{
basePath: 'storsimple8000series/resource-manager',
namespace: 'Microsoft.StorSimple',
suffix: '8000',
},
{
{
basePath: 'support/resource-manager',
namespace: 'Microsoft.Support',
},
Expand Down
187 changes: 187 additions & 0 deletions schemas/2015-07-01/Microsoft.Authorization.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,187 @@
{
"id": "https://schema.management.azure.com/schemas/2015-07-01/Microsoft.Authorization.json#",
"$schema": "http://json-schema.org/draft-04/schema#",
"title": "Microsoft.Authorization",
"description": "Microsoft Authorization Resource Types",
"resourceDefinitions": {},
"unknown_resourceDefinitions": {
"roleAssignments": {
"type": "object",
"properties": {
"apiVersion": {
"type": "string",
"enum": [
"2015-07-01"
]
},
"name": {
"type": "string",
"description": "The name of the role assignment to create. It can be any valid GUID."
},
"properties": {
"oneOf": [
{
"$ref": "#/definitions/RoleAssignmentProperties"
},
{
"$ref": "https://schema.management.azure.com/schemas/common/definitions.json#/definitions/expression"
}
],
"description": "Role assignment properties."
},
"type": {
"type": "string",
"enum": [
"Microsoft.Authorization/roleAssignments"
]
}
},
"required": [
"apiVersion",
"name",
"properties",
"type"
],
"description": "Microsoft.Authorization/roleAssignments"
},
"roleDefinitions": {
"type": "object",
"properties": {
"apiVersion": {
"type": "string",
"enum": [
"2015-07-01"
]
},
"name": {
"type": "string",
"description": "The ID of the role definition."
},
"properties": {
"oneOf": [
{
"$ref": "#/definitions/RoleDefinitionProperties"
},
{
"$ref": "https://schema.management.azure.com/schemas/common/definitions.json#/definitions/expression"
}
],
"description": "Role definition properties."
},
"type": {
"type": "string",
"enum": [
"Microsoft.Authorization/roleDefinitions"
]
}
},
"required": [
"apiVersion",
"name",
"properties",
"type"
],
"description": "Microsoft.Authorization/roleDefinitions"
}
},
"definitions": {
"Permission": {
"type": "object",
"properties": {
"actions": {
"oneOf": [
{
"type": "array",
"items": {
"type": "string"
}
},
{
"$ref": "https://schema.management.azure.com/schemas/common/definitions.json#/definitions/expression"
}
],
"description": "Allowed actions."
},
"notActions": {
"oneOf": [
{
"type": "array",
"items": {
"type": "string"
}
},
{
"$ref": "https://schema.management.azure.com/schemas/common/definitions.json#/definitions/expression"
}
],
"description": "Denied actions."
}
},
"description": "Role definition permissions."
},
"RoleAssignmentProperties": {
"type": "object",
"properties": {
"principalId": {
"type": "string",
"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."
},
"roleDefinitionId": {
"type": "string",
"description": "The role definition ID used in the role assignment."
}
},
"required": [
"principalId",
"roleDefinitionId"
],
"description": "Role assignment properties."
},
"RoleDefinitionProperties": {
"type": "object",
"properties": {
"assignableScopes": {
"oneOf": [
{
"type": "array",
"items": {
"type": "string"
}
},
{
"$ref": "https://schema.management.azure.com/schemas/common/definitions.json#/definitions/expression"
}
],
"description": "Role definition assignable scopes."
},
"description": {
"type": "string",
"description": "The role definition description."
},
"permissions": {
"oneOf": [
{
"type": "array",
"items": {
"$ref": "#/definitions/Permission"
}
},
{
"$ref": "https://schema.management.azure.com/schemas/common/definitions.json#/definitions/expression"
}
],
"description": "Role definition permissions."
},
"roleName": {
"type": "string",
"description": "The role name."
},
"type": {
"type": "string",
"description": "The role type."
}
},
"description": "Role definition properties."
}
}
}
Loading

0 comments on commit fdc3360

Please sign in to comment.