Skip to content

Commit

Permalink
Merge pull request #158 from shleiAmy/AddAttestationServiceEndpoint
Browse files Browse the repository at this point in the history
add attestation service endpoint
  • Loading branch information
VeryEarly authored Dec 4, 2019
2 parents 17f51a0 + a17abec commit db33cc2
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/Authentication.Abstractions/AzureEnvironment.cs
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,8 @@ static IDictionary<string, AzureEnvironment> InitializeBuiltInEnvironments()
azureCloud.SetProperty(ExtendedEndpoint.OperationalInsightsEndpointResourceId, AzureEnvironmentConstants.AzureOperationalInsightsEndpointResourceId);
azureCloud.SetProperty(ExtendedEndpoint.AnalysisServicesEndpointSuffix, AzureEnvironmentConstants.AzureAnalysisServicesEndpointSuffix);
azureCloud.SetProperty(ExtendedEndpoint.AnalysisServicesEndpointResourceId, AzureEnvironmentConstants.AzureAnalysisServicesEndpointResourceId);
azureCloud.SetProperty(ExtendedEndpoint.AzureAttestationServiceEndpointSuffix, AzureEnvironmentConstants.AzureAttestationServiceEndpointSuffix);
azureCloud.SetProperty(ExtendedEndpoint.AzureAttestationServiceEndpointResourceId, AzureEnvironmentConstants.AzureAttestationServiceEndpointResourceId);
var azureChina = new AzureEnvironment
{
Name = EnvironmentName.AzureChinaCloud,
Expand Down Expand Up @@ -307,7 +309,9 @@ public static class ExtendedEndpoint
public const string OperationalInsightsEndpointResourceId = "OperationalInsightsEndpointResourceId",
OperationalInsightsEndpoint = "OperationalInsightsEndpoint",
AnalysisServicesEndpointSuffix = "AzureAnalysisServicesEndpointSuffix",
AnalysisServicesEndpointResourceId = "AnalysisServicesEndpointResourceId";
AnalysisServicesEndpointResourceId = "AnalysisServicesEndpointResourceId",
AzureAttestationServiceEndpointSuffix = "AzureAttestationServiceEndpointSuffix",
AzureAttestationServiceEndpointResourceId = "AzureAttestationServiceEndpointResourceId";
}
}
}
10 changes: 10 additions & 0 deletions src/Authentication.Abstractions/AzureEnvironmentConstants.cs
Original file line number Diff line number Diff line change
Expand Up @@ -171,5 +171,15 @@ public static class AzureEnvironmentConstants
public const string ChinaAnalysisServicesEndpointResourceId = "https://region.asazure.chinacloudapi.cn";
public const string USGovernmentAnalysisServicesEndpointResourceId = "https://region.asazure.usgovcloudapi.net";
public const string GermanAnalysisServicesEndpointResourceId = "https://region.asazure.cloudapi.de";

/// <summary>
/// The domain name suffix for Azure Attestation Services
/// </summary>
public const string AzureAttestationServiceEndpointSuffix = "attest.azure.net";

/// <summary>
/// The token audience for authorizing Attestation Service requests
/// </summary>
public const string AzureAttestationServiceEndpointResourceId = "https://attest.azure.net";
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -277,6 +277,12 @@ public static void SetEndpoint(this IAzureEnvironment environment, string endpoi
case AzureEnvironment.ExtendedEndpoint.AnalysisServicesEndpointResourceId:
environment.SetProperty(AzureEnvironment.ExtendedEndpoint.AnalysisServicesEndpointResourceId, propertyValue);
break;
case AzureEnvironment.ExtendedEndpoint.AzureAttestationServiceEndpointSuffix:
environment.SetProperty(AzureEnvironment.ExtendedEndpoint.AzureAttestationServiceEndpointSuffix, propertyValue);
break;
case AzureEnvironment.ExtendedEndpoint.AzureAttestationServiceEndpointResourceId:
environment.SetProperty(AzureEnvironment.ExtendedEndpoint.AzureAttestationServiceEndpointResourceId, propertyValue);
break;
}
}
}
Expand Down Expand Up @@ -312,6 +318,10 @@ public static string GetTokenAudience(this IAzureEnvironment environment, string
case AzureEnvironment.ExtendedEndpoint.AnalysisServicesEndpointResourceId:
resource = AzureEnvironment.ExtendedEndpoint.AnalysisServicesEndpointResourceId;
break;
case AzureEnvironment.ExtendedEndpoint.AzureAttestationServiceEndpointSuffix:
case AzureEnvironment.ExtendedEndpoint.AzureAttestationServiceEndpointResourceId:
resource = AzureEnvironment.ExtendedEndpoint.AzureAttestationServiceEndpointResourceId;
break;
default:
resource = AzureEnvironment.Endpoint.ActiveDirectoryServiceEndpointResourceId;
break;
Expand Down

0 comments on commit db33cc2

Please sign in to comment.