public PSVaultAccessPolicy(KeyVaultManagement.AccessPolicyEntry s, PSResourceManagerModels.ActiveDirectory.ActiveDirectoryClient adClient) { ObjectId = s.ObjectId; DisplayName = ModelExtensions.GetDisplayNameForADObject(s.ObjectId, adClient); ApplicationId = s.ApplicationId; TenantId = s.TenantId; TenantName = s.TenantId.ToString(); PermissionsToSecrets = new List<string>(s.PermissionsToSecrets); PermissionsToKeys = new List<string>(s.PermissionsToKeys); }
public PSVaultAccessPolicy(KeyVaultManagement.Models.AccessPolicyEntry s, ActiveDirectoryClient adClient) { ObjectId = s.ObjectId; DisplayName = ModelExtensions.GetDisplayNameForADObject(s.ObjectId, adClient); ApplicationId = s.ApplicationId; TenantId = s.TenantId; TenantName = s.TenantId.ToString(); PermissionsToSecrets = s.Permissions.Secrets == null ? new List<string>() : new List<string>(s.Permissions.Secrets); PermissionsToKeys = s.Permissions.Keys == null ? new List<string>() : new List<string>(s.Permissions.Keys); PermissionsToCertificates = s.Permissions.Certificates == null ? new List<string>() : new List<string>(s.Permissions.Certificates); }
public PSVault(KeyVaultManagement.Vault vault, PSResourceManagerModels.ActiveDirectory.ActiveDirectoryClient adClient) { var vaultTenantDisplayName = ModelExtensions.GetDisplayNameForTenant(vault.Properties.TenantId, adClient); VaultName = vault.Name; Location = vault.Location; ResourceId = vault.Id; ResourceGroupName = (new PSResourceManagerModels.ResourceIdentifier(vault.Id)).ResourceGroupName; Tags = TagsConversionHelper.CreateTagHashtable(vault.Tags); Sku = vault.Properties.Sku.Name; TenantId = vault.Properties.TenantId; TenantName = vaultTenantDisplayName; VaultUri = vault.Properties.VaultUri; EnabledForDeployment = vault.Properties.EnabledForDeployment; EnabledForTemplateDeployment = vault.Properties.EnabledForTemplateDeployment; EnabledForDiskEncryption = vault.Properties.EnabledForDiskEncryption; AccessPolicies = vault.Properties.AccessPolicies.Select(s => new PSVaultAccessPolicy(s, adClient)).ToArray(); OriginalVault = vault; }