Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make ApiSecret a required property #40

Merged
merged 1 commit into from
Sep 26, 2023
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
2 changes: 1 addition & 1 deletion src/Passwordless/PasswordlessOptions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ public class PasswordlessOptions
/// <summary>
/// Gets or sets the secret API key used to authenticate with the Passwordless API.
/// </summary>
public string ApiSecret { get; set; } = default!;
public required string ApiSecret { get; set; }

/// <summary>
/// Gets or sets the public API key used to interact with the Passwordless API.
Expand Down
File renamed without changes.
36 changes: 36 additions & 0 deletions src/Passwordless/Polyfill.CompilerServices.cs
Original file line number Diff line number Diff line change
@@ -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
Loading