mirror of
https://github.com/bitwarden/server
synced 2026-01-09 03:53:42 +00:00
* Add feature flag * Further establish billing command pattern and use in PreviewTaxAmountCommand * Add billing address models/commands/queries/tests * Update TypeReadingJsonConverter to account for new union types * Add payment method models/commands/queries/tests * Add credit models/commands/queries/tests * Add command/query registrations * Add new endpoints to support new command model and payment functionality * Run dotnet format * Add InjectUserAttribute for easier AccountBillilngVNextController handling * Add InjectOrganizationAttribute for easier OrganizationBillingVNextController handling * Add InjectProviderAttribute for easier ProviderBillingVNextController handling * Add XML documentation for billing command pipeline * Fix StripeConstants post-nullability * More nullability cleanup * Run dotnet format
19 lines
419 B
C#
19 lines
419 B
C#
using System.ComponentModel.DataAnnotations;
|
|
|
|
namespace Bit.Api.Utilities;
|
|
|
|
public class StringMatchesAttribute(params string[]? accepted) : ValidationAttribute
|
|
{
|
|
public override bool IsValid(object? value)
|
|
{
|
|
if (value is not string str ||
|
|
accepted == null ||
|
|
accepted.Length == 0)
|
|
{
|
|
return false;
|
|
}
|
|
|
|
return accepted.Contains(str);
|
|
}
|
|
}
|