From e380486a7ccc4679c1ce81270773a2269412739e Mon Sep 17 00:00:00 2001 From: Pranav K Date: Wed, 16 Feb 2022 09:35:10 -0800 Subject: [PATCH] Annotate Microsoft.Authentication.WebAssembly.Msal for nullability --- ...oft.Authentication.WebAssembly.Msal.csproj | 3 +- .../src/Models/MsalAuthenticationOptions.cs | 8 +-- .../src/Models/MsalCacheOptions.cs | 2 +- .../src/MsalDefaultOptionsConfiguration.cs | 4 +- .../src/PublicAPI.Shipped.txt | 50 +++++++++---------- 5 files changed, 33 insertions(+), 34 deletions(-) diff --git a/src/Components/WebAssembly/Authentication.Msal/src/Microsoft.Authentication.WebAssembly.Msal.csproj b/src/Components/WebAssembly/Authentication.Msal/src/Microsoft.Authentication.WebAssembly.Msal.csproj index e77734188c5d..7cc28d578e17 100644 --- a/src/Components/WebAssembly/Authentication.Msal/src/Microsoft.Authentication.WebAssembly.Msal.csproj +++ b/src/Components/WebAssembly/Authentication.Msal/src/Microsoft.Authentication.WebAssembly.Msal.csproj @@ -1,4 +1,4 @@ - + @@ -7,7 +7,6 @@ Authenticate your Blazor webassembly applications with Azure Active Directory and Azure Active Directory B2C true true - disable diff --git a/src/Components/WebAssembly/Authentication.Msal/src/Models/MsalAuthenticationOptions.cs b/src/Components/WebAssembly/Authentication.Msal/src/Models/MsalAuthenticationOptions.cs index 9c2e76fa0d2a..597eac8f3a97 100644 --- a/src/Components/WebAssembly/Authentication.Msal/src/Models/MsalAuthenticationOptions.cs +++ b/src/Components/WebAssembly/Authentication.Msal/src/Models/MsalAuthenticationOptions.cs @@ -11,12 +11,12 @@ public class MsalAuthenticationOptions /// /// Gets or sets the client id for the application. /// - public string ClientId { get; set; } + public string? ClientId { get; set; } /// /// Gets or sets the authority for the Azure Active Directory or Azure Active Directory B2C instance. /// - public string Authority { get; set; } + public string? Authority { get; set; } /// /// Gets or sets a value that indicates whether or not to validate the authority. @@ -32,7 +32,7 @@ public class MsalAuthenticationOptions /// /// It can be an absolute or base relative and defaults to authentication/login-callback. /// - public string RedirectUri { get; set; } + public string? RedirectUri { get; set; } /// /// Gets or sets the post logout redirect uri for the application. @@ -40,7 +40,7 @@ public class MsalAuthenticationOptions /// /// It can be an absolute or base relative and defaults to authentication/logout-callback. /// - public string PostLogoutRedirectUri { get; set; } + public string? PostLogoutRedirectUri { get; set; } /// /// Gets or sets whether or not to navigate to the login request url after a successful login. diff --git a/src/Components/WebAssembly/Authentication.Msal/src/Models/MsalCacheOptions.cs b/src/Components/WebAssembly/Authentication.Msal/src/Models/MsalCacheOptions.cs index 48035f673604..7b5ab359b201 100644 --- a/src/Components/WebAssembly/Authentication.Msal/src/Models/MsalCacheOptions.cs +++ b/src/Components/WebAssembly/Authentication.Msal/src/Models/MsalCacheOptions.cs @@ -14,7 +14,7 @@ public class MsalCacheOptions /// /// Valid values are sessionStorage and localStorage. /// - public string CacheLocation { get; set; } + public string? CacheLocation { get; set; } /// /// Gets or sets whether to store the authentication state in a cookie. diff --git a/src/Components/WebAssembly/Authentication.Msal/src/MsalDefaultOptionsConfiguration.cs b/src/Components/WebAssembly/Authentication.Msal/src/MsalDefaultOptionsConfiguration.cs index 7ef27e0b8bab..9316de1b8fb4 100644 --- a/src/Components/WebAssembly/Authentication.Msal/src/MsalDefaultOptionsConfiguration.cs +++ b/src/Components/WebAssembly/Authentication.Msal/src/MsalDefaultOptionsConfiguration.cs @@ -8,7 +8,7 @@ namespace Microsoft.Authentication.WebAssembly.Msal; -internal class MsalDefaultOptionsConfiguration : IPostConfigureOptions> +internal sealed class MsalDefaultOptionsConfiguration : IPostConfigureOptions> { private readonly NavigationManager _navigationManager; @@ -41,7 +41,7 @@ public void Configure(RemoteAuthenticationOptions options) options.ProviderOptions.Authentication.NavigateToLoginRequestUrl = false; } - public void PostConfigure(string name, RemoteAuthenticationOptions options) + public void PostConfigure(string? name, RemoteAuthenticationOptions options) { if (string.Equals(name, Options.DefaultName, StringComparison.Ordinal)) { diff --git a/src/Components/WebAssembly/Authentication.Msal/src/PublicAPI.Shipped.txt b/src/Components/WebAssembly/Authentication.Msal/src/PublicAPI.Shipped.txt index 817b9c05ca89..29d31abb55c9 100644 --- a/src/Components/WebAssembly/Authentication.Msal/src/PublicAPI.Shipped.txt +++ b/src/Components/WebAssembly/Authentication.Msal/src/PublicAPI.Shipped.txt @@ -1,29 +1,29 @@ #nullable enable -~Microsoft.Authentication.WebAssembly.Msal.Models.MsalCacheOptions.CacheLocation.get -> string -~Microsoft.Authentication.WebAssembly.Msal.Models.MsalCacheOptions.CacheLocation.set -> void -~Microsoft.Authentication.WebAssembly.Msal.Models.MsalProviderOptions.AdditionalScopesToConsent.get -> System.Collections.Generic.IList -~Microsoft.Authentication.WebAssembly.Msal.Models.MsalProviderOptions.AdditionalScopesToConsent.set -> void -~Microsoft.Authentication.WebAssembly.Msal.Models.MsalProviderOptions.Authentication.get -> Microsoft.Authentication.WebAssembly.Msal.MsalAuthenticationOptions -~Microsoft.Authentication.WebAssembly.Msal.Models.MsalProviderOptions.Authentication.set -> void -~Microsoft.Authentication.WebAssembly.Msal.Models.MsalProviderOptions.Cache.get -> Microsoft.Authentication.WebAssembly.Msal.Models.MsalCacheOptions -~Microsoft.Authentication.WebAssembly.Msal.Models.MsalProviderOptions.Cache.set -> void -~Microsoft.Authentication.WebAssembly.Msal.Models.MsalProviderOptions.DefaultAccessTokenScopes.get -> System.Collections.Generic.IList -~Microsoft.Authentication.WebAssembly.Msal.Models.MsalProviderOptions.DefaultAccessTokenScopes.set -> void -~Microsoft.Authentication.WebAssembly.Msal.Models.MsalProviderOptions.LoginMode.get -> string -~Microsoft.Authentication.WebAssembly.Msal.Models.MsalProviderOptions.LoginMode.set -> void -~Microsoft.Authentication.WebAssembly.Msal.MsalAuthenticationOptions.Authority.get -> string -~Microsoft.Authentication.WebAssembly.Msal.MsalAuthenticationOptions.Authority.set -> void -~Microsoft.Authentication.WebAssembly.Msal.MsalAuthenticationOptions.ClientId.get -> string -~Microsoft.Authentication.WebAssembly.Msal.MsalAuthenticationOptions.ClientId.set -> void -~Microsoft.Authentication.WebAssembly.Msal.MsalAuthenticationOptions.KnownAuthorities.get -> System.Collections.Generic.IList -~Microsoft.Authentication.WebAssembly.Msal.MsalAuthenticationOptions.KnownAuthorities.set -> void -~Microsoft.Authentication.WebAssembly.Msal.MsalAuthenticationOptions.PostLogoutRedirectUri.get -> string -~Microsoft.Authentication.WebAssembly.Msal.MsalAuthenticationOptions.PostLogoutRedirectUri.set -> void -~Microsoft.Authentication.WebAssembly.Msal.MsalAuthenticationOptions.RedirectUri.get -> string -~Microsoft.Authentication.WebAssembly.Msal.MsalAuthenticationOptions.RedirectUri.set -> void -~static Microsoft.Extensions.DependencyInjection.MsalWebAssemblyServiceCollectionExtensions.AddMsalAuthentication(this Microsoft.Extensions.DependencyInjection.IServiceCollection services, System.Action> configure) -> Microsoft.Extensions.DependencyInjection.IRemoteAuthenticationBuilder -~static Microsoft.Extensions.DependencyInjection.MsalWebAssemblyServiceCollectionExtensions.AddMsalAuthentication(this Microsoft.Extensions.DependencyInjection.IServiceCollection services, System.Action> configure) -> Microsoft.Extensions.DependencyInjection.IRemoteAuthenticationBuilder -~static Microsoft.Extensions.DependencyInjection.MsalWebAssemblyServiceCollectionExtensions.AddMsalAuthentication(this Microsoft.Extensions.DependencyInjection.IServiceCollection services, System.Action> configure) -> Microsoft.Extensions.DependencyInjection.IRemoteAuthenticationBuilder +Microsoft.Authentication.WebAssembly.Msal.Models.MsalCacheOptions.CacheLocation.get -> string? +Microsoft.Authentication.WebAssembly.Msal.Models.MsalCacheOptions.CacheLocation.set -> void +Microsoft.Authentication.WebAssembly.Msal.Models.MsalProviderOptions.AdditionalScopesToConsent.get -> System.Collections.Generic.IList! +Microsoft.Authentication.WebAssembly.Msal.Models.MsalProviderOptions.AdditionalScopesToConsent.set -> void +Microsoft.Authentication.WebAssembly.Msal.Models.MsalProviderOptions.Authentication.get -> Microsoft.Authentication.WebAssembly.Msal.MsalAuthenticationOptions! +Microsoft.Authentication.WebAssembly.Msal.Models.MsalProviderOptions.Authentication.set -> void +Microsoft.Authentication.WebAssembly.Msal.Models.MsalProviderOptions.Cache.get -> Microsoft.Authentication.WebAssembly.Msal.Models.MsalCacheOptions! +Microsoft.Authentication.WebAssembly.Msal.Models.MsalProviderOptions.Cache.set -> void +Microsoft.Authentication.WebAssembly.Msal.Models.MsalProviderOptions.DefaultAccessTokenScopes.get -> System.Collections.Generic.IList! +Microsoft.Authentication.WebAssembly.Msal.Models.MsalProviderOptions.DefaultAccessTokenScopes.set -> void +Microsoft.Authentication.WebAssembly.Msal.Models.MsalProviderOptions.LoginMode.get -> string! +Microsoft.Authentication.WebAssembly.Msal.Models.MsalProviderOptions.LoginMode.set -> void +Microsoft.Authentication.WebAssembly.Msal.MsalAuthenticationOptions.Authority.get -> string? +Microsoft.Authentication.WebAssembly.Msal.MsalAuthenticationOptions.Authority.set -> void +Microsoft.Authentication.WebAssembly.Msal.MsalAuthenticationOptions.ClientId.get -> string? +Microsoft.Authentication.WebAssembly.Msal.MsalAuthenticationOptions.ClientId.set -> void +Microsoft.Authentication.WebAssembly.Msal.MsalAuthenticationOptions.KnownAuthorities.get -> System.Collections.Generic.IList! +Microsoft.Authentication.WebAssembly.Msal.MsalAuthenticationOptions.KnownAuthorities.set -> void +Microsoft.Authentication.WebAssembly.Msal.MsalAuthenticationOptions.PostLogoutRedirectUri.get -> string? +Microsoft.Authentication.WebAssembly.Msal.MsalAuthenticationOptions.PostLogoutRedirectUri.set -> void +Microsoft.Authentication.WebAssembly.Msal.MsalAuthenticationOptions.RedirectUri.get -> string? +Microsoft.Authentication.WebAssembly.Msal.MsalAuthenticationOptions.RedirectUri.set -> void +~static Microsoft.Extensions.DependencyInjection.MsalWebAssemblyServiceCollectionExtensions.AddMsalAuthentication(this Microsoft.Extensions.DependencyInjection.IServiceCollection! services, System.Action!>! configure) -> Microsoft.Extensions.DependencyInjection.IRemoteAuthenticationBuilder! +~static Microsoft.Extensions.DependencyInjection.MsalWebAssemblyServiceCollectionExtensions.AddMsalAuthentication(this Microsoft.Extensions.DependencyInjection.IServiceCollection! services, System.Action!>! configure) -> Microsoft.Extensions.DependencyInjection.IRemoteAuthenticationBuilder! +~static Microsoft.Extensions.DependencyInjection.MsalWebAssemblyServiceCollectionExtensions.AddMsalAuthentication(this Microsoft.Extensions.DependencyInjection.IServiceCollection! services, System.Action!>! configure) -> Microsoft.Extensions.DependencyInjection.IRemoteAuthenticationBuilder! Microsoft.Authentication.WebAssembly.Msal.Models.MsalCacheOptions Microsoft.Authentication.WebAssembly.Msal.Models.MsalCacheOptions.MsalCacheOptions() -> void Microsoft.Authentication.WebAssembly.Msal.Models.MsalCacheOptions.StoreAuthStateInCookie.get -> bool