Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
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

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,12 @@
<PropertyGroup>
<Description>Microsoft Azure Attestation Library</Description>
<AssemblyName>Microsoft.Azure.Management.Attestation</AssemblyName>
<Version>0.11.0-preview</Version>
<Version>0.12.0-preview</Version>
<PackageId>Microsoft.Azure.Management.Attestation</PackageId>
<PackageTags>Management.Attestation;Attestation;recommendations;</PackageTags>
<PackageReleaseNotes>
<![CDATA[
This is a public release of the Azure Attestation SDK. Included with this release is the ability to manage Attestation service locations and tags.
This is a public release of the Azure Attestation SDK. Included with this release is the ability to manage Attestation service default providers.
]]>
</PackageReleaseNotes>
<TargetFrameworks>$(SdkTargetFx)</TargetFrameworks>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
[assembly: AssemblyTitle("Microsoft Azure Attestation Management Library")]
[assembly: AssemblyDescription("Provides management functionality for Microsoft Azure Attestation recommendations.")]

[assembly: AssemblyVersion("0.11.0.0")]
[assembly: AssemblyFileVersion("0.11.0.0")]
[assembly: AssemblyVersion("0.12.0.0")]
[assembly: AssemblyFileVersion("0.12.0.0")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("Microsoft")]
[assembly: AssemblyProduct("Microsoft Azure .NET SDK")]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
using Microsoft.Rest.ClientRuntime.Azure.TestFramework;
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Security.Cryptography.X509Certificates;
using System.Threading;
using System.Linq;
Expand Down Expand Up @@ -63,16 +64,28 @@ public void AttestationManagementAttestationCreateDelete()
testBase.subscriptionId,
creationParams);

testBase.client.AttestationProviders.Get(
testBase.client.AttestationProviders.Get(
resourceGroupName: testBase.rgName,
providerName: testBase.attestationName);

// Get EUS Test default provider and validate
string defaultProviderName = "sharedeus";
string defaultProviderLocation = "East US";
var defaultProvider = testBase.client.AttestationProviders.GetDefaultByLocation(location: defaultProviderLocation);

ValidateDefaultProvider(defaultProvider,
defaultProviderName,
defaultProviderLocation);

// List all Test default providers and validate
var defaultProviderList = testBase.client.AttestationProviders.ListDefault();
ValidateDefaultProviderList(defaultProviderList);
}
finally
{
testBase.client.AttestationProviders.Delete(
resourceGroupName: testBase.rgName,
providerName: testBase.attestationName);

}
}
}
Expand All @@ -87,7 +100,7 @@ private void ValidateAttestationProvider(
Assert.NotNull(attestation);
Assert.Equal(expectedAttestationName, attestation.Name);

string resourceIdFormat = "subscriptions/{0}/resourceGroups/{1}/providers/Microsoft.Attestation/attestationProviders/{2}";
string resourceIdFormat = "/subscriptions/{0}/resourceGroups/{1}/providers/Microsoft.Attestation/attestationProviders/{2}";
string expectedResourceId = string.Format(resourceIdFormat, expectedSubId, expectedResourceGroupName, expectedAttestationName);
Assert.Equal(expectedResourceId, attestation.Id);

Expand All @@ -104,6 +117,45 @@ private void ValidateAttestationProvider(

Assert.True(creationParams.Location.Equals(attestation.Location, StringComparison.InvariantCultureIgnoreCase));
}

private void ValidateDefaultProvider(
AttestationProvider defaultProvider,
string expectedAttestationName,
string expectedLocation = "")
{
Assert.NotNull(defaultProvider);
Assert.Equal(expectedAttestationName, defaultProvider.Name);

string resourceIdFormat = "/providers/Microsoft.Attestation/attestationProviders/{0}";
string expectedResourceId = string.Format(resourceIdFormat, expectedAttestationName);
Assert.Equal(expectedResourceId, defaultProvider.Id);

Assert.Null(defaultProvider.Tags);
if (!string.IsNullOrEmpty(expectedLocation))
{
Assert.True(expectedLocation.Equals(defaultProvider.Location, StringComparison.InvariantCultureIgnoreCase));
}
}

private void ValidateDefaultProviderList(AttestationProviderListResult defaultProviderList)
{
Assert.NotNull(defaultProviderList);
Assert.IsType<AttestationProviderListResult>(defaultProviderList);
Assert.True(defaultProviderList.Value.Count > 0);

string resourceIdFormat = "/providers/Microsoft.Attestation/attestationProviders/shared";
string nameFormat = "shared";

foreach (AttestationProvider defaultProvider in defaultProviderList.Value)
{
Assert.StartsWith(nameFormat, defaultProvider.Name);
Assert.StartsWith(resourceIdFormat, defaultProvider.Id);
Assert.Null(defaultProvider.Tags);
Assert.NotEmpty(defaultProvider.Location);
Assert.StartsWith("https://" + defaultProvider.Name, defaultProvider.AttestUri);
Assert.EndsWith("attest.azure.net", defaultProvider.AttestUri);
}
}
}
}

Original file line number Diff line number Diff line change
Expand Up @@ -35,5 +35,5 @@
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("0.11.0.0")]
[assembly: AssemblyFileVersion("0.11.0.0")]
[assembly: AssemblyVersion("0.12.0.0")]
[assembly: AssemblyFileVersion("0.12.0.0")]
Loading