Rewrite DigestMiddleware to use an opt-in instead of opt-out for endpoints

This commit is contained in:
Slendy 2024-02-29 15:27:37 -06:00
commit fd210b3125
No known key found for this signature in database
GPG key ID: 7288D68361B91428
3 changed files with 159 additions and 172 deletions

View file

@ -0,0 +1,11 @@
namespace LBPUnion.ProjectLighthouse.Servers.GameServer.Types;
[AttributeUsage(AttributeTargets.Class | AttributeTargets.Method, AllowMultiple = true)]
public class UseDigestAttribute : Attribute
{
public bool EnforceDigest { get; set; } = true;
public string DigestHeaderName { get; set; } = "X-Digest-A";
public bool ExcludeBodyFromDigest { get; set; } = false;
}