File tree Expand file tree Collapse file tree 2 files changed +11
-1
lines changed
src/ApiService/ApiService Expand file tree Collapse file tree 2 files changed +11
-1
lines changed Original file line number Diff line number Diff line change 11using System . Net ;
2+ using System . Security . Cryptography ;
3+ using System . Text ;
24using Microsoft . Azure . Functions . Worker ;
35using Microsoft . Azure . Functions . Worker . Http ;
46
@@ -81,6 +83,14 @@ private async Async.Task<HttpResponseData> Post(HttpRequestData req) {
8183 "repro_vm create" ) ;
8284 }
8385
86+ // we’d like to track the usage of this feature;
87+ // anonymize the user ID so we can distinguish multiple requests
88+ {
89+ var data = userInfo . OkV . UserInfo . ToString ( ) ; // rely on record ToString
90+ var hash = Convert . ToBase64String ( SHA256 . HashData ( Encoding . UTF8 . GetBytes ( data ) ) ) ;
91+ _log . Event ( $ "created repro VM, user distinguisher: { hash : Tag:UserHash} ") ;
92+ }
93+
8494 var response = req . CreateResponse ( HttpStatusCode . OK ) ;
8595 await response . WriteAsJsonAsync ( vm . OkV ) ;
8696 return response ;
Original file line number Diff line number Diff line change @@ -12,7 +12,7 @@ namespace Microsoft.OneFuzz.Service;
1212[ InterpolatedStringHandler ]
1313public struct LogStringHandler {
1414
15- private StringBuilder _builder ;
15+ private readonly StringBuilder _builder ;
1616 private Dictionary < string , string > ? _tags ;
1717
1818 public LogStringHandler ( int literalLength , int formattedCount ) {
You can’t perform that action at this time.
0 commit comments