Skip to content
Merged
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
45 changes: 0 additions & 45 deletions .github/workflows/aot-check.yml

This file was deleted.

26 changes: 25 additions & 1 deletion Microsoft.Identity.Web.sln
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 18
VisualStudioVersion = 18.0.11217.181 d18.0
VisualStudioVersion = 18.0.11217.181
MinimumVisualStudioVersion = 10.0.40219.1
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "src", "src", "{1DDE1AAC-5AE6-4725-94B6-A26C58D3423F}"
EndProject
Expand Down Expand Up @@ -181,6 +181,30 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MtlsPopClient", "tests\DevA
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MtlsPopWebApi", "tests\DevApps\MtlsPop\MtlsPopWebApi\MtlsPopWebApi.csproj", "{A61CEEDE-6F2C-0710-E008-B5F6F25D87D7}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "build", "build", "{FF3B93A1-B8A4-4120-AF3D-7B5C43C0735C}"
ProjectSection(SolutionItems) = preProject
build\build.md = build\build.md
build\CodeCoverage.runsettings = build\CodeCoverage.runsettings
build\credscan-exclusion.json = build\credscan-exclusion.json
build\GenerateDocFx.ps1 = build\GenerateDocFx.ps1
build\Microsoft.Identity.Web-Source-Assemblies.dgml = build\Microsoft.Identity.Web-Source-Assemblies.dgml
build\MSAL.snk = build\MSAL.snk
build\pipeline-releasebuild.yaml = build\pipeline-releasebuild.yaml
build\policheck_exclusions.xml = build\policheck_exclusions.xml
build\policheck_filetypes.xml = build\policheck_filetypes.xml
build\release-provisioning-tool.yml = build\release-provisioning-tool.yml
build\template-install-dependencies.yaml = build\template-install-dependencies.yaml
build\template-onebranch-release-build.yaml = build\template-onebranch-release-build.yaml
build\template-pack-and-sign-all-nugets.yaml = build\template-pack-and-sign-all-nugets.yaml
build\template-pack-nuget.yaml = build\template-pack-nuget.yaml
build\template-postbuild-code-analysis.yaml = build\template-postbuild-code-analysis.yaml
build\template-prebuild-code-analysis.yaml = build\template-prebuild-code-analysis.yaml
build\template-publish-and-cleanup.yaml = build\template-publish-and-cleanup.yaml
build\template-restore-build-MSIdentityWeb.yaml = build\template-restore-build-MSIdentityWeb.yaml
build\template-run-unit-tests.yaml = build\template-run-unit-tests.yaml
build\tsaConfig.json = build\tsaConfig.json
EndProjectSection
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Expand Down
57 changes: 0 additions & 57 deletions build/test-aot.ps1

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
<PropertyGroup>
<Title>Microsoft Identity Web.Azure</Title>
<Product>Microsoft Identity Web.Azure</Product>
<IsAotCompatible Condition="$([MSBuild]::IsTargetFrameworkCompatible('$(TargetFramework)', 'net8.0'))">true</IsAotCompatible>
<Description>
This package enables ASP.NET Core web apps and web APIs to use the Azure SDKs with the Microsoft identity platform (formerly Azure AD v2.0)
</Description>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
<Description>This package brings certificate management for MSAL.NET.</Description>
<ProjectGuid>{1E0B96CD-FDBF-482C-996A-775F691D984E}</ProjectGuid>
<PackageReadmeFile>README.md</PackageReadmeFile>
<IsAotCompatible Condition="$([MSBuild]::IsTargetFrameworkCompatible('$(TargetFramework)', 'net8.0'))">true</IsAotCompatible>
</PropertyGroup>
<ItemGroup>
<None Include="..\..\README.md">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
<ImplicitUsings>disable</ImplicitUsings>
<Nullable>enable</Nullable>
<PackageReadmeFile>README.md</PackageReadmeFile>
<IsAotCompatible Condition="$([MSBuild]::IsTargetFrameworkCompatible('$(TargetFramework)', 'net8.0'))">true</IsAotCompatible>
</PropertyGroup>

<ItemGroup>
Expand Down
12 changes: 0 additions & 12 deletions src/Microsoft.Identity.Web.DownstreamApi/DownstreamApi.cs
Original file line number Diff line number Diff line change
Expand Up @@ -134,10 +134,8 @@ public Task<HttpResponseMessage> CallApiForAppAsync(
}

