-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #26 from SimCubeLtd/develop
Add Rate Limit Policy Attribute
- Loading branch information
Showing
5 changed files
with
172 additions
and
48 deletions.
There are no files selected for viewing
20 changes: 20 additions & 0 deletions
20
src/SimCube.Spartan/Attributes/RateLimitPolicyAttribute.cs
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,20 @@ | ||
namespace SimCube.Spartan.Attributes; | ||
|
||
/// <summary> | ||
/// Attribute for Rate Limiting Policy setup on an Endpoint. | ||
/// </summary> | ||
[ExcludeFromCodeCoverage] | ||
[AttributeUsage(AttributeTargets.Class, AllowMultiple = false)] | ||
public sealed class RateLimitPolicyAttribute : Attribute | ||
{ | ||
/// <summary> | ||
/// Initializes a new instance of the <see cref="RateLimitPolicyAttribute"/> class. | ||
/// </summary> | ||
/// <param name="policyName">The Policy Name.</param> | ||
public RateLimitPolicyAttribute(string policyName) => PolicyName = policyName; | ||
|
||
/// <summary> | ||
/// Gets the type of the http request. | ||
/// </summary> | ||
public string PolicyName { get; } | ||
} |
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
Oops, something went wrong.