diff options
author | Rory& <root@rory.gay> | 2024-09-22 20:34:26 +0200 |
---|---|---|
committer | Rory& <root@rory.gay> | 2024-09-22 20:34:26 +0200 |
commit | ba7c369846086133b59af1cee68b2d836589f37a (patch) | |
tree | 127f6112de35681476afc64e9e2e1e5653fb1191 /LibMatrix.EventTypes/Spec | |
parent | Merge branch 'dev/authenticated-media' (diff) | |
download | LibMatrix-ba7c369846086133b59af1cee68b2d836589f37a.tar.xz |
Fixes
Diffstat (limited to 'LibMatrix.EventTypes/Spec')
-rw-r--r-- | LibMatrix.EventTypes/Spec/State/Policy/PolicyRuleStateEventContent.cs | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/LibMatrix.EventTypes/Spec/State/Policy/PolicyRuleStateEventContent.cs b/LibMatrix.EventTypes/Spec/State/Policy/PolicyRuleStateEventContent.cs index 89e2fdb..5bfd77b 100644 --- a/LibMatrix.EventTypes/Spec/State/Policy/PolicyRuleStateEventContent.cs +++ b/LibMatrix.EventTypes/Spec/State/Policy/PolicyRuleStateEventContent.cs @@ -1,5 +1,7 @@ +using System.Security.Cryptography; using System.Text.Json.Serialization; using ArcaneLibs.Attributes; +using ArcaneLibs.Extensions; namespace LibMatrix.EventTypes.Spec.State.Policy; @@ -87,6 +89,8 @@ public abstract class PolicyRuleEventContent : EventContent { Expiry = ((DateTimeOffset)value).ToUnixTimeMilliseconds(); } } + + public string GetDraupnir2StateKey() => Convert.ToBase64String(SHA256.HashData($"{Entity}{Recommendation}".AsBytes().ToArray())); } public static class PolicyRecommendationTypes { |