diff --git a/src/Passwordless/PasswordlessOptions.cs b/src/Passwordless/PasswordlessOptions.cs index 1748ae5..a686bd1 100644 --- a/src/Passwordless/PasswordlessOptions.cs +++ b/src/Passwordless/PasswordlessOptions.cs @@ -21,7 +21,7 @@ public class PasswordlessOptions /// /// Gets or sets the secret API key used to authenticate with the Passwordless API. /// - public string ApiSecret { get; set; } = default!; + public required string ApiSecret { get; set; } /// /// Gets or sets the public API key used to interact with the Passwordless API. diff --git a/src/Passwordless/Pollyfill.cs b/src/Passwordless/Polyfill.CodeAnalysis.cs similarity index 100% rename from src/Passwordless/Pollyfill.cs rename to src/Passwordless/Polyfill.CodeAnalysis.cs diff --git a/src/Passwordless/Polyfill.CompilerServices.cs b/src/Passwordless/Polyfill.CompilerServices.cs new file mode 100644 index 0000000..e38b458 --- /dev/null +++ b/src/Passwordless/Polyfill.CompilerServices.cs @@ -0,0 +1,36 @@ +namespace System.Runtime.CompilerServices; + +#if !NET5_0_OR_GREATER +// https://learn.microsoft.com/en-us/dotnet/api/system.runtime.compilerservices.isexternalinit +internal static class IsExternalInit { } +#endif + +#if !NET7_0_OR_GREATER +// https://learn.microsoft.com/en-us/dotnet/api/system.runtime.compilerservices.requiredmemberattribute +[AttributeUsage( + AttributeTargets.Class + | AttributeTargets.Field + | AttributeTargets.Property + | AttributeTargets.Struct, + Inherited = false +)] +internal class RequiredMemberAttribute : Attribute { } + +// https://learn.microsoft.com/en-us/dotnet/api/system.runtime.compilerservices.compilerfeaturerequiredattribute +[AttributeUsage(AttributeTargets.All, AllowMultiple = true, Inherited = false)] +internal partial class CompilerFeatureRequiredAttribute : Attribute +{ + public string FeatureName { get; } + + public bool IsOptional { get; init; } + + public CompilerFeatureRequiredAttribute(string featureName) => FeatureName = featureName; +} + +internal partial class CompilerFeatureRequiredAttribute +{ + public const string RefStructs = nameof(RefStructs); + + public const string RequiredMembers = nameof(RequiredMembers); +} +#endif \ No newline at end of file