/// <inheritdoc/>
#if NET8_0_OR_GREATER
[RequiresUnreferencedCode("Calls JsonSerializer.Serialize<TInput>")]
[RequiresDynamicCode("Calls JsonSerializer.Serialize<TInput>")]
#endif
public async Task<TOutput?> CallApiForUserAsync<TInput, TOutput>(
string? serviceName,
TInput input,
Expand All @@ -161,10 +159,8 @@ public Task<HttpResponseMessage> CallApiForAppAsync(
}

/// <inheritdoc/>
#if NET8_0_OR_GREATER
[RequiresUnreferencedCode("Calls JsonSerializer.Serialize<TInput>")]
[RequiresDynamicCode("Calls JsonSerializer.Serialize<TInput>")]
#endif
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public async Task<TOutput?> CallApiForAppAsync<TInput, TOutput>(
string? serviceName,
Expand All @@ -187,10 +183,8 @@ public Task<HttpResponseMessage> CallApiForAppAsync(
}

/// <inheritdoc/>
#if NET8_0_OR_GREATER
[RequiresUnreferencedCode("Calls JsonSerializer.Serialize<TInput>")]
[RequiresDynamicCode("Calls JsonSerializer.Serialize<TInput>")]
#endif
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public async Task<TOutput?> CallApiForAppAsync<TOutput>(string serviceName,
Action<DownstreamApiOptions>? downstreamApiOptionsOverride = null,
Expand All @@ -204,10 +198,8 @@ public Task<HttpResponseMessage> CallApiForAppAsync(
}

/// <inheritdoc/>
#if NET8_0_OR_GREATER
[RequiresUnreferencedCode("Calls JsonSerializer.Serialize<TInput>")]
[RequiresDynamicCode("Calls JsonSerializer.Serialize<TInput>")]
#endif
public async Task<TOutput?> CallApiForUserAsync<TOutput>(
string? serviceName,
Action<DownstreamApiOptions>? downstreamApiOptionsOverride = null,
Expand Down Expand Up @@ -389,10 +381,8 @@ public Task<HttpResponseMessage> CallApiForAppAsync(
return clonedOptions;
}

#if NET7_0_OR_GREATER
[RequiresUnreferencedCode("Calls JsonSerializer.Serialize<TInput>")]
[RequiresDynamicCode("Calls JsonSerializer.Serialize<TInput>")]
#endif
internal static HttpContent? SerializeInput<TInput>(TInput input, DownstreamApiOptions effectiveOptions)
{
HttpContent? httpContent;
Expand Down Expand Up @@ -424,10 +414,8 @@ public Task<HttpResponseMessage> CallApiForAppAsync(
return httpContent;
}

#if NET7_0_OR_GREATER
[RequiresUnreferencedCode("Calls JsonSerializer.Serialize<TInput>")]
[RequiresDynamicCode("Calls JsonSerializer.Serialize<TInput>")]
#endif
internal static async Task<TOutput?> DeserializeOutputAsync<TOutput>(HttpResponseMessage response, DownstreamApiOptions effectiveOptions, CancellationToken cancellationToken = default)
where TOutput : class
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,10 @@
<EnableConfigurationBindingGenerator>true</EnableConfigurationBindingGenerator>
<IsAotCompatible>true</IsAotCompatible>
</PropertyGroup>
<!-- Include AOT attribute polyfills for older TFMs -->
<ItemGroup Condition="'$(TargetFramework)' == 'net462' or '$(TargetFramework)' == 'net472' or '$(TargetFramework)' == 'netstandard2.0'">
<Compile Include="..\Shared\CodeAnalysisAttributes.cs" Link="Polyfills\CodeAnalysisAttributes.cs" />
</ItemGroup>
<ItemGroup>
<None Include="..\..\README.md">
<Pack>True</Pack>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
// Licensed under the MIT License.

using System;
using System.Diagnostics.CodeAnalysis;
using System.Linq;
using System.Net.Http;
using Microsoft.Extensions.Configuration;
Expand Down Expand Up @@ -40,6 +41,8 @@ public static IServiceCollection AddMicrosoftGraph(this IServiceCollection servi
/// <param name="services">Builder.</param>
/// <param name="configurationSection">Configuration section containing the Microsoft graph config.</param>
/// <returns>The service collection to chain.</returns>
[RequiresUnreferencedCode("Calls Microsoft.Extensions.Configuration.ConfigurationBinder.Bind(IConfiguration, Object).")]
[RequiresDynamicCode("Calls Microsoft.Extensions.Configuration.ConfigurationBinder.Bind(IConfiguration, Object).")]
public static IServiceCollection AddMicrosoftGraph(this IServiceCollection services, IConfiguration configurationSection)
{
return services.AddMicrosoftGraph(o => configurationSection.Bind(o));
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<IsAotCompatible Condition="$([MSBuild]::IsTargetFrameworkCompatible('$(TargetFramework)', 'net8.0'))">true</IsAotCompatible>

<Title>Microsoft Identity Web, Microsoft Graph v5+ helper</Title>
<Product>Microsoft Identity Web</Product>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,8 @@ public static class MicrosoftGraphExtensions
/// <param name="builder">Builder.</param>
/// <param name="configurationSection">Configuration section.</param>
/// <returns>The builder to chain.</returns>
#if NET6_0_OR_GREATER && !NET8_0_OR_GREATER
[RequiresUnreferencedCode("Microsoft.Extensions.Configuration.ConfigurationBinder.Bind(IConfiguration, Object).")]
#endif
[RequiresUnreferencedCode("Calls Microsoft.Extensions.Configuration.ConfigurationBinder.Bind(IConfiguration, Object).")]
[RequiresDynamicCode("Calls Microsoft.Extensions.Configuration.ConfigurationBinder.Bind(IConfiguration, Object).")]
public static MicrosoftIdentityAppCallsWebApiAuthenticationBuilder AddMicrosoftGraph(
this MicrosoftIdentityAppCallsWebApiAuthenticationBuilder builder,
IConfigurationSection configurationSection)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
// Licensed under the MIT License.

using System;
using System.Diagnostics.CodeAnalysis;
using System.Linq;
using System.Net.Http;
using Microsoft.Extensions.Configuration;
Expand Down Expand Up @@ -40,6 +41,8 @@ public static IServiceCollection AddMicrosoftGraphBeta(this IServiceCollection s
/// <param name="services">Builder.</param>
/// <param name="configurationSection">Configuration section containing the Microsoft graph config.</param>
/// <returns>The service collection to chain.</returns>
[RequiresUnreferencedCode("Calls Microsoft.Extensions.Configuration.ConfigurationBinder.Bind(IConfiguration, Object).")]
[RequiresDynamicCode("Calls Microsoft.Extensions.Configuration.ConfigurationBinder.Bind(IConfiguration, Object).")]
public static IServiceCollection AddMicrosoftGraphBeta(this IServiceCollection services, IConfiguration configurationSection)
{
return services.AddMicrosoftGraphBeta(o => configurationSection.Bind(o));
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<IsAotCompatible Condition="$([MSBuild]::IsTargetFrameworkCompatible('$(TargetFramework)', 'net8.0'))">true</IsAotCompatible>

<Title>Microsoft Identity Web, Microsoft Graph v5+ helper</Title>
<Product>Microsoft Identity Web</Product>
Expand Down
5 changes: 5 additions & 0 deletions src/Microsoft.Identity.Web.Sidecar/Program.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.

using System.Diagnostics.CodeAnalysis;
using System.IdentityModel.Tokens.Jwt;
using System.Security.Cryptography.X509Certificates;
using Microsoft.AspNetCore.Authentication.JwtBearer;
Expand All @@ -12,6 +13,10 @@ namespace Microsoft.Identity.Web.Sidecar;

public class Program
{

// Adding these the time to merge Andy's PR. Then will do the work to remove reflexion usage
[RequiresUnreferencedCode("EnableTokenAcquisitionToCallDownstreamApis uses reflection")]
[RequiresDynamicCode("EnableTokenAcquisitionToCallDownstreamApis uses reflection")]
public static void Main(string[] args)
{
var builder = WebApplication.CreateSlimBuilder(args);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,8 @@ namespace Microsoft.Identity.Web
/// Extension class on IApplicationBuilder to initialize the service provider of
/// the TokenAcquirerFactory in ASP.NET Core.
/// </summary>
#if NET6_0_OR_GREATER
[RequiresUnreferencedCode("Microsoft.Identity.Web.TokenAcquirerFactory.GetDefaultInstance(String).")]
#endif
[RequiresDynamicCode("Microsoft.Identity.Web.TokenAcquirerFactory.GetDefaultInstance(String).")]
public static class ApplicationBuilderExtensions
{
/// <summary>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,10 @@
<GeneratePackageOnBuild>True</GeneratePackageOnBuild>
</PropertyGroup>

<PropertyGroup Condition="$([MSBuild]::IsTargetFrameworkCompatible('$(TargetFramework)', 'net8.0'))">
<IsAotCompatible>true</IsAotCompatible>
</PropertyGroup>

<!-- Reactivate when https://github.com/AzureAD/microsoft-identity-abstractions-for-dotnet/pull/178 is fixed-->
<!--<PropertyGroup Condition="$([MSBuild]::IsTargetFrameworkCompatible('$(TargetFramework)', 'net8.0'))">
<EnableConfigurationBindingGenerator>true</EnableConfigurationBindingGenerator>
Expand Down Expand Up @@ -53,6 +57,8 @@

<ItemGroup Condition="'$(TargetFrameworkIdentifier)' == '.NETFramework' Or '$(TargetFramework)' == 'netstandard2.0'">
<Compile Remove="AspNetCore\*.cs" />
<!-- Include shared AOT polyfill for older TFMs -->
<Compile Include="..\Shared\CodeAnalysisAttributes.cs" Link="Polyfills\CodeAnalysisAttributes.cs" />
</ItemGroup>

<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,8 @@ namespace Microsoft.Identity.Web
/// </summary>
public class MicrosoftIdentityAppCallsWebApiAuthenticationBuilder : MicrosoftIdentityBaseAuthenticationBuilder
{
#if NET6_0_OR_GREATER
[RequiresUnreferencedCode("Calls Microsoft.Identity.Web.MicrosoftIdentityBaseAuthenticationBuilder.MicrosoftIdentityBaseAuthenticationBuilder(IServiceCollection, IConfigurationSection)")]
#endif
[RequiresUnreferencedCode("Calls Microsoft.Identity.Web.MicrosoftIdentityBaseAuthenticationBuilder.MicrosoftIdentityBaseAuthenticationBuilder(IServiceCollection, IConfigurationSection).")]
[RequiresDynamicCode("Calls Microsoft.Identity.Web.MicrosoftIdentityBaseAuthenticationBuilder.MicrosoftIdentityBaseAuthenticationBuilder(IServiceCollection, IConfigurationSection).")]
internal MicrosoftIdentityAppCallsWebApiAuthenticationBuilder(
IServiceCollection services,
IConfigurationSection? configurationSection = null)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,8 @@ public class MicrosoftIdentityBaseAuthenticationBuilder
/// </summary>
/// <param name="services">The services being configured.</param>
/// <param name="configurationSection">Optional configuration section.</param>
#if NET6_0_OR_GREATER && !NET8_0_OR_GREATER
[RequiresUnreferencedCode("Calls Microsoft.Extensions.Configuration.ConfigurationBinder.Bind(IConfiguration, Object).")]
#endif
[RequiresDynamicCode("Calls Microsoft.Extensions.Configuration.ConfigurationBinder.Bind(IConfiguration, Object).")]
protected MicrosoftIdentityBaseAuthenticationBuilder(
IServiceCollection services,
IConfigurationSection? configurationSection = null)
Expand All @@ -38,6 +37,8 @@ protected MicrosoftIdentityBaseAuthenticationBuilder(
IdentityModelEventSource.ShowPII = logOptions.EnablePiiLogging;
}

[RequiresUnreferencedCode("Calls Microsoft.Extensions.Configuration.ConfigurationBinder.GetValue")]
[RequiresDynamicCode("Calls Microsoft.Extensions.Configuration.ConfigurationBinder.GetValue")]
internal static void SetIdentityModelLogger(IServiceProvider serviceProvider)
{
if (serviceProvider != null)
Expand Down
Loading
Loading