File tree Expand file tree Collapse file tree 1 file changed +4
-2
lines changed
src/WebJobs.Script.Scaling Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Original file line number Diff line number Diff line change @@ -14,6 +14,8 @@ namespace Microsoft.Azure.WebJobs.Script.Scaling
1414 [ SuppressMessage ( "Microsoft.Naming" , "CA1704:IdentifiersShouldBeSpelledCorrectly" , Justification = "By design" ) ]
1515 public static class ScaleUtils
1616 {
17+ public const string Purpose = "ScaleManager" ;
18+
1719 [ SuppressMessage ( "Microsoft.Naming" , "CA1704:IdentifiersShouldBeSpelledCorrectly" , Justification = "By design" ) ]
1820 public static bool WorkerEquals ( IWorkerInfo src , IWorkerInfo dst )
1921 {
@@ -87,14 +89,14 @@ public static string ToDisplayString(this IEnumerable<string> values)
8789 public static string GetToken ( DateTime expiredUtc )
8890 {
8991 var bytes = BitConverter . GetBytes ( expiredUtc . Ticks ) ;
90- var encrypted = MachineKey . Protect ( bytes ) ;
92+ var encrypted = MachineKey . Protect ( bytes , Purpose ) ;
9193 return Convert . ToBase64String ( encrypted ) ;
9294 }
9395
9496 public static void ValidateToken ( string token )
9597 {
9698 var encrypted = Convert . FromBase64String ( token ) ;
97- var bytes = MachineKey . Unprotect ( encrypted ) ;
99+ var bytes = MachineKey . Unprotect ( encrypted , Purpose ) ;
98100 var ticks = BitConverter . ToInt64 ( bytes , 0 ) ;
99101 var expiredUtc = new DateTime ( ticks , DateTimeKind . Utc ) ;
100102
You can’t perform that action at this time.
0 commit comments