Skip to content

Commit

Permalink
Remove PII data from workspace
Browse files Browse the repository at this point in the history
  • Loading branch information
reddyashish committed Apr 16, 2024
1 parent fab791b commit b033ec0
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/DynamoMLDataPipeline/DynamoMLDataPipeline.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
using System.Text;
using Dynamo.Logging;
using Dynamo.Models;
using Dynamo.Utilities;
using Greg;
using Newtonsoft.Json;
using Newtonsoft.Json.Linq;
Expand Down Expand Up @@ -63,7 +64,7 @@ internal string ProductionCollectionID
// Id of the user sending the post request.
private string GetUserId()
{
return AuthUserInfoProvider?.UserId;
return AuthUserInfoProvider?.UserId ?? string.Empty;
}

// Authorization token needed for the restsharp post request in this pipeline.
Expand Down Expand Up @@ -160,9 +161,10 @@ static public string ConvertDynToBase64(string filePath)
{
// Read .dyn file as a string
string sourceFileContent = File.ReadAllText(filePath);
string formattedSourceContent = PIIDetector.RemovePIIData(sourceFileContent);

// Convert the string to a byte array (buffer)
byte[] stringBuffer = Encoding.UTF8.GetBytes(sourceFileContent);
byte[] stringBuffer = Encoding.UTF8.GetBytes(formattedSourceContent);

// Compress to gzip and then convert to base64 to optimize size
byte[] compressedBuffer = DataUtilities.Compress(stringBuffer);
Expand Down
4 changes: 4 additions & 0 deletions src/DynamoMLDataPipeline/DynamoMLDataPipeline.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,10 @@
<Project>{7858fa8c-475f-4b8e-b468-1f8200778cf8}</Project>
<Name>DynamoCore</Name>
</ProjectReference>
<ProjectReference Include="..\DynamoUtilities\DynamoUtilities.csproj">
<Project>{B5F435CB-0D8A-40B1-A4F7-5ECB3CE792A9}</Project>
<Name>DynamoUtilities</Name>
</ProjectReference>
</ItemGroup>
<ItemGroup>
<None Include="App.config" />
Expand Down
1 change: 1 addition & 0 deletions src/DynamoUtilities/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
[assembly: InternalsVisibleTo("ProtoScript")]
[assembly: InternalsVisibleTo("ProtoCore")]
[assembly: InternalsVisibleTo("DynamoApplications")]
[assembly: InternalsVisibleTo("DynamoMLDataPipeline")]
[assembly: InternalsVisibleTo("DynamoCLI")]
[assembly: InternalsVisibleTo("NodeDocumentationMarkdownGenerator")]
[assembly: InternalsVisibleTo("DynamoUtilitiesTests")]
Expand Down

0 comments on commit b033ec0

Please sign in to comment.