-
Notifications
You must be signed in to change notification settings - Fork 28
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
PAS-392 | Add rate limit bypass (#509)
- Loading branch information
Showing
18 changed files
with
411 additions
and
226 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
namespace Passwordless.Api.Overrides; | ||
|
||
/// <summary> | ||
/// Configures behavior overrides for an application. | ||
/// </summary> | ||
public class ApplicationOverrides | ||
{ | ||
/// <summary> | ||
/// Whether actions on behalf of this application bypass rate limiting. | ||
/// </summary> | ||
public bool IsRateLimitBypassEnabled { get; init; } | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
namespace Passwordless.Api.Overrides; | ||
|
||
/// <summary> | ||
/// Extensions for <see cref="ApplicationOverrides" />. | ||
/// </summary> | ||
public static class ApplicationOverridesExtensions | ||
{ | ||
/// <summary> | ||
/// Gets overrides for the specified application from the configuration. | ||
/// </summary> | ||
public static ApplicationOverrides GetApplicationOverrides( | ||
this IConfiguration configuration, | ||
string applicationId) => | ||
configuration | ||
.GetSection(applicationId) | ||
.Get<ApplicationOverrides>() ?? new ApplicationOverrides(); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.