aboutsummaryrefslogtreecommitdiffstats
path: root/Software/Visual_Studio
diff options
context:
space:
mode:
Diffstat (limited to 'Software/Visual_Studio')
-rw-r--r--Software/Visual_Studio/Advanced Installer Projects/Machine Studio Installer.aip5
-rw-r--r--Software/Visual_Studio/Build/Shortcuts/Machine Emulator.lnkbin1471 -> 1445 bytes
-rw-r--r--Software/Visual_Studio/Build/Shortcuts/Proto Compiler GUI.lnkbin1464 -> 1444 bytes
-rw-r--r--Software/Visual_Studio/MachineStudio/Modules/MachineStudio.Dispensers/App.config2
-rw-r--r--Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.ColorLab/app.config2
-rw-r--r--Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/App.config2
-rw-r--r--Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DataCapture/app.config2
-rw-r--r--Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/app.config2
-rw-r--r--Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.HardwareDesigner/app.config2
-rw-r--r--Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Logging/App.config2
-rw-r--r--Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.MachineDesigner/app.config2
-rw-r--r--Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.RML/App.config2
-rw-r--r--Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Statistics/App.config2
-rw-r--r--Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Storage/app.config2
-rw-r--r--Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Stubs/Tango.MachineStudio.Stubs.csproj6
-rw-r--r--Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Stubs/app.config2
-rw-r--r--Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Stubs/packages.config2
-rw-r--r--Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/app.config2
-rw-r--r--Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.UsersAndRoles/Tango.MachineStudio.UsersAndRoles.csproj6
-rw-r--r--Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.UsersAndRoles/app.config2
-rw-r--r--Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.UsersAndRoles/packages.config2
-rw-r--r--Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/Web/CheckForUpdatesRequest.cs2
-rw-r--r--Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/Web/DownloadLatestVersionRequest.cs2
-rw-r--r--Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/Web/MachineStudioWebClient.cs9
-rw-r--r--Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/Web/MachineStudioWebClientBase.cs14
-rw-r--r--Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/Web/UploadCompletedRequest.cs2
-rw-r--r--Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/Web/UploadVersionRequest.cs2
-rw-r--r--Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/app.config2
-rw-r--r--Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Publisher.CLI/App.config2
-rw-r--r--Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Publisher.UI/App.config2
-rw-r--r--Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Publisher.UI/MainWindowVM.cs1
-rw-r--r--Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/App.config2
-rw-r--r--Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Properties/AssemblyInfo.cs2
-rw-r--r--Software/Visual_Studio/Notes/Tango.Notes/Azure/Test User Credentials.txt3
-rw-r--r--Software/Visual_Studio/Notes/Tango.Notes/Tango.Notes.csproj3
-rw-r--r--Software/Visual_Studio/PPC/Modules/Tango.PPC.Events/app.config2
-rw-r--r--Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/app.config2
-rw-r--r--Software/Visual_Studio/PPC/Modules/Tango.PPC.Logging/app.config2
-rw-r--r--Software/Visual_Studio/PPC/Modules/Tango.PPC.MachineSettings/app.config2
-rw-r--r--Software/Visual_Studio/PPC/Modules/Tango.PPC.Power/app.config2
-rw-r--r--Software/Visual_Studio/PPC/Modules/Tango.PPC.Storage/app.config2
-rw-r--r--Software/Visual_Studio/PPC/Tango.PPC.Common/MachineSetup/MachineSetupManager.cs1
-rw-r--r--Software/Visual_Studio/PPC/Tango.PPC.Common/MachineUpdate/MachineUpdateManager.cs3
-rw-r--r--Software/Visual_Studio/PPC/Tango.PPC.Common/Web/CheckForUpdateRequest.cs3
-rw-r--r--Software/Visual_Studio/PPC/Tango.PPC.Common/Web/DownloadUpdateRequest.cs4
-rw-r--r--Software/Visual_Studio/PPC/Tango.PPC.Common/Web/MachineSetupRequest.cs4
-rw-r--r--Software/Visual_Studio/PPC/Tango.PPC.Common/Web/PPCWebClient.cs8
-rw-r--r--Software/Visual_Studio/PPC/Tango.PPC.Common/Web/PPCWebClientBase.cs14
-rw-r--r--Software/Visual_Studio/PPC/Tango.PPC.Common/Web/UpdateDBRequest.cs4
-rw-r--r--Software/Visual_Studio/PPC/Tango.PPC.Common/Web/UploadCompletedRequest.cs2
-rw-r--r--Software/Visual_Studio/PPC/Tango.PPC.Common/Web/UploadVersionRequest.cs2
-rw-r--r--Software/Visual_Studio/PPC/Tango.PPC.Common/app.config2
-rw-r--r--Software/Visual_Studio/PPC/Tango.PPC.Publisher.UI/App.config2
-rw-r--r--Software/Visual_Studio/PPC/Tango.PPC.UI/App.config80
-rw-r--r--Software/Visual_Studio/PPC/Tango.PPC.WatchDog/App.config2
-rw-r--r--Software/Visual_Studio/Tango.BL/ObservablesContextConfiguration.cs17
-rw-r--r--Software/Visual_Studio/Tango.BL/ObservablesContextExtension.cs13
-rw-r--r--Software/Visual_Studio/Tango.BL/Tango.BL.csproj6
-rw-r--r--Software/Visual_Studio/Tango.BL/packages.config2
-rw-r--r--Software/Visual_Studio/Tango.CodeGeneration/Templates/TangoWebClientCodeFile.cshtml15
-rw-r--r--Software/Visual_Studio/Tango.Core/Tango.Core.csproj6
-rw-r--r--Software/Visual_Studio/Tango.Core/packages.config2
-rw-r--r--Software/Visual_Studio/Tango.Emulations/app.config2
-rw-r--r--Software/Visual_Studio/Tango.Integration/Tango.Integration.csproj6
-rw-r--r--Software/Visual_Studio/Tango.Integration/app.config2
-rw-r--r--Software/Visual_Studio/Tango.Integration/packages.config2
-rw-r--r--Software/Visual_Studio/Tango.Serialization/Tango.Serialization.csproj6
-rw-r--r--Software/Visual_Studio/Tango.Serialization/packages.config2
-rw-r--r--Software/Visual_Studio/Tango.Settings/Tango.Settings.csproj6
-rw-r--r--Software/Visual_Studio/Tango.Settings/packages.config2
-rw-r--r--Software/Visual_Studio/Tango.Stubs/Tango.Stubs.csproj6
-rw-r--r--Software/Visual_Studio/Tango.Stubs/app.config2
-rw-r--r--Software/Visual_Studio/Tango.Stubs/packages.config2
-rw-r--r--Software/Visual_Studio/Tango.TFS/Tango.TFS.csproj7
-rw-r--r--Software/Visual_Studio/Tango.TFS/app.config2
-rw-r--r--Software/Visual_Studio/Tango.TFS/packages.config2
-rw-r--r--Software/Visual_Studio/Tango.Transport/Tango.Transport.csproj11
-rw-r--r--Software/Visual_Studio/Tango.Transport/Web/IWebTransportClient.cs1
-rw-r--r--Software/Visual_Studio/Tango.Transport/Web/InvalidTokenException.cs (renamed from Software/Visual_Studio/Tango.Transport/Web/SessionExpiredException.cs)4
-rw-r--r--Software/Visual_Studio/Tango.Transport/Web/TokenExpiredException.cs (renamed from Software/Visual_Studio/Tango.Transport/Web/WebRequestSecureMessage.cs)7
-rw-r--r--Software/Visual_Studio/Tango.Transport/Web/WebTransportClient.cs65
-rw-r--r--Software/Visual_Studio/Tango.Transport/app.config2
-rw-r--r--Software/Visual_Studio/Tango.Transport/packages.config2
-rw-r--r--Software/Visual_Studio/Tango.UnitTesting/App.config2
-rw-r--r--Software/Visual_Studio/Tango.UnitTesting/MachineService/MachineStudio_Controller_TST.cs78
-rw-r--r--Software/Visual_Studio/Tango.UnitTesting/MachineService/PPC_Controller_TST.cs95
-rw-r--r--Software/Visual_Studio/Tango.UnitTesting/MachineService_TST.cs2
-rw-r--r--Software/Visual_Studio/Tango.UnitTesting/Tango.UnitTesting.csproj12
-rw-r--r--Software/Visual_Studio/Tango.UnitTesting/Web/JWT_Tokens_TST.cs69
-rw-r--r--Software/Visual_Studio/Tango.UnitTesting/packages.config3
-rw-r--r--Software/Visual_Studio/Tango.Web/Authentication/TokensManager.cs6
-rw-r--r--Software/Visual_Studio/Tango.Web/Authentication/WebToken.cs151
-rw-r--r--Software/Visual_Studio/Tango.Web/Authentication/WebTokenResponse.cs2
-rw-r--r--Software/Visual_Studio/Tango.Web/Controllers/TangoController.cs (renamed from Software/Visual_Studio/Tango.Web/Controllers/JsonController.cs)61
-rw-r--r--Software/Visual_Studio/Tango.Web/Tango.Web.csproj18
-rw-r--r--Software/Visual_Studio/Tango.Web/TangoWebClient.cs82
-rw-r--r--Software/Visual_Studio/Tango.Web/app.config6
-rw-r--r--Software/Visual_Studio/Tango.Web/packages.config3
-rw-r--r--Software/Visual_Studio/Utilities/Tango.BugReporter/App.config2
-rw-r--r--Software/Visual_Studio/Utilities/Tango.MachineEM.UI/App.config2
-rw-r--r--Software/Visual_Studio/Utilities/Tango.RemoteRunner.UI/App.config2
-rw-r--r--Software/Visual_Studio/Utilities/Tango.Stubs.CLI/App.config2
-rw-r--r--Software/Visual_Studio/Utilities/Tango.Stubs.CLI/Tango.Stubs.CLI.csproj6
-rw-r--r--Software/Visual_Studio/Utilities/Tango.Stubs.CLI/packages.config2
-rw-r--r--Software/Visual_Studio/Utilities/Tango.Stubs.UI/App.config2
-rw-r--r--Software/Visual_Studio/Utilities/Tango.Stubs.UI/Tango.Stubs.UI.csproj6
-rw-r--r--Software/Visual_Studio/Utilities/Tango.Stubs.UI/packages.config2
-rw-r--r--Software/Visual_Studio/Utilities/Tango.TransportRouter.UI/App.config2
-rw-r--r--Software/Visual_Studio/Utilities/Tango.UITests/App.config2
-rw-r--r--Software/Visual_Studio/Utilities/Tango.WebClientGenerator/App.config4
-rw-r--r--Software/Visual_Studio/Utilities/Tango.WebClientGenerator/Program.cs2
-rw-r--r--Software/Visual_Studio/VSIX/Tango.BuildExtensions/app.config2
-rw-r--r--Software/Visual_Studio/Web/Tango.MachineService/App_Start/WebApiConfig.cs8
-rw-r--r--Software/Visual_Studio/Web/Tango.MachineService/Controllers/MachineStudioController.cs26
-rw-r--r--Software/Visual_Studio/Web/Tango.MachineService/Controllers/PPCController.cs42
-rw-r--r--Software/Visual_Studio/Web/Tango.MachineService/Filters/JwtTokenFilter.cs46
-rw-r--r--Software/Visual_Studio/Web/Tango.MachineService/Filters/MachineStudioLoginFilter.cs35
-rw-r--r--Software/Visual_Studio/Web/Tango.MachineService/Filters/PPCLoginFilter.cs35
-rw-r--r--Software/Visual_Studio/Web/Tango.MachineService/MachineServiceConfig.cs1
-rw-r--r--Software/Visual_Studio/Web/Tango.MachineService/Tango.MachineService.csproj12
-rw-r--r--Software/Visual_Studio/Web/Tango.MachineService/Web.config9
-rw-r--r--Software/Visual_Studio/Web/Tango.MachineService/packages.config3
122 files changed, 952 insertions, 335 deletions
diff --git a/Software/Visual_Studio/Advanced Installer Projects/Machine Studio Installer.aip b/Software/Visual_Studio/Advanced Installer Projects/Machine Studio Installer.aip
index a04ca8748..46b47ce70 100644
--- a/Software/Visual_Studio/Advanced Installer Projects/Machine Studio Installer.aip
+++ b/Software/Visual_Studio/Advanced Installer Projects/Machine Studio Installer.aip
@@ -739,6 +739,7 @@
<ROW Property="AI_SETUPEXEPATH" Signature_="AI_EXE_PATH_CU" Builds="DefaultBuild"/>
</COMPONENT>
<COMPONENT cid="caphyon.advinst.msicomp.MsiBinaryComponent">
+ <ROW Name="PowerShellScriptLauncher.dll" SourcePath="&lt;AI_CUSTACTS&gt;PowerShellScriptLauncher.dll"/>
<ROW Name="Prereq.dll" SourcePath="&lt;AI_CUSTACTS&gt;Prereq.dll"/>
<ROW Name="ResourceCleaner.dll" SourcePath="&lt;AI_CUSTACTS&gt;ResourceCleaner.dll"/>
<ROW Name="SoftwareDetector.dll" SourcePath="&lt;AI_CUSTACTS&gt;SoftwareDetector.dll"/>
@@ -783,6 +784,7 @@
<ROW Action="AI_AppSearchEx" Type="1" Source="Prereq.dll" Target="DoAppSearchEx"/>
<ROW Action="AI_BACKUP_AI_SETUPEXEPATH" Type="51" Source="AI_SETUPEXEPATH_ORIGINAL" Target="[AI_SETUPEXEPATH]"/>
<ROW Action="AI_DATA_SETTER" Type="51" Source="AI_ExtractFiles" Target="[AI_SETUPEXEPATH]"/>
+ <ROW Action="AI_DATA_SETTER_1" Type="51" Source="CustomActionData" Target="AEkAcwA2ADQAQgBpAHQAAgABAFAAYQByAGEAbQBzAAIAAQBTAGMAcgBpAHAAdAACACMAIABCAGwAbwBjAGsAIABmAG8AcgAgAGQAZQBjAGwAYQByAGkAbgBnACAAdABoAGUAIABzAGMAcgBpAHAAdAAgAHAAYQByAGEAbQBlAHQAZQByAHMALgANAAoAUABhAHIAYQBtACgAKQANAAoADQAKACMAIABZAG8AdQByACAAYwBvAGQAZQAgAGcAbwBlAHMAIABoAGUAcgBlAC4ADQAKACQAZgBvAGwAZABlAHIAIAA9ACAAJABlAG4AdgA6AEEAUABQAEQAQQBUAEEAIAArACAAIgBcAFQAdwBpAG4AZQBcAFQAYQBuAGcAbwBcAEUARgBDAGEAYwBoAGUAXABUAGEAbgBnAG8ALgBNAGEAYwBoAGkAbgBlAFMAdAB1AGQAaQBvAC4AVQBJACIADQAKAFIAZQBtAG8AdgBlAC0ASQB0AGUAbQAgAC0ATABpAHQAZQByAGEAbABQAGEAdABoACAAJABmAG8AbABkAGUAcgAgAC0ARgBvAHIAYwBlACAALQBSAGUAYwB1AHIAcwBl"/>
<ROW Action="AI_DOWNGRADE" Type="19" Target="4010"/>
<ROW Action="AI_DeleteCadLzma" Type="51" Source="AI_DeleteLzma" Target="[AI_SETUPEXEPATH]"/>
<ROW Action="AI_DeleteLzma" Type="1025" Source="lzmaextractor.dll" Target="DeleteLZMAFiles"/>
@@ -804,6 +806,7 @@
<ROW Action="AI_RunFinishActions" Type="1" Source="aicustact.dll" Target="RunFinishActions" WithoutSeq="true"/>
<ROW Action="AI_SHOW_LOG" Type="65" Source="aicustact.dll" Target="LaunchLogFile" WithoutSeq="true"/>
<ROW Action="AI_STORE_LOCATION" Type="51" Source="ARPINSTALLLOCATION" Target="[APPDIR]"/>
+ <ROW Action="RemoveEfCache" Type="1" Source="PowerShellScriptLauncher.dll" Target="RunPowerShellScript" AdditionalSeq="AI_DATA_SETTER_1"/>
<ROW Action="SET_APPDIR" Type="307" Source="APPDIR" Target="[ProgramFilesFolder][Manufacturer]\[ProductName]"/>
<ROW Action="SET_SHORTCUTDIR" Type="307" Source="SHORTCUTDIR" Target="[ProgramMenuFolder][ProductName]"/>
<ROW Action="SET_TARGETDIR_TO_APPDIR" Type="51" Source="TARGETDIR" Target="[APPDIR]"/>
@@ -831,6 +834,8 @@
<ROW Action="AI_EstimateExtractFiles" Sequence="3999" Builds="DefaultBuild"/>
<ROW Action="AI_AppSearchEx" Sequence="101"/>
<ROW Action="AI_AiRemoveFilesImmediate" Sequence="3499"/>
+ <ROW Action="RemoveEfCache" Condition="( NOT Installed ) AND ( (VersionNT &gt; 501) OR (VersionNT = 501 AND ServicePackLevel &gt;= 2) )" Sequence="5936"/>
+ <ROW Action="AI_DATA_SETTER_1" Condition="( NOT Installed ) AND ( (VersionNT &gt; 501) OR (VersionNT = 501 AND ServicePackLevel &gt;= 2) )" Sequence="5935"/>
</COMPONENT>
<COMPONENT cid="caphyon.advinst.msicomp.MsiInstallUISequenceComponent">
<ROW Action="AI_RESTORE_LOCATION" Condition="APPDIR=&quot;&quot;" Sequence="749"/>
diff --git a/Software/Visual_Studio/Build/Shortcuts/Machine Emulator.lnk b/Software/Visual_Studio/Build/Shortcuts/Machine Emulator.lnk
index 1a45908c4..2edf815e9 100644
--- a/Software/Visual_Studio/Build/Shortcuts/Machine Emulator.lnk
+++ b/Software/Visual_Studio/Build/Shortcuts/Machine Emulator.lnk
Binary files differ
diff --git a/Software/Visual_Studio/Build/Shortcuts/Proto Compiler GUI.lnk b/Software/Visual_Studio/Build/Shortcuts/Proto Compiler GUI.lnk
index cf3225957..6b545ae45 100644
--- a/Software/Visual_Studio/Build/Shortcuts/Proto Compiler GUI.lnk
+++ b/Software/Visual_Studio/Build/Shortcuts/Proto Compiler GUI.lnk
Binary files differ
diff --git a/Software/Visual_Studio/MachineStudio/Modules/MachineStudio.Dispensers/App.config b/Software/Visual_Studio/MachineStudio/Modules/MachineStudio.Dispensers/App.config
index 6a9fc2ba2..825aaae9e 100644
--- a/Software/Visual_Studio/MachineStudio/Modules/MachineStudio.Dispensers/App.config
+++ b/Software/Visual_Studio/MachineStudio/Modules/MachineStudio.Dispensers/App.config
@@ -12,7 +12,7 @@
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="Newtonsoft.Json" publicKeyToken="30ad4fe6b2a6aeed" culture="neutral" />
- <bindingRedirect oldVersion="0.0.0.0-8.0.0.0" newVersion="8.0.0.0" />
+ <bindingRedirect oldVersion="0.0.0.0-9.0.0.0" newVersion="9.0.0.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Collections.Immutable" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.ColorLab/app.config b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.ColorLab/app.config
index b957f7710..96b77fa8f 100644
--- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.ColorLab/app.config
+++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.ColorLab/app.config
@@ -64,7 +64,7 @@
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="Newtonsoft.Json" publicKeyToken="30ad4fe6b2a6aeed" culture="neutral" />
- <bindingRedirect oldVersion="0.0.0.0-8.0.0.0" newVersion="8.0.0.0" />
+ <bindingRedirect oldVersion="0.0.0.0-9.0.0.0" newVersion="9.0.0.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="Microsoft.IdentityModel.Clients.ActiveDirectory" publicKeyToken="31bf3856ad364e35" culture="neutral" />
diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/App.config b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/App.config
index b67f4c16f..7d3d4b2ec 100644
--- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/App.config
+++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/App.config
@@ -70,7 +70,7 @@
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="Newtonsoft.Json" publicKeyToken="30ad4fe6b2a6aeed" culture="neutral" />
- <bindingRedirect oldVersion="0.0.0.0-8.0.0.0" newVersion="8.0.0.0" />
+ <bindingRedirect oldVersion="0.0.0.0-9.0.0.0" newVersion="9.0.0.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="Microsoft.IdentityModel.Clients.ActiveDirectory" publicKeyToken="31bf3856ad364e35" culture="neutral" />
diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DataCapture/app.config b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DataCapture/app.config
index d9be669f7..fa31bbb95 100644
--- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DataCapture/app.config
+++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DataCapture/app.config
@@ -68,7 +68,7 @@
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="Newtonsoft.Json" publicKeyToken="30ad4fe6b2a6aeed" culture="neutral" />
- <bindingRedirect oldVersion="0.0.0.0-8.0.0.0" newVersion="8.0.0.0" />
+ <bindingRedirect oldVersion="0.0.0.0-9.0.0.0" newVersion="9.0.0.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="Microsoft.IdentityModel.Clients.ActiveDirectory" publicKeyToken="31bf3856ad364e35" culture="neutral" />
diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/app.config b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/app.config
index d9be669f7..fa31bbb95 100644
--- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/app.config
+++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/app.config
@@ -68,7 +68,7 @@
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="Newtonsoft.Json" publicKeyToken="30ad4fe6b2a6aeed" culture="neutral" />
- <bindingRedirect oldVersion="0.0.0.0-8.0.0.0" newVersion="8.0.0.0" />
+ <bindingRedirect oldVersion="0.0.0.0-9.0.0.0" newVersion="9.0.0.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="Microsoft.IdentityModel.Clients.ActiveDirectory" publicKeyToken="31bf3856ad364e35" culture="neutral" />
diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.HardwareDesigner/app.config b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.HardwareDesigner/app.config
index b957f7710..96b77fa8f 100644
--- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.HardwareDesigner/app.config
+++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.HardwareDesigner/app.config
@@ -64,7 +64,7 @@
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="Newtonsoft.Json" publicKeyToken="30ad4fe6b2a6aeed" culture="neutral" />
- <bindingRedirect oldVersion="0.0.0.0-8.0.0.0" newVersion="8.0.0.0" />
+ <bindingRedirect oldVersion="0.0.0.0-9.0.0.0" newVersion="9.0.0.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="Microsoft.IdentityModel.Clients.ActiveDirectory" publicKeyToken="31bf3856ad364e35" culture="neutral" />
diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Logging/App.config b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Logging/App.config
index f83cf3eb1..f66a052ae 100644
--- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Logging/App.config
+++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Logging/App.config
@@ -74,7 +74,7 @@
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="Newtonsoft.Json" publicKeyToken="30ad4fe6b2a6aeed" culture="neutral" />
- <bindingRedirect oldVersion="0.0.0.0-8.0.0.0" newVersion="8.0.0.0" />
+ <bindingRedirect oldVersion="0.0.0.0-9.0.0.0" newVersion="9.0.0.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="Microsoft.IdentityModel.Clients.ActiveDirectory" publicKeyToken="31bf3856ad364e35" culture="neutral" />
diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.MachineDesigner/app.config b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.MachineDesigner/app.config
index d9be669f7..fa31bbb95 100644
--- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.MachineDesigner/app.config
+++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.MachineDesigner/app.config
@@ -68,7 +68,7 @@
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="Newtonsoft.Json" publicKeyToken="30ad4fe6b2a6aeed" culture="neutral" />
- <bindingRedirect oldVersion="0.0.0.0-8.0.0.0" newVersion="8.0.0.0" />
+ <bindingRedirect oldVersion="0.0.0.0-9.0.0.0" newVersion="9.0.0.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="Microsoft.IdentityModel.Clients.ActiveDirectory" publicKeyToken="31bf3856ad364e35" culture="neutral" />
diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.RML/App.config b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.RML/App.config
index 48870dbc1..1f0b571a1 100644
--- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.RML/App.config
+++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.RML/App.config
@@ -64,7 +64,7 @@
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="Newtonsoft.Json" publicKeyToken="30ad4fe6b2a6aeed" culture="neutral" />
- <bindingRedirect oldVersion="0.0.0.0-8.0.0.0" newVersion="8.0.0.0" />
+ <bindingRedirect oldVersion="0.0.0.0-9.0.0.0" newVersion="9.0.0.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="Microsoft.IdentityModel.Clients.ActiveDirectory" publicKeyToken="31bf3856ad364e35" culture="neutral" />
diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Statistics/App.config b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Statistics/App.config
index cf8218113..8ea5566ba 100644
--- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Statistics/App.config
+++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Statistics/App.config
@@ -70,7 +70,7 @@
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="Newtonsoft.Json" publicKeyToken="30ad4fe6b2a6aeed" culture="neutral" />
- <bindingRedirect oldVersion="0.0.0.0-8.0.0.0" newVersion="8.0.0.0" />
+ <bindingRedirect oldVersion="0.0.0.0-9.0.0.0" newVersion="9.0.0.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="Microsoft.IdentityModel.Clients.ActiveDirectory" publicKeyToken="31bf3856ad364e35" culture="neutral" />
diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Storage/app.config b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Storage/app.config
index 78d1014dd..354aeba1d 100644
--- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Storage/app.config
+++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Storage/app.config
@@ -64,7 +64,7 @@
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="Newtonsoft.Json" publicKeyToken="30ad4fe6b2a6aeed" culture="neutral" />
- <bindingRedirect oldVersion="0.0.0.0-8.0.0.0" newVersion="8.0.0.0" />
+ <bindingRedirect oldVersion="0.0.0.0-9.0.0.0" newVersion="9.0.0.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="Microsoft.IdentityModel.Clients.ActiveDirectory" publicKeyToken="31bf3856ad364e35" culture="neutral" />
diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Stubs/Tango.MachineStudio.Stubs.csproj b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Stubs/Tango.MachineStudio.Stubs.csproj
index b23f34d86..3c3efdca7 100644
--- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Stubs/Tango.MachineStudio.Stubs.csproj
+++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Stubs/Tango.MachineStudio.Stubs.csproj
@@ -52,8 +52,8 @@
<Reference Include="MaterialDesignThemes.Wpf, Version=2.3.1.953, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\..\..\packages\MaterialDesignThemes.2.3.1.953\lib\net45\MaterialDesignThemes.Wpf.dll</HintPath>
</Reference>
- <Reference Include="Newtonsoft.Json, Version=8.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
- <HintPath>..\..\..\packages\Newtonsoft.Json.8.0.3\lib\net45\Newtonsoft.Json.dll</HintPath>
+ <Reference Include="Newtonsoft.Json, Version=9.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
+ <HintPath>..\..\..\packages\Newtonsoft.Json.9.0.1\lib\net45\Newtonsoft.Json.dll</HintPath>
</Reference>
<Reference Include="System" />
<Reference Include="System.ComponentModel.DataAnnotations" />
@@ -173,7 +173,7 @@
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<ProjectExtensions>
<VisualStudio>
- <UserProperties BuildVersion_AssemblyInfoFilename="Properties\AssemblyInfo.cs" BuildVersion_UpdateAssemblyVersion="True" BuildVersion_BuildVersioningStyle="None.None.Increment.TimeStamp" BuildVersion_UseGlobalSettings="False" BuildVersion_StartDate="2000/1/1" />
+ <UserProperties BuildVersion_StartDate="2000/1/1" BuildVersion_UseGlobalSettings="False" BuildVersion_BuildVersioningStyle="None.None.Increment.TimeStamp" BuildVersion_UpdateAssemblyVersion="True" BuildVersion_AssemblyInfoFilename="Properties\AssemblyInfo.cs" />
</VisualStudio>
</ProjectExtensions>
</Project> \ No newline at end of file
diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Stubs/app.config b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Stubs/app.config
index b957f7710..96b77fa8f 100644
--- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Stubs/app.config
+++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Stubs/app.config
@@ -64,7 +64,7 @@
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="Newtonsoft.Json" publicKeyToken="30ad4fe6b2a6aeed" culture="neutral" />
- <bindingRedirect oldVersion="0.0.0.0-8.0.0.0" newVersion="8.0.0.0" />
+ <bindingRedirect oldVersion="0.0.0.0-9.0.0.0" newVersion="9.0.0.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="Microsoft.IdentityModel.Clients.ActiveDirectory" publicKeyToken="31bf3856ad364e35" culture="neutral" />
diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Stubs/packages.config b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Stubs/packages.config
index 8bf2b7b7d..292525e42 100644
--- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Stubs/packages.config
+++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Stubs/packages.config
@@ -8,5 +8,5 @@
<package id="MahApps.Metro" version="1.5.0" targetFramework="net46" />
<package id="MaterialDesignColors" version="1.1.2" targetFramework="net46" />
<package id="MaterialDesignThemes" version="2.3.1.953" targetFramework="net46" />
- <package id="Newtonsoft.Json" version="8.0.3" targetFramework="net46" />
+ <package id="Newtonsoft.Json" version="9.0.1" targetFramework="net461" />
</packages> \ No newline at end of file
diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/app.config b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/app.config
index b957f7710..96b77fa8f 100644
--- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/app.config
+++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/app.config
@@ -64,7 +64,7 @@
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="Newtonsoft.Json" publicKeyToken="30ad4fe6b2a6aeed" culture="neutral" />
- <bindingRedirect oldVersion="0.0.0.0-8.0.0.0" newVersion="8.0.0.0" />
+ <bindingRedirect oldVersion="0.0.0.0-9.0.0.0" newVersion="9.0.0.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="Microsoft.IdentityModel.Clients.ActiveDirectory" publicKeyToken="31bf3856ad364e35" culture="neutral" />
diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.UsersAndRoles/Tango.MachineStudio.UsersAndRoles.csproj b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.UsersAndRoles/Tango.MachineStudio.UsersAndRoles.csproj
index 897486454..3b14fd13c 100644
--- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.UsersAndRoles/Tango.MachineStudio.UsersAndRoles.csproj
+++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.UsersAndRoles/Tango.MachineStudio.UsersAndRoles.csproj
@@ -46,8 +46,8 @@
<Reference Include="MaterialDesignThemes.Wpf, Version=2.3.1.953, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\..\..\packages\MaterialDesignThemes.2.3.1.953\lib\net45\MaterialDesignThemes.Wpf.dll</HintPath>
</Reference>
- <Reference Include="Newtonsoft.Json, Version=8.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
- <HintPath>..\..\..\packages\Newtonsoft.Json.8.0.3\lib\net45\Newtonsoft.Json.dll</HintPath>
+ <Reference Include="Newtonsoft.Json, Version=9.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
+ <HintPath>..\..\..\packages\Newtonsoft.Json.9.0.1\lib\net45\Newtonsoft.Json.dll</HintPath>
</Reference>
<Reference Include="System" />
<Reference Include="System.ComponentModel.DataAnnotations" />
@@ -210,7 +210,7 @@
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<ProjectExtensions>
<VisualStudio>
- <UserProperties BuildVersion_StartDate="2000/1/1" BuildVersion_UseGlobalSettings="False" BuildVersion_BuildVersioningStyle="None.None.Increment.TimeStamp" BuildVersion_UpdateAssemblyVersion="True" BuildVersion_AssemblyInfoFilename="Properties\AssemblyInfo.cs" />
+ <UserProperties BuildVersion_AssemblyInfoFilename="Properties\AssemblyInfo.cs" BuildVersion_UpdateAssemblyVersion="True" BuildVersion_BuildVersioningStyle="None.None.Increment.TimeStamp" BuildVersion_UseGlobalSettings="False" BuildVersion_StartDate="2000/1/1" />
</VisualStudio>
</ProjectExtensions>
</Project> \ No newline at end of file
diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.UsersAndRoles/app.config b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.UsersAndRoles/app.config
index 78d1014dd..354aeba1d 100644
--- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.UsersAndRoles/app.config
+++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.UsersAndRoles/app.config
@@ -64,7 +64,7 @@
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="Newtonsoft.Json" publicKeyToken="30ad4fe6b2a6aeed" culture="neutral" />
- <bindingRedirect oldVersion="0.0.0.0-8.0.0.0" newVersion="8.0.0.0" />
+ <bindingRedirect oldVersion="0.0.0.0-9.0.0.0" newVersion="9.0.0.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="Microsoft.IdentityModel.Clients.ActiveDirectory" publicKeyToken="31bf3856ad364e35" culture="neutral" />
diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.UsersAndRoles/packages.config b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.UsersAndRoles/packages.config
index 12270c85d..fe4f26e87 100644
--- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.UsersAndRoles/packages.config
+++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.UsersAndRoles/packages.config
@@ -6,5 +6,5 @@
<package id="MahApps.Metro" version="1.5.0" targetFramework="net46" />
<package id="MaterialDesignColors" version="1.1.2" targetFramework="net46" />
<package id="MaterialDesignThemes" version="2.3.1.953" targetFramework="net46" />
- <package id="Newtonsoft.Json" version="8.0.3" targetFramework="net46" />
+ <package id="Newtonsoft.Json" version="9.0.1" targetFramework="net461" />
</packages> \ No newline at end of file
diff --git a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/Web/CheckForUpdatesRequest.cs b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/Web/CheckForUpdatesRequest.cs
index 4f9576f50..84616c607 100644
--- a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/Web/CheckForUpdatesRequest.cs
+++ b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/Web/CheckForUpdatesRequest.cs
@@ -8,7 +8,7 @@ using Tango.Transport.Web;
namespace Tango.MachineStudio.Common.Web
{
- public class CheckForUpdatesRequest : WebRequestSecureMessage
+ public class CheckForUpdatesRequest : WebRequestMessage
{
public String Version { get; set; }
}
diff --git a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/Web/DownloadLatestVersionRequest.cs b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/Web/DownloadLatestVersionRequest.cs
index d63654726..e0a47041c 100644
--- a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/Web/DownloadLatestVersionRequest.cs
+++ b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/Web/DownloadLatestVersionRequest.cs
@@ -7,7 +7,7 @@ using Tango.Transport.Web;
namespace Tango.MachineStudio.Common.Web
{
- public class DownloadLatestVersionRequest : WebRequestSecureMessage
+ public class DownloadLatestVersionRequest : WebRequestMessage
{
}
diff --git a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/Web/MachineStudioWebClient.cs b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/Web/MachineStudioWebClient.cs
index 02276d641..7938e1a17 100644
--- a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/Web/MachineStudioWebClient.cs
+++ b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/Web/MachineStudioWebClient.cs
@@ -15,12 +15,17 @@ namespace Tango.MachineStudio.Common.Web
{
}
- public MachineStudioWebClient(DeploymentSlot environment, WebToken token) : base(environment, token)
+ public MachineStudioWebClient(DeploymentSlot environment, String token) : base(environment, token)
{
}
- public MachineStudioWebClient(WebToken token) : this(SettingsManager.Default.GetOrCreate<MachineStudioSettings>().DeploymentSlot, token)
+ public MachineStudioWebClient(String token) : this(SettingsManager.Default.GetOrCreate<MachineStudioSettings>().DeploymentSlot, token)
+ {
+
+ }
+
+ public MachineStudioWebClient(string address, string token) : base(address, token)
{
}
diff --git a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/Web/MachineStudioWebClientBase.cs b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/Web/MachineStudioWebClientBase.cs
index dc5a14856..62a57ad93 100644
--- a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/Web/MachineStudioWebClientBase.cs
+++ b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/Web/MachineStudioWebClientBase.cs
@@ -1,7 +1,7 @@
+using System;
using System.Threading.Tasks;
using Tango.Web;
-using Tango.Web.Authentication;
namespace Tango.MachineStudio.Common.Web
{
@@ -16,7 +16,7 @@ namespace Tango.MachineStudio.Common.Web
/// </summary>
/// <param name="environment">The environment.</param>
/// <param name="token">Existing token.</param>
- public MachineStudioWebClientBase(DeploymentSlot environment, WebToken token) : base(environment, "MachineStudio", token)
+ public MachineStudioWebClientBase(DeploymentSlot environment, String token) : base(environment, "MachineStudio", token)
{
}
@@ -31,6 +31,16 @@ namespace Tango.MachineStudio.Common.Web
}
/// <summary>
+ /// Initializes a new instance of the <see cref="MachineStudioWebClientBase"/> class.
+ /// </summary>
+ /// <param name="address">The service address.</param>
+ /// <param name="token">Existing token.</param>
+ public MachineStudioWebClientBase(String address, String token) : base(address, "MachineStudio", token)
+ {
+
+ }
+
+ /// <summary>
/// Executes the CheckForUpdates action and returns Tango.MachineStudio.Common.Web.CheckForUpdatesResponse.
/// </summary>
/// <returns></returns>
diff --git a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/Web/UploadCompletedRequest.cs b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/Web/UploadCompletedRequest.cs
index 48f5b2a6e..c85dd3ace 100644
--- a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/Web/UploadCompletedRequest.cs
+++ b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/Web/UploadCompletedRequest.cs
@@ -8,7 +8,7 @@ using Tango.Transport.Web;
namespace Tango.MachineStudio.Common.Web
{
- public class UploadCompletedRequest : WebRequestSecureMessage
+ public class UploadCompletedRequest : WebRequestMessage
{
public String Token { get; set; }
}
diff --git a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/Web/UploadVersionRequest.cs b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/Web/UploadVersionRequest.cs
index 33577deb2..d27f48648 100644
--- a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/Web/UploadVersionRequest.cs
+++ b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/Web/UploadVersionRequest.cs
@@ -8,7 +8,7 @@ using Tango.Transport.Web;
namespace Tango.MachineStudio.Common.Web
{
- public class UploadVersionRequest : WebRequestSecureMessage
+ public class UploadVersionRequest : WebRequestMessage
{
public String Version { get; set; }
diff --git a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/app.config b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/app.config
index d9be669f7..fa31bbb95 100644
--- a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/app.config
+++ b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/app.config
@@ -68,7 +68,7 @@
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="Newtonsoft.Json" publicKeyToken="30ad4fe6b2a6aeed" culture="neutral" />
- <bindingRedirect oldVersion="0.0.0.0-8.0.0.0" newVersion="8.0.0.0" />
+ <bindingRedirect oldVersion="0.0.0.0-9.0.0.0" newVersion="9.0.0.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="Microsoft.IdentityModel.Clients.ActiveDirectory" publicKeyToken="31bf3856ad364e35" culture="neutral" />
diff --git a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Publisher.CLI/App.config b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Publisher.CLI/App.config
index f08d9fd45..25105196d 100644
--- a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Publisher.CLI/App.config
+++ b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Publisher.CLI/App.config
@@ -23,7 +23,7 @@
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="Newtonsoft.Json" publicKeyToken="30ad4fe6b2a6aeed" culture="neutral" />
- <bindingRedirect oldVersion="0.0.0.0-8.0.0.0" newVersion="8.0.0.0" />
+ <bindingRedirect oldVersion="0.0.0.0-9.0.0.0" newVersion="9.0.0.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Collections.Immutable" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
diff --git a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Publisher.UI/App.config b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Publisher.UI/App.config
index 6818e3328..26a23dcd0 100644
--- a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Publisher.UI/App.config
+++ b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Publisher.UI/App.config
@@ -71,7 +71,7 @@
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="Newtonsoft.Json" publicKeyToken="30ad4fe6b2a6aeed" culture="neutral" />
- <bindingRedirect oldVersion="0.0.0.0-8.0.0.0" newVersion="8.0.0.0" />
+ <bindingRedirect oldVersion="0.0.0.0-9.0.0.0" newVersion="9.0.0.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="Microsoft.IdentityModel.Clients.ActiveDirectory" publicKeyToken="31bf3856ad364e35" culture="neutral" />
diff --git a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Publisher.UI/MainWindowVM.cs b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Publisher.UI/MainWindowVM.cs
index e62f29403..e227c0904 100644
--- a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Publisher.UI/MainWindowVM.cs
+++ b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Publisher.UI/MainWindowVM.cs
@@ -103,6 +103,7 @@ namespace Tango.MachineStudio.Publisher.UI
IsFree = false;
await _publisher.Publish();
ShowInfo("Version published successfully.");
+ UpdateVersions();
}
catch (Exception ex)
{
diff --git a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/App.config b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/App.config
index 662ab4bf6..36619a25b 100644
--- a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/App.config
+++ b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/App.config
@@ -74,7 +74,7 @@
</dependentAssembly>-->
<dependentAssembly>
<assemblyIdentity name="Newtonsoft.Json" publicKeyToken="30ad4fe6b2a6aeed" culture="neutral" />
- <bindingRedirect oldVersion="0.0.0.0-8.0.0.0" newVersion="8.0.0.0" />
+ <bindingRedirect oldVersion="0.0.0.0-9.0.0.0" newVersion="9.0.0.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="Microsoft.IdentityModel.Clients.ActiveDirectory" publicKeyToken="31bf3856ad364e35" culture="neutral" />
diff --git a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Properties/AssemblyInfo.cs b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Properties/AssemblyInfo.cs
index f6386cfc9..bceaaf956 100644
--- a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Properties/AssemblyInfo.cs
+++ b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Properties/AssemblyInfo.cs
@@ -4,5 +4,5 @@ using System.Runtime.InteropServices;
[assembly: System.Windows.ThemeInfo(System.Windows.ResourceDictionaryLocation.None, System.Windows.ResourceDictionaryLocation.SourceAssembly)]
[assembly: AssemblyTitle("Tango - Machine Studio")]
-[assembly: AssemblyVersion("4.0.8.0")]
+[assembly: AssemblyVersion("4.0.7.0")]
[assembly: ComVisible(false)] \ No newline at end of file
diff --git a/Software/Visual_Studio/Notes/Tango.Notes/Azure/Test User Credentials.txt b/Software/Visual_Studio/Notes/Tango.Notes/Azure/Test User Credentials.txt
new file mode 100644
index 000000000..c7b78ddf0
--- /dev/null
+++ b/Software/Visual_Studio/Notes/Tango.Notes/Azure/Test User Credentials.txt
@@ -0,0 +1,3 @@
+TestUser@twine-s.com
+
+ASJH_asdjkl1234 \ No newline at end of file
diff --git a/Software/Visual_Studio/Notes/Tango.Notes/Tango.Notes.csproj b/Software/Visual_Studio/Notes/Tango.Notes/Tango.Notes.csproj
index 15e72865b..e2f081fd0 100644
--- a/Software/Visual_Studio/Notes/Tango.Notes/Tango.Notes.csproj
+++ b/Software/Visual_Studio/Notes/Tango.Notes/Tango.Notes.csproj
@@ -44,6 +44,7 @@
</ItemGroup>
<ItemGroup>
<Content Include="Advanced Installer\License.txt" />
+ <Content Include="Azure\Test User Credentials.txt" />
<Content Include="Azure\SQL Database.txt" />
<Content Include="PPC\Remote Debugging.txt" />
<Content Include="PPC\Virtual Flash Drive.txt" />
@@ -55,7 +56,7 @@
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<ProjectExtensions>
<VisualStudio>
- <UserProperties BuildVersion_StartDate="2000/1/1" BuildVersion_UseGlobalSettings="False" BuildVersion_BuildVersioningStyle="None.None.Increment.TimeStamp" BuildVersion_UpdateAssemblyVersion="True" BuildVersion_AssemblyInfoFilename="Properties\AssemblyInfo.cs" />
+ <UserProperties BuildVersion_AssemblyInfoFilename="Properties\AssemblyInfo.cs" BuildVersion_UpdateAssemblyVersion="True" BuildVersion_BuildVersioningStyle="None.None.Increment.TimeStamp" BuildVersion_UseGlobalSettings="False" BuildVersion_StartDate="2000/1/1" />
</VisualStudio>
</ProjectExtensions>
</Project> \ No newline at end of file
diff --git a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Events/app.config b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Events/app.config
index 205fb2c55..cca4bcfd8 100644
--- a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Events/app.config
+++ b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Events/app.config
@@ -52,7 +52,7 @@
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="Newtonsoft.Json" publicKeyToken="30ad4fe6b2a6aeed" culture="neutral" />
- <bindingRedirect oldVersion="0.0.0.0-8.0.0.0" newVersion="8.0.0.0" />
+ <bindingRedirect oldVersion="0.0.0.0-9.0.0.0" newVersion="9.0.0.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="Microsoft.Data.Edm" publicKeyToken="31bf3856ad364e35" culture="neutral" />
diff --git a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/app.config b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/app.config
index 8c8385399..bce416708 100644
--- a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/app.config
+++ b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/app.config
@@ -56,7 +56,7 @@
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="Newtonsoft.Json" publicKeyToken="30ad4fe6b2a6aeed" culture="neutral" />
- <bindingRedirect oldVersion="0.0.0.0-8.0.0.0" newVersion="8.0.0.0" />
+ <bindingRedirect oldVersion="0.0.0.0-9.0.0.0" newVersion="9.0.0.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="Microsoft.Data.Edm" publicKeyToken="31bf3856ad364e35" culture="neutral" />
diff --git a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Logging/app.config b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Logging/app.config
index 8ad04b77c..f47375ba5 100644
--- a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Logging/app.config
+++ b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Logging/app.config
@@ -48,7 +48,7 @@
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="Newtonsoft.Json" publicKeyToken="30ad4fe6b2a6aeed" culture="neutral" />
- <bindingRedirect oldVersion="0.0.0.0-8.0.0.0" newVersion="8.0.0.0" />
+ <bindingRedirect oldVersion="0.0.0.0-9.0.0.0" newVersion="9.0.0.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="Microsoft.Data.Edm" publicKeyToken="31bf3856ad364e35" culture="neutral" />
diff --git a/Software/Visual_Studio/PPC/Modules/Tango.PPC.MachineSettings/app.config b/Software/Visual_Studio/PPC/Modules/Tango.PPC.MachineSettings/app.config
index 8c8385399..bce416708 100644
--- a/Software/Visual_Studio/PPC/Modules/Tango.PPC.MachineSettings/app.config
+++ b/Software/Visual_Studio/PPC/Modules/Tango.PPC.MachineSettings/app.config
@@ -56,7 +56,7 @@
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="Newtonsoft.Json" publicKeyToken="30ad4fe6b2a6aeed" culture="neutral" />
- <bindingRedirect oldVersion="0.0.0.0-8.0.0.0" newVersion="8.0.0.0" />
+ <bindingRedirect oldVersion="0.0.0.0-9.0.0.0" newVersion="9.0.0.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="Microsoft.Data.Edm" publicKeyToken="31bf3856ad364e35" culture="neutral" />
diff --git a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Power/app.config b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Power/app.config
index 392cc7969..15c81fa4b 100644
--- a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Power/app.config
+++ b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Power/app.config
@@ -64,7 +64,7 @@
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="Newtonsoft.Json" publicKeyToken="30ad4fe6b2a6aeed" culture="neutral" />
- <bindingRedirect oldVersion="0.0.0.0-8.0.0.0" newVersion="8.0.0.0" />
+ <bindingRedirect oldVersion="0.0.0.0-9.0.0.0" newVersion="9.0.0.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="Microsoft.IdentityModel.Clients.ActiveDirectory" publicKeyToken="31bf3856ad364e35" culture="neutral" />
diff --git a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Storage/app.config b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Storage/app.config
index 80ba81455..8d7f1b8a7 100644
--- a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Storage/app.config
+++ b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Storage/app.config
@@ -48,7 +48,7 @@
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="Newtonsoft.Json" publicKeyToken="30ad4fe6b2a6aeed" culture="neutral" />
- <bindingRedirect oldVersion="0.0.0.0-8.0.0.0" newVersion="8.0.0.0" />
+ <bindingRedirect oldVersion="0.0.0.0-9.0.0.0" newVersion="9.0.0.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Reactive.Core" publicKeyToken="94bc3704cddfc263" culture="neutral" />
diff --git a/Software/Visual_Studio/PPC/Tango.PPC.Common/MachineSetup/MachineSetupManager.cs b/Software/Visual_Studio/PPC/Tango.PPC.Common/MachineSetup/MachineSetupManager.cs
index 369248c7b..fa9c95742 100644
--- a/Software/Visual_Studio/PPC/Tango.PPC.Common/MachineSetup/MachineSetupManager.cs
+++ b/Software/Visual_Studio/PPC/Tango.PPC.Common/MachineSetup/MachineSetupManager.cs
@@ -130,6 +130,7 @@ namespace Tango.PPC.Common.MachineSetup
Login(serialNumber).Wait();
MachineSetupRequest request = new MachineSetupRequest();
+ request.SerialNumber = serialNumber;
MachineSetupResponse setup_response = null;
diff --git a/Software/Visual_Studio/PPC/Tango.PPC.Common/MachineUpdate/MachineUpdateManager.cs b/Software/Visual_Studio/PPC/Tango.PPC.Common/MachineUpdate/MachineUpdateManager.cs
index 8b9aede87..6fd53bce2 100644
--- a/Software/Visual_Studio/PPC/Tango.PPC.Common/MachineUpdate/MachineUpdateManager.cs
+++ b/Software/Visual_Studio/PPC/Tango.PPC.Common/MachineUpdate/MachineUpdateManager.cs
@@ -130,6 +130,7 @@ namespace Tango.PPC.Common.MachineUpdate
await Login(serialNumber);
DownloadUpdateRequest request = new DownloadUpdateRequest();
+ request.SerialNumber = serialNumber;
DownloadUpdateResponse update_response = null;
@@ -298,6 +299,7 @@ namespace Tango.PPC.Common.MachineUpdate
LogManager.Log($"Checking if updates available...");
CheckForUpdateRequest request = new CheckForUpdateRequest();
+ request.SerialNumber = serialNumber;
request.Version = _app_manager.Version.ToString();
CheckForUpdateResponse update_response = null;
@@ -408,6 +410,7 @@ namespace Tango.PPC.Common.MachineUpdate
Login(serialNumber).Wait();
UpdateDBRequest request = new UpdateDBRequest();
+ request.SerialNumber = serialNumber;
UpdateDBResponse update_response = null;
diff --git a/Software/Visual_Studio/PPC/Tango.PPC.Common/Web/CheckForUpdateRequest.cs b/Software/Visual_Studio/PPC/Tango.PPC.Common/Web/CheckForUpdateRequest.cs
index 8bb8cde54..b98848e4f 100644
--- a/Software/Visual_Studio/PPC/Tango.PPC.Common/Web/CheckForUpdateRequest.cs
+++ b/Software/Visual_Studio/PPC/Tango.PPC.Common/Web/CheckForUpdateRequest.cs
@@ -7,8 +7,9 @@ using Tango.Transport.Web;
namespace Tango.PPC.Common.Web
{
- public class CheckForUpdateRequest : WebRequestSecureMessage
+ public class CheckForUpdateRequest : WebRequestMessage
{
+ public String SerialNumber { get; set; }
public String Version { get; set; }
}
}
diff --git a/Software/Visual_Studio/PPC/Tango.PPC.Common/Web/DownloadUpdateRequest.cs b/Software/Visual_Studio/PPC/Tango.PPC.Common/Web/DownloadUpdateRequest.cs
index 20d1da3ec..a32d3d497 100644
--- a/Software/Visual_Studio/PPC/Tango.PPC.Common/Web/DownloadUpdateRequest.cs
+++ b/Software/Visual_Studio/PPC/Tango.PPC.Common/Web/DownloadUpdateRequest.cs
@@ -7,8 +7,8 @@ using Tango.Transport.Web;
namespace Tango.PPC.Common.Web
{
- public class DownloadUpdateRequest : WebRequestSecureMessage
+ public class DownloadUpdateRequest : WebRequestMessage
{
-
+ public String SerialNumber { get; set; }
}
}
diff --git a/Software/Visual_Studio/PPC/Tango.PPC.Common/Web/MachineSetupRequest.cs b/Software/Visual_Studio/PPC/Tango.PPC.Common/Web/MachineSetupRequest.cs
index ce8b2f58d..83bec6b07 100644
--- a/Software/Visual_Studio/PPC/Tango.PPC.Common/Web/MachineSetupRequest.cs
+++ b/Software/Visual_Studio/PPC/Tango.PPC.Common/Web/MachineSetupRequest.cs
@@ -7,8 +7,8 @@ using Tango.Transport.Web;
namespace Tango.PPC.Common.Web
{
- public class MachineSetupRequest : WebRequestSecureMessage
+ public class MachineSetupRequest : WebRequestMessage
{
-
+ public String SerialNumber { get; set; }
}
}
diff --git a/Software/Visual_Studio/PPC/Tango.PPC.Common/Web/PPCWebClient.cs b/Software/Visual_Studio/PPC/Tango.PPC.Common/Web/PPCWebClient.cs
index 5900dd697..4897efc90 100644
--- a/Software/Visual_Studio/PPC/Tango.PPC.Common/Web/PPCWebClient.cs
+++ b/Software/Visual_Studio/PPC/Tango.PPC.Common/Web/PPCWebClient.cs
@@ -15,16 +15,20 @@ namespace Tango.PPC.Common.Web
{
}
- public PPCWebClient(DeploymentSlot environment, WebToken token) : base(environment, token)
+ public PPCWebClient(DeploymentSlot environment, string token) : base(environment, token)
{
}
- public PPCWebClient(WebToken token) : this(SettingsManager.Default.GetOrCreate<PPCSettings>().DeploymentSlot, token)
+ public PPCWebClient(string token) : this(SettingsManager.Default.GetOrCreate<PPCSettings>().DeploymentSlot, token)
{
}
public PPCWebClient() : this(null)
{
}
+
+ public PPCWebClient(string address, string token) : base(address, token)
+ {
+ }
}
}
diff --git a/Software/Visual_Studio/PPC/Tango.PPC.Common/Web/PPCWebClientBase.cs b/Software/Visual_Studio/PPC/Tango.PPC.Common/Web/PPCWebClientBase.cs
index e5c1beb4a..723e3ffc4 100644
--- a/Software/Visual_Studio/PPC/Tango.PPC.Common/Web/PPCWebClientBase.cs
+++ b/Software/Visual_Studio/PPC/Tango.PPC.Common/Web/PPCWebClientBase.cs
@@ -1,7 +1,7 @@
+using System;
using System.Threading.Tasks;
using Tango.Web;
-using Tango.Web.Authentication;
namespace Tango.PPC.Common.Web
{
@@ -16,7 +16,7 @@ namespace Tango.PPC.Common.Web
/// </summary>
/// <param name="environment">The environment.</param>
/// <param name="token">Existing token.</param>
- public PPCWebClientBase(DeploymentSlot environment, WebToken token) : base(environment, "PPC", token)
+ public PPCWebClientBase(DeploymentSlot environment, String token) : base(environment, "PPC", token)
{
}
@@ -31,6 +31,16 @@ namespace Tango.PPC.Common.Web
}
/// <summary>
+ /// Initializes a new instance of the <see cref="PPCWebClientBase"/> class.
+ /// </summary>
+ /// <param name="address">The service address.</param>
+ /// <param name="token">Existing token.</param>
+ public PPCWebClientBase(String address, String token) : base(address, "PPC", token)
+ {
+
+ }
+
+ /// <summary>
/// Executes the MachineSetup action and returns Tango.PPC.Common.Web.MachineSetupResponse.
/// </summary>
/// <returns></returns>
diff --git a/Software/Visual_Studio/PPC/Tango.PPC.Common/Web/UpdateDBRequest.cs b/Software/Visual_Studio/PPC/Tango.PPC.Common/Web/UpdateDBRequest.cs
index 4c9714970..f3b4ccb34 100644
--- a/Software/Visual_Studio/PPC/Tango.PPC.Common/Web/UpdateDBRequest.cs
+++ b/Software/Visual_Studio/PPC/Tango.PPC.Common/Web/UpdateDBRequest.cs
@@ -7,8 +7,8 @@ using Tango.Transport.Web;
namespace Tango.PPC.Common.Web
{
- public class UpdateDBRequest : WebRequestSecureMessage
+ public class UpdateDBRequest : WebRequestMessage
{
-
+ public String SerialNumber { get; set; }
}
}
diff --git a/Software/Visual_Studio/PPC/Tango.PPC.Common/Web/UploadCompletedRequest.cs b/Software/Visual_Studio/PPC/Tango.PPC.Common/Web/UploadCompletedRequest.cs
index f9674f6c5..b51612603 100644
--- a/Software/Visual_Studio/PPC/Tango.PPC.Common/Web/UploadCompletedRequest.cs
+++ b/Software/Visual_Studio/PPC/Tango.PPC.Common/Web/UploadCompletedRequest.cs
@@ -8,7 +8,7 @@ using Tango.Transport.Web;
namespace Tango.PPC.Common.Web
{
- public class UploadCompletedRequest : WebRequestSecureMessage
+ public class UploadCompletedRequest : WebRequestMessage
{
public String Token { get; set; }
}
diff --git a/Software/Visual_Studio/PPC/Tango.PPC.Common/Web/UploadVersionRequest.cs b/Software/Visual_Studio/PPC/Tango.PPC.Common/Web/UploadVersionRequest.cs
index 68643bfe7..d75a94300 100644
--- a/Software/Visual_Studio/PPC/Tango.PPC.Common/Web/UploadVersionRequest.cs
+++ b/Software/Visual_Studio/PPC/Tango.PPC.Common/Web/UploadVersionRequest.cs
@@ -8,7 +8,7 @@ using Tango.Transport.Web;
namespace Tango.PPC.Common.Web
{
- public class UploadVersionRequest : WebRequestSecureMessage
+ public class UploadVersionRequest : WebRequestMessage
{
public String Version { get; set; }
diff --git a/Software/Visual_Studio/PPC/Tango.PPC.Common/app.config b/Software/Visual_Studio/PPC/Tango.PPC.Common/app.config
index 976aaf83b..24626938a 100644
--- a/Software/Visual_Studio/PPC/Tango.PPC.Common/app.config
+++ b/Software/Visual_Studio/PPC/Tango.PPC.Common/app.config
@@ -56,7 +56,7 @@
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="Newtonsoft.Json" publicKeyToken="30ad4fe6b2a6aeed" culture="neutral" />
- <bindingRedirect oldVersion="0.0.0.0-8.0.0.0" newVersion="8.0.0.0" />
+ <bindingRedirect oldVersion="0.0.0.0-9.0.0.0" newVersion="9.0.0.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="Microsoft.Data.Edm" publicKeyToken="31bf3856ad364e35" culture="neutral" />
diff --git a/Software/Visual_Studio/PPC/Tango.PPC.Publisher.UI/App.config b/Software/Visual_Studio/PPC/Tango.PPC.Publisher.UI/App.config
index e8039e63f..4b93a7127 100644
--- a/Software/Visual_Studio/PPC/Tango.PPC.Publisher.UI/App.config
+++ b/Software/Visual_Studio/PPC/Tango.PPC.Publisher.UI/App.config
@@ -65,7 +65,7 @@
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="Newtonsoft.Json" publicKeyToken="30ad4fe6b2a6aeed" culture="neutral" />
- <bindingRedirect oldVersion="0.0.0.0-8.0.0.0" newVersion="8.0.0.0" />
+ <bindingRedirect oldVersion="0.0.0.0-9.0.0.0" newVersion="9.0.0.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="Microsoft.Data.Edm" publicKeyToken="31bf3856ad364e35" culture="neutral" />
diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/App.config b/Software/Visual_Studio/PPC/Tango.PPC.UI/App.config
index ea49af905..15a7107bd 100644
--- a/Software/Visual_Studio/PPC/Tango.PPC.UI/App.config
+++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/App.config
@@ -11,6 +11,86 @@
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
+ <dependentAssembly>
+ <assemblyIdentity name="System.Collections.Immutable" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
+ <bindingRedirect oldVersion="0.0.0.0-1.2.2.0" newVersion="1.2.2.0" />
+ </dependentAssembly>
+ <dependentAssembly>
+ <assemblyIdentity name="System.Reflection.Metadata" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
+ <bindingRedirect oldVersion="0.0.0.0-1.4.2.0" newVersion="1.4.2.0" />
+ </dependentAssembly>
+ <dependentAssembly>
+ <assemblyIdentity name="System.IO.FileSystem" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
+ <bindingRedirect oldVersion="0.0.0.0-4.0.2.0" newVersion="4.0.2.0" />
+ </dependentAssembly>
+ <dependentAssembly>
+ <assemblyIdentity name="System.ValueTuple" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral" />
+ <bindingRedirect oldVersion="0.0.0.0-4.0.2.0" newVersion="4.0.2.0" />
+ </dependentAssembly>
+ <dependentAssembly>
+ <assemblyIdentity name="System.IO.Compression" publicKeyToken="b77a5c561934e089" culture="neutral" />
+ <bindingRedirect oldVersion="0.0.0.0-4.1.2.0" newVersion="4.1.2.0" />
+ </dependentAssembly>
+ <dependentAssembly>
+ <assemblyIdentity name="System.IO.FileSystem.Primitives" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
+ <bindingRedirect oldVersion="0.0.0.0-4.0.2.0" newVersion="4.0.2.0" />
+ </dependentAssembly>
+ <dependentAssembly>
+ <assemblyIdentity name="System.Security.Cryptography.Primitives" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
+ <bindingRedirect oldVersion="0.0.0.0-4.0.1.0" newVersion="4.0.1.0" />
+ </dependentAssembly>
+ <dependentAssembly>
+ <assemblyIdentity name="System.Xml.XPath.XDocument" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
+ <bindingRedirect oldVersion="0.0.0.0-4.0.2.0" newVersion="4.0.2.0" />
+ </dependentAssembly>
+ <dependentAssembly>
+ <assemblyIdentity name="System.Console" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
+ <bindingRedirect oldVersion="0.0.0.0-4.0.1.0" newVersion="4.0.1.0" />
+ </dependentAssembly>
+ <dependentAssembly>
+ <assemblyIdentity name="System.Diagnostics.StackTrace" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
+ <bindingRedirect oldVersion="0.0.0.0-4.0.3.0" newVersion="4.0.3.0" />
+ </dependentAssembly>
+ <dependentAssembly>
+ <assemblyIdentity name="System.Reactive.Core" publicKeyToken="94bc3704cddfc263" culture="neutral" />
+ <bindingRedirect oldVersion="0.0.0.0-3.0.3000.0" newVersion="3.0.3000.0" />
+ </dependentAssembly>
+ <dependentAssembly>
+ <assemblyIdentity name="Microsoft.Data.Edm" publicKeyToken="31bf3856ad364e35" culture="neutral" />
+ <bindingRedirect oldVersion="0.0.0.0-5.6.4.0" newVersion="5.6.4.0" />
+ </dependentAssembly>
+ <dependentAssembly>
+ <assemblyIdentity name="Microsoft.Data.Services.Client" publicKeyToken="31bf3856ad364e35" culture="neutral" />
+ <bindingRedirect oldVersion="0.0.0.0-5.6.4.0" newVersion="5.6.4.0" />
+ </dependentAssembly>
+ <dependentAssembly>
+ <assemblyIdentity name="Microsoft.Data.OData" publicKeyToken="31bf3856ad364e35" culture="neutral" />
+ <bindingRedirect oldVersion="0.0.0.0-5.6.4.0" newVersion="5.6.4.0" />
+ </dependentAssembly>
+ <dependentAssembly>
+ <assemblyIdentity name="Newtonsoft.Json" publicKeyToken="30ad4fe6b2a6aeed" culture="neutral" />
+ <bindingRedirect oldVersion="0.0.0.0-9.0.0.0" newVersion="9.0.0.0" />
+ </dependentAssembly>
+ <dependentAssembly>
+ <assemblyIdentity name="Microsoft.IdentityModel.Clients.ActiveDirectory" publicKeyToken="31bf3856ad364e35" culture="neutral" />
+ <bindingRedirect oldVersion="0.0.0.0-3.19.8.16603" newVersion="3.19.8.16603" />
+ </dependentAssembly>
+ <dependentAssembly>
+ <assemblyIdentity name="Microsoft.IdentityModel.Clients.ActiveDirectory.Platform" publicKeyToken="31bf3856ad364e35" culture="neutral" />
+ <bindingRedirect oldVersion="0.0.0.0-3.19.8.16603" newVersion="3.19.8.16603" />
+ </dependentAssembly>
+ <dependentAssembly>
+ <assemblyIdentity name="System.Web.Http" publicKeyToken="31bf3856ad364e35" culture="neutral" />
+ <bindingRedirect oldVersion="0.0.0.0-5.2.2.0" newVersion="5.2.2.0" />
+ </dependentAssembly>
+ <dependentAssembly>
+ <assemblyIdentity name="System.Net.Http.Formatting" publicKeyToken="31bf3856ad364e35" culture="neutral" />
+ <bindingRedirect oldVersion="0.0.0.0-5.2.2.0" newVersion="5.2.2.0" />
+ </dependentAssembly>
+ <dependentAssembly>
+ <assemblyIdentity name="WebGrease" publicKeyToken="31bf3856ad364e35" culture="neutral" />
+ <bindingRedirect oldVersion="0.0.0.0-1.5.2.14234" newVersion="1.5.2.14234" />
+ </dependentAssembly>
</assemblyBinding>
</runtime>
<entityFramework>
diff --git a/Software/Visual_Studio/PPC/Tango.PPC.WatchDog/App.config b/Software/Visual_Studio/PPC/Tango.PPC.WatchDog/App.config
index 85607e5e8..b295bcfda 100644
--- a/Software/Visual_Studio/PPC/Tango.PPC.WatchDog/App.config
+++ b/Software/Visual_Studio/PPC/Tango.PPC.WatchDog/App.config
@@ -47,7 +47,7 @@
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="Newtonsoft.Json" publicKeyToken="30ad4fe6b2a6aeed" culture="neutral" />
- <bindingRedirect oldVersion="0.0.0.0-8.0.0.0" newVersion="8.0.0.0" />
+ <bindingRedirect oldVersion="0.0.0.0-9.0.0.0" newVersion="9.0.0.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="Microsoft.Data.Edm" publicKeyToken="31bf3856ad364e35" culture="neutral" />
diff --git a/Software/Visual_Studio/Tango.BL/ObservablesContextConfiguration.cs b/Software/Visual_Studio/Tango.BL/ObservablesContextConfiguration.cs
index 07c3f5306..04d22a7b6 100644
--- a/Software/Visual_Studio/Tango.BL/ObservablesContextConfiguration.cs
+++ b/Software/Visual_Studio/Tango.BL/ObservablesContextConfiguration.cs
@@ -24,23 +24,6 @@ namespace Tango.BL
{
Directory.CreateDirectory(FolderPath);
var modelStore = new DefaultDbModelStore(FolderPath);
-
- try
- {
- modelStore.TryLoad(typeof(ObservablesContext));
- }
- catch
- {
- try
- {
- Directory.Delete(FolderPath, true);
- Thread.Sleep(1000);
- Directory.CreateDirectory(FolderPath);
- }
- catch { }
- modelStore = new DefaultDbModelStore(FolderPath);
- }
-
SetModelStore(modelStore);
}
diff --git a/Software/Visual_Studio/Tango.BL/ObservablesContextExtension.cs b/Software/Visual_Studio/Tango.BL/ObservablesContextExtension.cs
index d36113e71..94d751482 100644
--- a/Software/Visual_Studio/Tango.BL/ObservablesContextExtension.cs
+++ b/Software/Visual_Studio/Tango.BL/ObservablesContextExtension.cs
@@ -22,6 +22,7 @@ namespace Tango.BL
private List<ObservableModifiedEventArgs> _pending_notifications = new List<ObservableModifiedEventArgs>();
private ObservablesContextAdapter _adapter;
private static DataSource _override_datasource;
+ private DataSource _dataSource;
/// <summary>
/// Initializes a new instance of the <see cref="ObservablesContext"/> class.
@@ -38,6 +39,7 @@ namespace Tango.BL
/// <param name="isFile">if set to <c>true</c> will try to connect to an .mdf file.</param>
public ObservablesContext(DataSource dataSource) : base(dataSource.ToConnection(), true)
{
+ _dataSource = dataSource;
Database.SetInitializer<ObservablesContext>(null);
Configuration.LazyLoadingEnabled = false;
_adapter = new ObservablesContextAdapter(this);
@@ -190,6 +192,15 @@ namespace Tango.BL
}
/// <summary>
+ /// Gets the current data source.
+ /// </summary>
+ /// <returns></returns>
+ public DataSource GetDataSource()
+ {
+ return _dataSource;
+ }
+
+ /// <summary>
/// Gets the actual data source (settings or overridden).
/// </summary>
/// <returns></returns>
@@ -207,7 +218,7 @@ namespace Tango.BL
/// <inheritdoc />
public override string ToString()
{
- return GetActualDataSource().ToString();
+ return GetDataSource().ToString();
}
/// <summary>
diff --git a/Software/Visual_Studio/Tango.BL/Tango.BL.csproj b/Software/Visual_Studio/Tango.BL/Tango.BL.csproj
index c4f672593..6453881f0 100644
--- a/Software/Visual_Studio/Tango.BL/Tango.BL.csproj
+++ b/Software/Visual_Studio/Tango.BL/Tango.BL.csproj
@@ -42,8 +42,8 @@
<Reference Include="Google.Protobuf, Version=3.4.1.0, Culture=neutral, PublicKeyToken=a7d26565bac4d604, processorArchitecture=MSIL">
<HintPath>..\packages\Google.Protobuf.3.4.1\lib\net45\Google.Protobuf.dll</HintPath>
</Reference>
- <Reference Include="Newtonsoft.Json, Version=8.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
- <HintPath>..\packages\Newtonsoft.Json.8.0.3\lib\net45\Newtonsoft.Json.dll</HintPath>
+ <Reference Include="Newtonsoft.Json, Version=9.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
+ <HintPath>..\packages\Newtonsoft.Json.9.0.1\lib\net45\Newtonsoft.Json.dll</HintPath>
</Reference>
<Reference Include="SimpleValidator, Version=0.6.1.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\SimpleValidator.0.6.1.0\lib\net40\SimpleValidator.dll</HintPath>
@@ -408,7 +408,7 @@
</Target>
<ProjectExtensions>
<VisualStudio>
- <UserProperties BuildVersion_StartDate="2000/1/1" BuildVersion_UseGlobalSettings="False" BuildVersion_BuildVersioningStyle="None.None.Increment.TimeStamp" BuildVersion_UpdateAssemblyVersion="True" BuildVersion_AssemblyInfoFilename="Properties\AssemblyInfo.cs" />
+ <UserProperties BuildVersion_AssemblyInfoFilename="Properties\AssemblyInfo.cs" BuildVersion_UpdateAssemblyVersion="True" BuildVersion_BuildVersioningStyle="None.None.Increment.TimeStamp" BuildVersion_UseGlobalSettings="False" BuildVersion_StartDate="2000/1/1" />
</VisualStudio>
</ProjectExtensions>
</Project> \ No newline at end of file
diff --git a/Software/Visual_Studio/Tango.BL/packages.config b/Software/Visual_Studio/Tango.BL/packages.config
index 3ed77ec38..408466746 100644
--- a/Software/Visual_Studio/Tango.BL/packages.config
+++ b/Software/Visual_Studio/Tango.BL/packages.config
@@ -2,7 +2,7 @@
<packages>
<package id="EntityFramework" version="6.2.0" targetFramework="net461" />
<package id="Google.Protobuf" version="3.4.1" targetFramework="net46" />
- <package id="Newtonsoft.Json" version="8.0.3" targetFramework="net46" />
+ <package id="Newtonsoft.Json" version="9.0.1" targetFramework="net461" />
<package id="SimpleValidator" version="0.6.1.0" targetFramework="net46" />
<package id="System.Data.SQLite" version="1.0.108.0" targetFramework="net46" />
<package id="System.Data.SQLite.Core" version="1.0.108.0" targetFramework="net46" />
diff --git a/Software/Visual_Studio/Tango.CodeGeneration/Templates/TangoWebClientCodeFile.cshtml b/Software/Visual_Studio/Tango.CodeGeneration/Templates/TangoWebClientCodeFile.cshtml
index 100171849..7d9ebc075 100644
--- a/Software/Visual_Studio/Tango.CodeGeneration/Templates/TangoWebClientCodeFile.cshtml
+++ b/Software/Visual_Studio/Tango.CodeGeneration/Templates/TangoWebClientCodeFile.cshtml
@@ -1,10 +1,9 @@
@{
Tango.CodeGeneration.TangoWebClientCodeFile model = Model as Tango.CodeGeneration.TangoWebClientCodeFile;
}
-
+using System;
using System.Threading.Tasks;
using Tango.Web;
-using Tango.Web.Authentication;
namespace @(model.Namespace)
{
@@ -19,7 +18,7 @@ namespace @(model.Namespace)
/// </summary>
/// <param name="environment">The environment.</param>
/// <param name="token">Existing token.</param>
- public @(model.Name)(DeploymentSlot environment, WebToken token) : base(environment, "@(model.ControllerName)", token)
+ public @(model.Name)(DeploymentSlot environment, String token) : base(environment, "@(model.ControllerName)", token)
{
}
@@ -33,6 +32,16 @@ namespace @(model.Namespace)
}
+ /// <summary>
+ /// Initializes a new instance of the <see cref="@(model.Name)"/> class.
+ /// </summary>
+ /// <param name="address">The service address.</param>
+ /// <param name="token">Existing token.</param>
+ public @(model.Name)(String address, String token) : base(address, "@(model.ControllerName)", token)
+ {
+
+ }
+
@foreach (var action in model.Actions)
{
<div>
diff --git a/Software/Visual_Studio/Tango.Core/Tango.Core.csproj b/Software/Visual_Studio/Tango.Core/Tango.Core.csproj
index c3d685a29..eb80279ef 100644
--- a/Software/Visual_Studio/Tango.Core/Tango.Core.csproj
+++ b/Software/Visual_Studio/Tango.Core/Tango.Core.csproj
@@ -48,8 +48,8 @@
<Reference Include="Microsoft.IdentityModel.Clients.ActiveDirectory.Platform, Version=3.19.8.16603, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<HintPath>..\packages\Microsoft.IdentityModel.Clients.ActiveDirectory.3.19.8\lib\net45\Microsoft.IdentityModel.Clients.ActiveDirectory.Platform.dll</HintPath>
</Reference>
- <Reference Include="Newtonsoft.Json, Version=8.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
- <HintPath>..\packages\Newtonsoft.Json.8.0.3\lib\net45\Newtonsoft.Json.dll</HintPath>
+ <Reference Include="Newtonsoft.Json, Version=9.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
+ <HintPath>..\packages\Newtonsoft.Json.9.0.1\lib\net45\Newtonsoft.Json.dll</HintPath>
</Reference>
<Reference Include="PresentationCore" />
<Reference Include="PresentationFramework" />
@@ -194,7 +194,7 @@
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<ProjectExtensions>
<VisualStudio>
- <UserProperties BuildVersion_AssemblyInfoFilename="Properties\AssemblyInfo.cs" BuildVersion_UpdateAssemblyVersion="True" BuildVersion_BuildVersioningStyle="None.None.Increment.TimeStamp" BuildVersion_UseGlobalSettings="False" BuildVersion_StartDate="2000/1/1" />
+ <UserProperties BuildVersion_StartDate="2000/1/1" BuildVersion_UseGlobalSettings="False" BuildVersion_BuildVersioningStyle="None.None.Increment.TimeStamp" BuildVersion_UpdateAssemblyVersion="True" BuildVersion_AssemblyInfoFilename="Properties\AssemblyInfo.cs" />
</VisualStudio>
</ProjectExtensions>
<Import Project="..\packages\System.Data.SQLite.Core.1.0.108.0\build\net46\System.Data.SQLite.Core.targets" Condition="Exists('..\packages\System.Data.SQLite.Core.1.0.108.0\build\net46\System.Data.SQLite.Core.targets')" />
diff --git a/Software/Visual_Studio/Tango.Core/packages.config b/Software/Visual_Studio/Tango.Core/packages.config
index 53cd4a3c8..28c0e4b9c 100644
--- a/Software/Visual_Studio/Tango.Core/packages.config
+++ b/Software/Visual_Studio/Tango.Core/packages.config
@@ -4,7 +4,7 @@
<package id="EntityFramework" version="6.2.0" targetFramework="net461" />
<package id="Google.Protobuf" version="3.4.1" targetFramework="net46" />
<package id="Microsoft.IdentityModel.Clients.ActiveDirectory" version="3.19.8" targetFramework="net472" />
- <package id="Newtonsoft.Json" version="8.0.3" targetFramework="net46" />
+ <package id="Newtonsoft.Json" version="9.0.1" targetFramework="net461" />
<package id="SimpleValidator" version="0.6.1.0" targetFramework="net46" />
<package id="System.Data.SQLite" version="1.0.108.0" targetFramework="net472" />
<package id="System.Data.SQLite.Core" version="1.0.108.0" targetFramework="net472" />
diff --git a/Software/Visual_Studio/Tango.Emulations/app.config b/Software/Visual_Studio/Tango.Emulations/app.config
index 49b6f5ebe..55a256ebb 100644
--- a/Software/Visual_Studio/Tango.Emulations/app.config
+++ b/Software/Visual_Studio/Tango.Emulations/app.config
@@ -8,7 +8,7 @@
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="Newtonsoft.Json" publicKeyToken="30ad4fe6b2a6aeed" culture="neutral" />
- <bindingRedirect oldVersion="0.0.0.0-8.0.0.0" newVersion="8.0.0.0" />
+ <bindingRedirect oldVersion="0.0.0.0-9.0.0.0" newVersion="9.0.0.0" />
</dependentAssembly>
</assemblyBinding>
</runtime>
diff --git a/Software/Visual_Studio/Tango.Integration/Tango.Integration.csproj b/Software/Visual_Studio/Tango.Integration/Tango.Integration.csproj
index 9a7e783ed..8d6d43c02 100644
--- a/Software/Visual_Studio/Tango.Integration/Tango.Integration.csproj
+++ b/Software/Visual_Studio/Tango.Integration/Tango.Integration.csproj
@@ -42,8 +42,8 @@
<Reference Include="Ionic.Zip, Version=1.9.1.8, Culture=neutral, PublicKeyToken=edbe51ad942a3f5c, processorArchitecture=MSIL">
<HintPath>..\packages\Ionic.Zip.1.9.1.8\lib\Ionic.Zip.dll</HintPath>
</Reference>
- <Reference Include="Newtonsoft.Json, Version=8.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
- <HintPath>..\packages\Newtonsoft.Json.8.0.3\lib\net45\Newtonsoft.Json.dll</HintPath>
+ <Reference Include="Newtonsoft.Json, Version=9.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
+ <HintPath>..\packages\Newtonsoft.Json.9.0.1\lib\net45\Newtonsoft.Json.dll</HintPath>
</Reference>
<Reference Include="PresentationCore" />
<Reference Include="PresentationFramework" />
@@ -176,7 +176,7 @@
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<ProjectExtensions>
<VisualStudio>
- <UserProperties BuildVersion_StartDate="2000/1/1" BuildVersion_UseGlobalSettings="False" BuildVersion_BuildVersioningStyle="None.None.Increment.TimeStamp" BuildVersion_UpdateAssemblyVersion="True" BuildVersion_AssemblyInfoFilename="Properties\AssemblyInfo.cs" />
+ <UserProperties BuildVersion_AssemblyInfoFilename="Properties\AssemblyInfo.cs" BuildVersion_UpdateAssemblyVersion="True" BuildVersion_BuildVersioningStyle="None.None.Increment.TimeStamp" BuildVersion_UseGlobalSettings="False" BuildVersion_StartDate="2000/1/1" />
</VisualStudio>
</ProjectExtensions>
</Project> \ No newline at end of file
diff --git a/Software/Visual_Studio/Tango.Integration/app.config b/Software/Visual_Studio/Tango.Integration/app.config
index 63b19aed7..2ddf77726 100644
--- a/Software/Visual_Studio/Tango.Integration/app.config
+++ b/Software/Visual_Studio/Tango.Integration/app.config
@@ -12,7 +12,7 @@
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="Newtonsoft.Json" publicKeyToken="30ad4fe6b2a6aeed" culture="neutral" />
- <bindingRedirect oldVersion="0.0.0.0-8.0.0.0" newVersion="8.0.0.0" />
+ <bindingRedirect oldVersion="0.0.0.0-9.0.0.0" newVersion="9.0.0.0" />
</dependentAssembly>
</assemblyBinding>
</runtime>
diff --git a/Software/Visual_Studio/Tango.Integration/packages.config b/Software/Visual_Studio/Tango.Integration/packages.config
index dda6ff5f8..56f5092b2 100644
--- a/Software/Visual_Studio/Tango.Integration/packages.config
+++ b/Software/Visual_Studio/Tango.Integration/packages.config
@@ -3,7 +3,7 @@
<package id="EntityFramework" version="6.2.0" targetFramework="net461" />
<package id="Google.Protobuf" version="3.4.1" targetFramework="net46" />
<package id="Ionic.Zip" version="1.9.1.8" targetFramework="net461" />
- <package id="Newtonsoft.Json" version="8.0.3" targetFramework="net46" />
+ <package id="Newtonsoft.Json" version="9.0.1" targetFramework="net461" />
<package id="System.Reactive" version="3.1.1" targetFramework="net46" />
<package id="System.Reactive.Core" version="3.1.1" targetFramework="net46" />
<package id="System.Reactive.Interfaces" version="3.1.1" targetFramework="net46" />
diff --git a/Software/Visual_Studio/Tango.Serialization/Tango.Serialization.csproj b/Software/Visual_Studio/Tango.Serialization/Tango.Serialization.csproj
index 4efa0e255..24c0b4d96 100644
--- a/Software/Visual_Studio/Tango.Serialization/Tango.Serialization.csproj
+++ b/Software/Visual_Studio/Tango.Serialization/Tango.Serialization.csproj
@@ -33,8 +33,8 @@
<Reference Include="Google.Protobuf, Version=3.4.1.0, Culture=neutral, PublicKeyToken=a7d26565bac4d604, processorArchitecture=MSIL">
<HintPath>..\packages\Google.Protobuf.3.4.1\lib\net45\Google.Protobuf.dll</HintPath>
</Reference>
- <Reference Include="Newtonsoft.Json, Version=8.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
- <HintPath>..\packages\Newtonsoft.Json.8.0.3\lib\net45\Newtonsoft.Json.dll</HintPath>
+ <Reference Include="Newtonsoft.Json, Version=9.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
+ <HintPath>..\packages\Newtonsoft.Json.9.0.1\lib\net45\Newtonsoft.Json.dll</HintPath>
</Reference>
<Reference Include="System" />
<Reference Include="System.Core" />
@@ -63,7 +63,7 @@
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<ProjectExtensions>
<VisualStudio>
- <UserProperties BuildVersion_AssemblyInfoFilename="Properties\AssemblyInfo.cs" BuildVersion_UpdateAssemblyVersion="True" BuildVersion_BuildVersioningStyle="None.None.Increment.TimeStamp" BuildVersion_UseGlobalSettings="False" BuildVersion_StartDate="2000/1/1" />
+ <UserProperties BuildVersion_StartDate="2000/1/1" BuildVersion_UseGlobalSettings="False" BuildVersion_BuildVersioningStyle="None.None.Increment.TimeStamp" BuildVersion_UpdateAssemblyVersion="True" BuildVersion_AssemblyInfoFilename="Properties\AssemblyInfo.cs" />
</VisualStudio>
</ProjectExtensions>
</Project> \ No newline at end of file
diff --git a/Software/Visual_Studio/Tango.Serialization/packages.config b/Software/Visual_Studio/Tango.Serialization/packages.config
index f147efb72..696615a7d 100644
--- a/Software/Visual_Studio/Tango.Serialization/packages.config
+++ b/Software/Visual_Studio/Tango.Serialization/packages.config
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="Google.Protobuf" version="3.4.1" targetFramework="net46" />
- <package id="Newtonsoft.Json" version="8.0.3" targetFramework="net46" />
+ <package id="Newtonsoft.Json" version="9.0.1" targetFramework="net461" />
</packages> \ No newline at end of file
diff --git a/Software/Visual_Studio/Tango.Settings/Tango.Settings.csproj b/Software/Visual_Studio/Tango.Settings/Tango.Settings.csproj
index b185b8431..8115619e4 100644
--- a/Software/Visual_Studio/Tango.Settings/Tango.Settings.csproj
+++ b/Software/Visual_Studio/Tango.Settings/Tango.Settings.csproj
@@ -30,8 +30,8 @@
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<ItemGroup>
- <Reference Include="Newtonsoft.Json, Version=8.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
- <HintPath>..\packages\Newtonsoft.Json.8.0.3\lib\net45\Newtonsoft.Json.dll</HintPath>
+ <Reference Include="Newtonsoft.Json, Version=9.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
+ <HintPath>..\packages\Newtonsoft.Json.9.0.1\lib\net45\Newtonsoft.Json.dll</HintPath>
</Reference>
<Reference Include="System" />
<Reference Include="System.Core" />
@@ -62,7 +62,7 @@
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<ProjectExtensions>
<VisualStudio>
- <UserProperties BuildVersion_StartDate="2000/1/1" BuildVersion_UseGlobalSettings="False" BuildVersion_BuildVersioningStyle="None.None.Increment.TimeStamp" BuildVersion_UpdateAssemblyVersion="True" BuildVersion_AssemblyInfoFilename="Properties\AssemblyInfo.cs" />
+ <UserProperties BuildVersion_AssemblyInfoFilename="Properties\AssemblyInfo.cs" BuildVersion_UpdateAssemblyVersion="True" BuildVersion_BuildVersioningStyle="None.None.Increment.TimeStamp" BuildVersion_UseGlobalSettings="False" BuildVersion_StartDate="2000/1/1" />
</VisualStudio>
</ProjectExtensions>
</Project> \ No newline at end of file
diff --git a/Software/Visual_Studio/Tango.Settings/packages.config b/Software/Visual_Studio/Tango.Settings/packages.config
index 92167d083..7ee8c1052 100644
--- a/Software/Visual_Studio/Tango.Settings/packages.config
+++ b/Software/Visual_Studio/Tango.Settings/packages.config
@@ -1,4 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
- <package id="Newtonsoft.Json" version="8.0.3" targetFramework="net46" />
+ <package id="Newtonsoft.Json" version="9.0.1" targetFramework="net461" />
</packages> \ No newline at end of file
diff --git a/Software/Visual_Studio/Tango.Stubs/Tango.Stubs.csproj b/Software/Visual_Studio/Tango.Stubs/Tango.Stubs.csproj
index 1c5865379..828248c9b 100644
--- a/Software/Visual_Studio/Tango.Stubs/Tango.Stubs.csproj
+++ b/Software/Visual_Studio/Tango.Stubs/Tango.Stubs.csproj
@@ -46,8 +46,8 @@
<Reference Include="MahApps.Metro, Version=1.5.0.23, Culture=neutral, PublicKeyToken=f4fb5a3c4d1e5b4f, processorArchitecture=MSIL">
<HintPath>..\packages\MahApps.Metro.1.5.0\lib\net45\MahApps.Metro.dll</HintPath>
</Reference>
- <Reference Include="Newtonsoft.Json, Version=8.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
- <HintPath>..\packages\Newtonsoft.Json.8.0.3\lib\net45\Newtonsoft.Json.dll</HintPath>
+ <Reference Include="Newtonsoft.Json, Version=9.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
+ <HintPath>..\packages\Newtonsoft.Json.9.0.1\lib\net45\Newtonsoft.Json.dll</HintPath>
</Reference>
<Reference Include="PresentationCore" />
<Reference Include="PresentationFramework" />
@@ -186,7 +186,7 @@
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<ProjectExtensions>
<VisualStudio>
- <UserProperties BuildVersion_StartDate="2000/1/1" BuildVersion_UseGlobalSettings="False" BuildVersion_BuildVersioningStyle="None.None.Increment.TimeStamp" BuildVersion_UpdateAssemblyVersion="True" BuildVersion_AssemblyInfoFilename="Properties\AssemblyInfo.cs" />
+ <UserProperties BuildVersion_AssemblyInfoFilename="Properties\AssemblyInfo.cs" BuildVersion_UpdateAssemblyVersion="True" BuildVersion_BuildVersioningStyle="None.None.Increment.TimeStamp" BuildVersion_UseGlobalSettings="False" BuildVersion_StartDate="2000/1/1" />
</VisualStudio>
</ProjectExtensions>
</Project> \ No newline at end of file
diff --git a/Software/Visual_Studio/Tango.Stubs/app.config b/Software/Visual_Studio/Tango.Stubs/app.config
index 0e8167dde..203a0c7bc 100644
--- a/Software/Visual_Studio/Tango.Stubs/app.config
+++ b/Software/Visual_Studio/Tango.Stubs/app.config
@@ -56,7 +56,7 @@
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="Newtonsoft.Json" publicKeyToken="30ad4fe6b2a6aeed" culture="neutral" />
- <bindingRedirect oldVersion="0.0.0.0-8.0.0.0" newVersion="8.0.0.0" />
+ <bindingRedirect oldVersion="0.0.0.0-9.0.0.0" newVersion="9.0.0.0" />
</dependentAssembly>
</assemblyBinding>
</runtime>
diff --git a/Software/Visual_Studio/Tango.Stubs/packages.config b/Software/Visual_Studio/Tango.Stubs/packages.config
index 8a6da5794..d3b5d7780 100644
--- a/Software/Visual_Studio/Tango.Stubs/packages.config
+++ b/Software/Visual_Studio/Tango.Stubs/packages.config
@@ -4,7 +4,7 @@
<package id="FontAwesome.WPF" version="4.7.0.9" targetFramework="net46" />
<package id="Google.Protobuf" version="3.4.1" targetFramework="net46" />
<package id="MahApps.Metro" version="1.5.0" targetFramework="net46" />
- <package id="Newtonsoft.Json" version="8.0.3" targetFramework="net46" />
+ <package id="Newtonsoft.Json" version="9.0.1" targetFramework="net461" />
<package id="System.Reactive" version="3.1.1" targetFramework="net46" />
<package id="System.Reactive.Core" version="3.1.1" targetFramework="net46" />
<package id="System.Reactive.Interfaces" version="3.1.1" targetFramework="net46" />
diff --git a/Software/Visual_Studio/Tango.TFS/Tango.TFS.csproj b/Software/Visual_Studio/Tango.TFS/Tango.TFS.csproj
index bc9248040..b69fbfbb1 100644
--- a/Software/Visual_Studio/Tango.TFS/Tango.TFS.csproj
+++ b/Software/Visual_Studio/Tango.TFS/Tango.TFS.csproj
@@ -161,9 +161,8 @@
<Reference Include="Microsoft.VisualStudio.Services.WebApi, Version=15.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<HintPath>..\packages\Microsoft.VisualStudio.Services.Client.15.112.1\lib\net45\Microsoft.VisualStudio.Services.WebApi.dll</HintPath>
</Reference>
- <Reference Include="Newtonsoft.Json, Version=8.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
- <HintPath>..\packages\Newtonsoft.Json.8.0.3\lib\net45\Newtonsoft.Json.dll</HintPath>
- <SpecificVersion>False</SpecificVersion>
+ <Reference Include="Newtonsoft.Json, Version=9.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
+ <HintPath>..\packages\Newtonsoft.Json.9.0.1\lib\net45\Newtonsoft.Json.dll</HintPath>
</Reference>
<Reference Include="System" />
<Reference Include="System.Data" />
@@ -263,7 +262,7 @@
</Target>
<ProjectExtensions>
<VisualStudio>
- <UserProperties BuildVersion_StartDate="2000/1/1" BuildVersion_UseGlobalSettings="False" BuildVersion_BuildVersioningStyle="None.None.Increment.TimeStamp" BuildVersion_UpdateAssemblyVersion="True" BuildVersion_AssemblyInfoFilename="Properties\AssemblyInfo.cs" />
+ <UserProperties BuildVersion_AssemblyInfoFilename="Properties\AssemblyInfo.cs" BuildVersion_UpdateAssemblyVersion="True" BuildVersion_BuildVersioningStyle="None.None.Increment.TimeStamp" BuildVersion_UseGlobalSettings="False" BuildVersion_StartDate="2000/1/1" />
</VisualStudio>
</ProjectExtensions>
</Project> \ No newline at end of file
diff --git a/Software/Visual_Studio/Tango.TFS/app.config b/Software/Visual_Studio/Tango.TFS/app.config
index de5386a47..8460dd432 100644
--- a/Software/Visual_Studio/Tango.TFS/app.config
+++ b/Software/Visual_Studio/Tango.TFS/app.config
@@ -4,7 +4,7 @@
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<assemblyIdentity name="Newtonsoft.Json" publicKeyToken="30ad4fe6b2a6aeed" culture="neutral" />
- <bindingRedirect oldVersion="0.0.0.0-8.0.0.0" newVersion="8.0.0.0" />
+ <bindingRedirect oldVersion="0.0.0.0-9.0.0.0" newVersion="9.0.0.0" />
</dependentAssembly>
</assemblyBinding>
</runtime>
diff --git a/Software/Visual_Studio/Tango.TFS/packages.config b/Software/Visual_Studio/Tango.TFS/packages.config
index c39c44fe7..d24692072 100644
--- a/Software/Visual_Studio/Tango.TFS/packages.config
+++ b/Software/Visual_Studio/Tango.TFS/packages.config
@@ -9,7 +9,7 @@
<package id="Microsoft.Tpl.Dataflow" version="4.5.24" targetFramework="net46" />
<package id="Microsoft.VisualStudio.Services.Client" version="15.112.1" targetFramework="net46" />
<package id="Microsoft.VisualStudio.Services.InteractiveClient" version="15.112.1" targetFramework="net46" />
- <package id="Newtonsoft.Json" version="8.0.3" targetFramework="net46" />
+ <package id="Newtonsoft.Json" version="9.0.1" targetFramework="net461" />
<package id="System.IdentityModel.Tokens.Jwt" version="4.0.2.206221351" targetFramework="net46" />
<package id="WindowsAzure.ServiceBus" version="3.3.2" targetFramework="net46" />
</packages> \ No newline at end of file
diff --git a/Software/Visual_Studio/Tango.Transport/Tango.Transport.csproj b/Software/Visual_Studio/Tango.Transport/Tango.Transport.csproj
index bea51be51..2fe525153 100644
--- a/Software/Visual_Studio/Tango.Transport/Tango.Transport.csproj
+++ b/Software/Visual_Studio/Tango.Transport/Tango.Transport.csproj
@@ -35,8 +35,8 @@
<HintPath>..\packages\Google.Protobuf.3.4.1\lib\net45\Google.Protobuf.dll</HintPath>
</Reference>
<Reference Include="Microsoft.WindowsAzure.Storage, Version=4.3.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL" />
- <Reference Include="Newtonsoft.Json, Version=8.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
- <HintPath>..\packages\Newtonsoft.Json.8.0.3\lib\net45\Newtonsoft.Json.dll</HintPath>
+ <Reference Include="Newtonsoft.Json, Version=9.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
+ <HintPath>..\packages\Newtonsoft.Json.9.0.1\lib\net45\Newtonsoft.Json.dll</HintPath>
</Reference>
<Reference Include="System" />
<Reference Include="System.Core" />
@@ -56,6 +56,7 @@
<Reference Include="System.Reactive.Windows.Threading, Version=3.0.1000.0, Culture=neutral, PublicKeyToken=94bc3704cddfc263, processorArchitecture=MSIL">
<HintPath>..\packages\System.Reactive.Windows.Threading.3.1.1\lib\net45\System.Reactive.Windows.Threading.dll</HintPath>
</Reference>
+ <Reference Include="System.Security" />
<Reference Include="System.ServiceModel" />
<Reference Include="System.Web" />
<Reference Include="System.Windows" />
@@ -108,16 +109,16 @@
<Compile Include="TransportMessageBase.cs" />
<Compile Include="TransportMessageDirection.cs" />
<Compile Include="Routing\TransportRoutingChannel.cs" />
+ <Compile Include="Web\InvalidTokenException.cs" />
<Compile Include="Web\IWebTransportClient.cs" />
<Compile Include="Web\IWebRequestMessage.cs" />
<Compile Include="Web\IWebResponseMessage.cs" />
<Compile Include="Web\IWebTransportMessage.cs" />
- <Compile Include="Web\SessionExpiredException.cs" />
+ <Compile Include="Web\TokenExpiredException.cs" />
<Compile Include="Web\StorageBlobDownloader.cs" />
<Compile Include="Web\StorageBlobProgressEventArgs.cs" />
<Compile Include="Web\StorageBlobUploader.cs" />
<Compile Include="Web\WebRequestMessage.cs" />
- <Compile Include="Web\WebRequestSecureMessage.cs" />
<Compile Include="Web\WebResponseMessage.cs" />
<Compile Include="Web\WebTransportClient.cs" />
<Compile Include="Web\WebTransportMessage.cs" />
@@ -147,7 +148,7 @@
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<ProjectExtensions>
<VisualStudio>
- <UserProperties BuildVersion_AssemblyInfoFilename="Properties\AssemblyInfo.cs" BuildVersion_UpdateAssemblyVersion="True" BuildVersion_BuildVersioningStyle="None.None.Increment.TimeStamp" BuildVersion_UseGlobalSettings="False" BuildVersion_StartDate="2000/1/1" />
+ <UserProperties BuildVersion_StartDate="2000/1/1" BuildVersion_UseGlobalSettings="False" BuildVersion_BuildVersioningStyle="None.None.Increment.TimeStamp" BuildVersion_UpdateAssemblyVersion="True" BuildVersion_AssemblyInfoFilename="Properties\AssemblyInfo.cs" />
</VisualStudio>
</ProjectExtensions>
</Project> \ No newline at end of file
diff --git a/Software/Visual_Studio/Tango.Transport/Web/IWebTransportClient.cs b/Software/Visual_Studio/Tango.Transport/Web/IWebTransportClient.cs
index 8ab0f9305..b1645401a 100644
--- a/Software/Visual_Studio/Tango.Transport/Web/IWebTransportClient.cs
+++ b/Software/Visual_Studio/Tango.Transport/Web/IWebTransportClient.cs
@@ -9,6 +9,7 @@ namespace Tango.Transport.Web
{
public interface IWebTransportClient : IDisposable
{
+ String AuthenticationToken { get; set; }
Task<Response> PostProto<Request, Response>(String url, Request request) where Request : class, IMessage where Response : class, IMessage;
Task<Response> PostJson<Request, Response>(String url, Request request) where Request : class, IWebRequestMessage where Response : class, IWebResponseMessage;
}
diff --git a/Software/Visual_Studio/Tango.Transport/Web/SessionExpiredException.cs b/Software/Visual_Studio/Tango.Transport/Web/InvalidTokenException.cs
index 7ee553b4a..0501c7c9d 100644
--- a/Software/Visual_Studio/Tango.Transport/Web/SessionExpiredException.cs
+++ b/Software/Visual_Studio/Tango.Transport/Web/InvalidTokenException.cs
@@ -6,9 +6,9 @@ using System.Threading.Tasks;
namespace Tango.Transport.Web
{
- public class SessionExpiredException : Exception
+ public class InvalidTokenException : Exception
{
- public SessionExpiredException(String message) : base(message)
+ public InvalidTokenException(String message) : base(message)
{
}
diff --git a/Software/Visual_Studio/Tango.Transport/Web/WebRequestSecureMessage.cs b/Software/Visual_Studio/Tango.Transport/Web/TokenExpiredException.cs
index 33644208e..92d7a0fec 100644
--- a/Software/Visual_Studio/Tango.Transport/Web/WebRequestSecureMessage.cs
+++ b/Software/Visual_Studio/Tango.Transport/Web/TokenExpiredException.cs
@@ -6,8 +6,11 @@ using System.Threading.Tasks;
namespace Tango.Transport.Web
{
- public class WebRequestSecureMessage : WebRequestMessage
+ public class TokenExpiredException : Exception
{
- public String AccessToken { get; set; }
+ public TokenExpiredException(String message) : base(message)
+ {
+
+ }
}
}
diff --git a/Software/Visual_Studio/Tango.Transport/Web/WebTransportClient.cs b/Software/Visual_Studio/Tango.Transport/Web/WebTransportClient.cs
index 188203945..ed2e69468 100644
--- a/Software/Visual_Studio/Tango.Transport/Web/WebTransportClient.cs
+++ b/Software/Visual_Studio/Tango.Transport/Web/WebTransportClient.cs
@@ -5,6 +5,8 @@ using System;
using System.Collections.Generic;
using System.Linq;
using System.Net.Http;
+using System.Net.Http.Headers;
+using System.Security.Authentication;
using System.Text;
using System.Threading.Tasks;
using System.Web;
@@ -17,11 +19,13 @@ namespace Tango.Transport.Web
private HttpClient _httpClient;
private static JsonSerializerSettings _settings;
+ public string AuthenticationToken { get; set; }
+
static WebTransportClient()
{
_settings = new JsonSerializerSettings()
{
-
+
};
}
@@ -30,6 +34,11 @@ namespace Tango.Transport.Web
_httpClient = new HttpClient();
}
+ public WebTransportClient(String authenticationToken) : this()
+ {
+ AuthenticationToken = authenticationToken;
+ }
+
public Task<Response> PostProto<Request, Response>(String url, Request request) where Request : class, IMessage where Response : class, IMessage
{
return Task.Factory.StartNew<Response>(() =>
@@ -38,6 +47,15 @@ namespace Tango.Transport.Web
var req = new ByteArrayContent(request.ToByteArray());
req.Headers.Add("Content-Type", "application/x-protobuf");
+ if (AuthenticationToken != null)
+ {
+ _httpClient.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", AuthenticationToken);
+ }
+ else
+ {
+ _httpClient.DefaultRequestHeaders.Authorization = null;
+ }
+
var response = _httpClient.PostAsync(url, req).Result;
var data = response.Content.ReadAsByteArrayAsync().Result;
@@ -60,6 +78,16 @@ namespace Tango.Transport.Web
{
var req = new ByteArrayContent(Encoding.UTF8.GetBytes(JsonConvert.SerializeObject(request, _settings)));
req.Headers.Add("Content-Type", "application/json");
+
+ if (AuthenticationToken != null)
+ {
+ _httpClient.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", AuthenticationToken);
+ }
+ else
+ {
+ _httpClient.DefaultRequestHeaders.Authorization = null;
+ }
+
var response = _httpClient.PostAsync(url, req).Result;
var data = response.Content.ReadAsStringAsync().Result;
@@ -70,19 +98,48 @@ namespace Tango.Transport.Web
catch (HttpRequestException ex)
{
String message = JObject.Parse(data).GetValue("Message").ToString();
+ Exception exception = null;
- if (message == "Session Expired.")
+ try
{
- throw new SessionExpiredException(ex.Message);
+ String exceptionMessage = JObject.Parse(data).GetValue("ExceptionMessage").ToString();
+ String exceptionType = JObject.Parse(data).GetValue("ExceptionType").ToString();
+ String stackTrace = JObject.Parse(data).GetValue("StackTrace").ToString();
+ Type type = GetType(exceptionType);
+ if (type != null)
+ {
+ exception = Activator.CreateInstance(type, new object[] { exceptionMessage + "\n" + stackTrace }) as Exception;
+ }
+ else
+ {
+ exception = new HttpException(exceptionMessage + "\n" + stackTrace);
+ }
+ }
+ catch
+ {
+ throw new HttpRequestException(ex.Message + " " + message);
}
- throw new HttpRequestException(ex.Message + " " + message);
+ throw exception;
}
return JsonConvert.DeserializeObject<Response>(data);
});
}
+ private static Type GetType(string typeName)
+ {
+ var type = Type.GetType(typeName);
+ if (type != null) return type;
+ foreach (var a in AppDomain.CurrentDomain.GetAssemblies())
+ {
+ type = a.GetType(typeName);
+ if (type != null)
+ return type;
+ }
+ return null;
+ }
+
public void Dispose()
{
_httpClient.Dispose();
diff --git a/Software/Visual_Studio/Tango.Transport/app.config b/Software/Visual_Studio/Tango.Transport/app.config
index 49b6f5ebe..55a256ebb 100644
--- a/Software/Visual_Studio/Tango.Transport/app.config
+++ b/Software/Visual_Studio/Tango.Transport/app.config
@@ -8,7 +8,7 @@
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="Newtonsoft.Json" publicKeyToken="30ad4fe6b2a6aeed" culture="neutral" />
- <bindingRedirect oldVersion="0.0.0.0-8.0.0.0" newVersion="8.0.0.0" />
+ <bindingRedirect oldVersion="0.0.0.0-9.0.0.0" newVersion="9.0.0.0" />
</dependentAssembly>
</assemblyBinding>
</runtime>
diff --git a/Software/Visual_Studio/Tango.Transport/packages.config b/Software/Visual_Studio/Tango.Transport/packages.config
index a473d73d9..e1a21695a 100644
--- a/Software/Visual_Studio/Tango.Transport/packages.config
+++ b/Software/Visual_Studio/Tango.Transport/packages.config
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="Google.Protobuf" version="3.4.1" targetFramework="net46" />
- <package id="Newtonsoft.Json" version="8.0.3" targetFramework="net461" />
+ <package id="Newtonsoft.Json" version="9.0.1" targetFramework="net461" />
<package id="System.Reactive" version="3.1.1" targetFramework="net46" />
<package id="System.Reactive.Core" version="3.1.1" targetFramework="net46" />
<package id="System.Reactive.Interfaces" version="3.1.1" targetFramework="net46" />
diff --git a/Software/Visual_Studio/Tango.UnitTesting/App.config b/Software/Visual_Studio/Tango.UnitTesting/App.config
index 525a23acf..1a3af14d9 100644
--- a/Software/Visual_Studio/Tango.UnitTesting/App.config
+++ b/Software/Visual_Studio/Tango.UnitTesting/App.config
@@ -64,7 +64,7 @@
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="Newtonsoft.Json" publicKeyToken="30ad4fe6b2a6aeed" culture="neutral" />
- <bindingRedirect oldVersion="0.0.0.0-8.0.0.0" newVersion="8.0.0.0" />
+ <bindingRedirect oldVersion="0.0.0.0-9.0.0.0" newVersion="9.0.0.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="Microsoft.IdentityModel.Clients.ActiveDirectory" publicKeyToken="31bf3856ad364e35" culture="neutral" />
diff --git a/Software/Visual_Studio/Tango.UnitTesting/MachineService/MachineStudio_Controller_TST.cs b/Software/Visual_Studio/Tango.UnitTesting/MachineService/MachineStudio_Controller_TST.cs
new file mode 100644
index 000000000..8a126df2e
--- /dev/null
+++ b/Software/Visual_Studio/Tango.UnitTesting/MachineService/MachineStudio_Controller_TST.cs
@@ -0,0 +1,78 @@
+using System;
+using System.Security.Authentication;
+using Microsoft.VisualStudio.TestTools.UnitTesting;
+using Tango.BL;
+using Tango.MachineStudio.Common.Web;
+using Tango.Transport.Web;
+using System.Linq;
+
+namespace Tango.UnitTesting.Web
+{
+ [TestClass]
+ [TestCategory("Machine Service - Machine Studio")]
+ public class MachineStudio_Controller_TST
+ {
+ private const string address = "http://localhost:51581";
+
+ [TestMethod]
+ public void Login_and_check_for_updates()
+ {
+ //First test the more primitive web clients.
+
+ IWebTransportClient client = new WebTransportClient();
+
+ var res1 = client.PostJson<LoginRequest, LoginResponse>($"{address}/api/MachineStudio/Login", new LoginRequest()
+ {
+ Email = "TestUser@twine-s.com",
+ Password = "ASJH_asdjkl1234",
+ Version = "1.0.0.0"
+ }).Result;
+
+ String token = res1.AccessToken;
+ client.AuthenticationToken = token;
+
+ var res2 = client.PostJson<CheckForUpdatesRequest, CheckForUpdatesResponse>($"{address}/api/MachineStudio/CheckForUpdates", new CheckForUpdatesRequest()
+ {
+ Version = "1.0.0.0"
+ }).ConfigureAwait(false).GetAwaiter().GetResult();
+
+ //Check updates are available..
+ Assert.IsTrue(res2.IsUpdateAvailable);
+
+
+ //Now check the dedicated machine studio client.
+ MachineStudioWebClient msClient = new MachineStudioWebClient(address, null);
+
+ //Should throw an exception without login first (no token specified..)
+ Assert.ThrowsException<AuthenticationException>(() =>
+ {
+ var res3 = msClient.CheckForUpdates(new CheckForUpdatesRequest()
+ {
+ Version = "1.0.0.0"
+ }).GetAwaiter().GetResult();
+ });
+
+ //Perform a login.
+ var res4 = msClient.Login(new LoginRequest()
+ {
+ Email = "TestUser@twine-s.com",
+ Password = "ASJH_asdjkl1234",
+ Version = "1.0.0.0"
+ }).Result;
+
+ //Validate the data source received.
+ using (ObservablesContext db = ObservablesContext.CreateDefault(res4.DataSource))
+ {
+ var user = db.Users.Single(x => x.Email.ToLower() == "TestUser@twine-s.com");
+ }
+
+ //Check updates are not available..
+ var res5 = msClient.CheckForUpdates(new CheckForUpdatesRequest()
+ {
+ Version = "100.0.0.0"
+ }).Result;
+
+ Assert.IsFalse(res5.IsUpdateAvailable);
+ }
+ }
+}
diff --git a/Software/Visual_Studio/Tango.UnitTesting/MachineService/PPC_Controller_TST.cs b/Software/Visual_Studio/Tango.UnitTesting/MachineService/PPC_Controller_TST.cs
new file mode 100644
index 000000000..23ab74f3b
--- /dev/null
+++ b/Software/Visual_Studio/Tango.UnitTesting/MachineService/PPC_Controller_TST.cs
@@ -0,0 +1,95 @@
+using System;
+using System.Security.Authentication;
+using Microsoft.VisualStudio.TestTools.UnitTesting;
+using Tango.BL;
+using Tango.Transport.Web;
+using System.Linq;
+using Tango.PPC.Common.Web;
+using Tango.Core.IO;
+
+namespace Tango.UnitTesting.Web
+{
+ [TestClass]
+ [TestCategory("Machine Service - PPC")]
+ public class PPC_Controller_TST
+ {
+ private const string address = "http://localhost:51581";
+
+ [TestMethod]
+ public void Login_and_setup()
+ {
+ //Now check the dedicated machine studio client.
+ PPCWebClient client = new PPCWebClient(address, null);
+
+ //Should throw an exception without login first (no token specified..)
+ Assert.ThrowsException<AuthenticationException>(() =>
+ {
+ var res1 = client.MachineSetup(new MachineSetupRequest()
+ {
+
+ }).GetAwaiter().GetResult();
+ });
+
+ //Perform a login with user mode.
+ var res2 = client.Login(new LoginRequest()
+ {
+ Mode = LoginMode.User,
+ Email = "TestUser@twine-s.com",
+ Password = "ASJH_asdjkl1234",
+ }).Result;
+
+ //Should throw exception about serial number not found.
+ Assert.ThrowsException<AuthenticationException>(() =>
+ {
+ var res3 = client.Login(new LoginRequest()
+ {
+ Mode = LoginMode.Machine,
+ SerialNumber = "NOT_EXISTING_SERIAL_NUMBER",
+ }).GetAwaiter().GetResult();
+ });
+
+ //Perform a login with machine mode.
+ var res4 = client.Login(new LoginRequest()
+ {
+ Mode = LoginMode.Machine,
+ SerialNumber = "0003",
+ }).Result;
+
+ //Should return setup information
+ var res5 = client.MachineSetup(new MachineSetupRequest()
+ {
+ SerialNumber = "0003",
+ }).GetAwaiter().GetResult();
+
+ //Now get DEV data source using the machine studio client in order to validate the setup information.
+ MachineStudio.Common.Web.MachineStudioWebClient msClient = new MachineStudio.Common.Web.MachineStudioWebClient(address, null);
+ var res6 = msClient.Login(new MachineStudio.Common.Web.LoginRequest()
+ {
+ Email = "TestUser@twine-s.com",
+ Password = "ASJH_asdjkl1234",
+ }).Result;
+
+ var dataSource = res6.DataSource;
+
+ using (ObservablesContext db = ObservablesContext.CreateDefault(dataSource))
+ {
+ var machine = db.Machines.Single(x => x.SerialNumber == "0003");
+
+ Assert.AreEqual(res5.IsDemo, machine.IsDemo);
+ Assert.AreEqual(res5.OSKey, machine.OsKey);
+ Assert.AreEqual(res5.SetupActivation, machine.SetupActivation);
+ Assert.AreEqual(res5.SetupFirmware, machine.SetupFirmware);
+ Assert.AreEqual(res5.SetupFPGA, machine.SetupFpga);
+ Assert.AreEqual(res5.SetupRemoteAssistance, machine.SetupRemoteAssistance);
+ Assert.AreEqual(res5.SetupUWF, machine.SetupUwf);
+ }
+
+
+ var tempFile = TemporaryManager.Default.CreateFile();
+ StorageBlobDownloader downloader = new StorageBlobDownloader(res5.BlobAddress, tempFile);
+ downloader.Download().Wait();
+
+ tempFile.Delete();
+ }
+ }
+}
diff --git a/Software/Visual_Studio/Tango.UnitTesting/MachineService_TST.cs b/Software/Visual_Studio/Tango.UnitTesting/MachineService_TST.cs
index ababd1793..455a45895 100644
--- a/Software/Visual_Studio/Tango.UnitTesting/MachineService_TST.cs
+++ b/Software/Visual_Studio/Tango.UnitTesting/MachineService_TST.cs
@@ -59,7 +59,7 @@ namespace Tango.UnitTesting
tokensManager.Validate(recent_token);
- Assert.ThrowsException<SessionExpiredException>(() => tokensManager.Validate(token1));
+ Assert.ThrowsException<TokenExpiredException>(() => tokensManager.Validate(token1));
}
}
}
diff --git a/Software/Visual_Studio/Tango.UnitTesting/Tango.UnitTesting.csproj b/Software/Visual_Studio/Tango.UnitTesting/Tango.UnitTesting.csproj
index 9ebc45dfc..445992b64 100644
--- a/Software/Visual_Studio/Tango.UnitTesting/Tango.UnitTesting.csproj
+++ b/Software/Visual_Studio/Tango.UnitTesting/Tango.UnitTesting.csproj
@@ -56,18 +56,23 @@
<Reference Include="Google.Protobuf, Version=3.4.1.0, Culture=neutral, PublicKeyToken=a7d26565bac4d604, processorArchitecture=MSIL">
<HintPath>..\packages\Google.Protobuf.3.4.1\lib\net45\Google.Protobuf.dll</HintPath>
</Reference>
+ <Reference Include="JWT, Version=5.0.0.0, Culture=neutral, processorArchitecture=MSIL">
+ <HintPath>..\packages\JWT.5.0.0\lib\net46\JWT.dll</HintPath>
+ </Reference>
<Reference Include="Microsoft.CSharp" />
<Reference Include="Microsoft.Office.Interop.Outlook, Version=15.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c, processorArchitecture=MSIL">
<EmbedInteropTypes>True</EmbedInteropTypes>
</Reference>
+ <Reference Include="Microsoft.SqlServer.AzureStorageEnum, Version=14.100.0.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91, processorArchitecture=MSIL" />
<Reference Include="Microsoft.VisualStudio.TestPlatform.TestFramework, Version=14.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<HintPath>..\packages\MSTest.TestFramework.1.1.11\lib\net45\Microsoft.VisualStudio.TestPlatform.TestFramework.dll</HintPath>
</Reference>
<Reference Include="Microsoft.VisualStudio.TestPlatform.TestFramework.Extensions, Version=14.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<HintPath>..\packages\MSTest.TestFramework.1.1.11\lib\net45\Microsoft.VisualStudio.TestPlatform.TestFramework.Extensions.dll</HintPath>
</Reference>
- <Reference Include="Newtonsoft.Json, Version=8.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
- <HintPath>..\packages\Newtonsoft.Json.8.0.3\lib\net45\Newtonsoft.Json.dll</HintPath>
+ <Reference Include="Microsoft.WindowsAzure.Storage, Version=4.3.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL" />
+ <Reference Include="Newtonsoft.Json, Version=9.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
+ <HintPath>..\packages\Newtonsoft.Json.9.0.1\lib\net45\Newtonsoft.Json.dll</HintPath>
</Reference>
<Reference Include="System" />
<Reference Include="System.ComponentModel.DataAnnotations" />
@@ -96,6 +101,7 @@
</Compile>
<Compile Include="Integration_TST.cs" />
<Compile Include="Logging_TST.cs" />
+ <Compile Include="MachineService\PPC_Controller_TST.cs" />
<Compile Include="MachineStudio_TST.cs" />
<Compile Include="RemoteRunner_TST.cs" />
<Compile Include="SQLExaminer_TST.cs" />
@@ -108,6 +114,8 @@
<Compile Include="Protobuf_TST.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="MachineService_TST.cs" />
+ <Compile Include="Web\JWT_Tokens_TST.cs" />
+ <Compile Include="MachineService\MachineStudio_Controller_TST.cs" />
</ItemGroup>
<ItemGroup>
<None Include="App.config" />
diff --git a/Software/Visual_Studio/Tango.UnitTesting/Web/JWT_Tokens_TST.cs b/Software/Visual_Studio/Tango.UnitTesting/Web/JWT_Tokens_TST.cs
new file mode 100644
index 000000000..ff698f18f
--- /dev/null
+++ b/Software/Visual_Studio/Tango.UnitTesting/Web/JWT_Tokens_TST.cs
@@ -0,0 +1,69 @@
+using JWT;
+using Microsoft.VisualStudio.TestTools.UnitTesting;
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading;
+using System.Threading.Tasks;
+using Tango.Web.Authentication;
+
+namespace Tango.UnitTesting.Web
+{
+ [TestClass]
+ [TestCategory("Web")]
+ public class JWT_Tokens_TST
+ {
+ private class TokenObject
+ {
+ public String Name { get; set; }
+ public int Age { get; set; }
+ }
+
+ [TestMethod]
+ public void Test_JWT_Tokens_Read_Write_Validation()
+ {
+ string secret = "GQDstcKsx0NHjPOuXOYg5MbeJ1XT0uFiwDVvVBrk";
+
+ //Create new web token with embedded object. Expiration in 2 seconds.
+ var webToken = WebToken<TokenObject>.CreateNew(secret, new TokenObject()
+ {
+ Name = "Roy",
+ Age = 35
+
+ }, DateTime.UtcNow.AddSeconds(2));
+
+ //Get the actual string token.
+ String token = webToken.AccessToken;
+
+ //Validate the string token using the secret.
+ WebToken.Validate(secret, token);
+
+ //Read the token payload (Expiration, Issued, Embedded Object)..
+ var read_web_token = WebToken<TokenObject>.FromToken(token);
+
+ //Validate the token again using the web token instance (Just to see if the method is working..)
+ read_web_token.Validate(secret);
+
+ //Validate the token payload reading..
+ Assert.AreEqual(read_web_token.Expiration.Value.ToString("hh:mm"), webToken.Expiration.Value.ToString("hh:mm"));
+ Assert.AreEqual(read_web_token.Issued.ToString("hh:mm"), webToken.Issued.ToString("hh:mm"));
+ Assert.AreEqual(read_web_token.Object.Name, webToken.Object.Name);
+ Assert.AreEqual(read_web_token.Object.Age, webToken.Object.Age);
+
+ //Ensure token validation fails when messing with the token string.
+ Assert.ThrowsException<SignatureVerificationException>(() =>
+ {
+ WebToken.Validate(secret, token.Substring(0, token.Length - 1) + "0");
+ });
+
+ //Wait for the token to expire...
+ Thread.Sleep(2000);
+
+ //Ensure the token validation fails with 'token expired'.
+ Assert.ThrowsException<TokenExpiredException>(() => read_web_token.Validate(secret));
+ }
+
+
+ }
+}
diff --git a/Software/Visual_Studio/Tango.UnitTesting/packages.config b/Software/Visual_Studio/Tango.UnitTesting/packages.config
index 9b8d6e793..0528c7ef0 100644
--- a/Software/Visual_Studio/Tango.UnitTesting/packages.config
+++ b/Software/Visual_Studio/Tango.UnitTesting/packages.config
@@ -4,9 +4,10 @@
<package id="DeepEqual" version="1.6.0.0" targetFramework="net461" />
<package id="EntityFramework" version="6.2.0" targetFramework="net461" />
<package id="Google.Protobuf" version="3.4.1" targetFramework="net46" />
+ <package id="JWT" version="5.0.0" targetFramework="net461" />
<package id="MSTest.TestAdapter" version="1.1.11" targetFramework="net45" />
<package id="MSTest.TestFramework" version="1.1.11" targetFramework="net45" />
- <package id="Newtonsoft.Json" version="8.0.3" targetFramework="net46" />
+ <package id="Newtonsoft.Json" version="9.0.1" targetFramework="net461" />
<package id="System.Data.SQLite" version="1.0.108.0" targetFramework="net46" />
<package id="System.Data.SQLite.Core" version="1.0.108.0" targetFramework="net46" />
<package id="System.Data.SQLite.EF6" version="1.0.108.0" targetFramework="net46" />
diff --git a/Software/Visual_Studio/Tango.Web/Authentication/TokensManager.cs b/Software/Visual_Studio/Tango.Web/Authentication/TokensManager.cs
index 890d69d53..5829bfca3 100644
--- a/Software/Visual_Studio/Tango.Web/Authentication/TokensManager.cs
+++ b/Software/Visual_Studio/Tango.Web/Authentication/TokensManager.cs
@@ -48,8 +48,8 @@ namespace Tango.Web.Authentication
Value = tokenObject,
WebToken = new WebToken()
{
- AccessToken = token,
- Expiration = DateTime.UtcNow.Add(ExpirationTime)
+ //AccessToken = token,
+ //Expiration = DateTime.UtcNow.Add(ExpirationTime)
},
};
@@ -73,7 +73,7 @@ namespace Tango.Web.Authentication
if (DateTime.UtcNow > _tokens[token].WebToken.Expiration)
{
_tokens.Remove(token);
- throw new SessionExpiredException("Session Expired.");
+ throw new TokenExpiredException("Session Expired.");
}
return _tokens[token].Value;
diff --git a/Software/Visual_Studio/Tango.Web/Authentication/WebToken.cs b/Software/Visual_Studio/Tango.Web/Authentication/WebToken.cs
index 71ec6eb0b..14fc49942 100644
--- a/Software/Visual_Studio/Tango.Web/Authentication/WebToken.cs
+++ b/Software/Visual_Studio/Tango.Web/Authentication/WebToken.cs
@@ -1,6 +1,12 @@
-using System;
+using JWT;
+using JWT.Algorithms;
+using JWT.Builder;
+using JWT.Serializers;
+using Newtonsoft.Json;
+using System;
using System.Collections.Generic;
using System.Linq;
+using System.Security.Claims;
using System.Text;
using System.Threading.Tasks;
@@ -8,7 +14,146 @@ namespace Tango.Web.Authentication
{
public class WebToken
{
- public DateTime Expiration { get; set; }
- public String AccessToken { get; set; }
+ public DateTime Issued { get; protected set; }
+ public DateTime? Expiration { get; protected set; }
+ public String AccessToken { get; protected set; }
+
+ public WebToken()
+ {
+
+ }
+
+ public static WebToken CreateNew(String secret, DateTime? expiration = null)
+ {
+ DateTime issued = DateTime.UtcNow;
+
+ var builder = new JwtBuilder()
+ .WithAlgorithm(new HMACSHA256Algorithm())
+ .WithSecret(secret)
+ .IssuedAt(issued);
+
+ if (expiration != null)
+ {
+ builder = builder.ExpirationTime(expiration.Value);
+ }
+
+ builder = builder.AddClaim("object", null);
+
+ return new WebToken()
+ {
+ AccessToken = builder.Build(),
+ Expiration = expiration,
+ Issued = issued,
+ };
+ }
+
+ public static void Validate(String secret, String token)
+ {
+ var json = new JwtBuilder()
+ .WithSecret(secret)
+ .MustVerifySignature()
+ .Decode(token);
+ }
+
+ public void Validate(String secret)
+ {
+ var json = new JwtBuilder()
+ .WithSecret(secret)
+ .MustVerifySignature()
+ .Decode(AccessToken);
+ }
+
+ public static WebToken FromToken(String token)
+ {
+ WebToken webToken = new WebToken();
+
+ var payload = new JwtBuilder()
+ .WithValidator(null)
+ .Decode<IDictionary<string, object>>(token);
+
+ webToken.AccessToken = token;
+
+ if (payload.ContainsKey("exp"))
+ {
+ long exp = long.Parse(payload["exp"].ToString());
+ webToken.Expiration = ConvertEpochToDateTime(exp);
+ }
+
+ if (payload.ContainsKey("iat"))
+ {
+ long iat = long.Parse(payload["iat"].ToString());
+ webToken.Issued = ConvertEpochToDateTime(iat);
+ }
+
+ return webToken;
+ }
+
+ protected static DateTime ConvertEpochToDateTime(long seconds)
+ {
+ var epoch = new DateTime(1970, 1, 1, 0, 0, 0, DateTimeKind.Utc);
+ return epoch.AddSeconds(seconds);
+ }
+ }
+
+ public class WebToken<T> : WebToken where T : class
+ {
+ public T Object { get; protected set; }
+
+ private WebToken()
+ {
+
+ }
+
+ public static WebToken<T> CreateNew(String secret, T obj = null, DateTime? expiration = null)
+ {
+ DateTime issued = DateTime.UtcNow;
+
+ var builder = new JwtBuilder()
+ .WithAlgorithm(new HMACSHA256Algorithm())
+ .WithSecret(secret)
+ .IssuedAt(issued);
+
+ if (expiration != null)
+ {
+ builder = builder.ExpirationTime(expiration.Value);
+ }
+
+ builder = builder.AddClaim("object", obj);
+
+ return new WebToken<T>()
+ {
+ AccessToken = builder.Build(),
+ Expiration = expiration,
+ Issued = issued,
+ Object = obj,
+ };
+ }
+
+ public static new WebToken<T> FromToken(String token)
+ {
+ WebToken<T> webToken = new WebToken<T>();
+
+ var payload = new JwtBuilder()
+ .WithValidator(null)
+ .Decode<IDictionary<string, object>>(token);
+
+ webToken.AccessToken = token;
+
+ if (payload.ContainsKey("exp"))
+ {
+ long exp = long.Parse(payload["exp"].ToString());
+ webToken.Expiration = ConvertEpochToDateTime(exp);
+ }
+
+ if (payload.ContainsKey("iat"))
+ {
+ long iat = long.Parse(payload["iat"].ToString());
+ webToken.Issued = ConvertEpochToDateTime(iat);
+ }
+
+ webToken.Object = JsonConvert.DeserializeObject<T>(payload["object"].ToString());
+
+ return webToken;
+ }
}
}
diff --git a/Software/Visual_Studio/Tango.Web/Authentication/WebTokenResponse.cs b/Software/Visual_Studio/Tango.Web/Authentication/WebTokenResponse.cs
index 17ac6636f..190a47cc2 100644
--- a/Software/Visual_Studio/Tango.Web/Authentication/WebTokenResponse.cs
+++ b/Software/Visual_Studio/Tango.Web/Authentication/WebTokenResponse.cs
@@ -9,6 +9,6 @@ namespace Tango.Web.Authentication
{
public class WebTokenResponse : WebResponseMessage
{
- public WebToken WebToken { get; set; }
+ public String AccessToken { get; set; }
}
}
diff --git a/Software/Visual_Studio/Tango.Web/Controllers/JsonController.cs b/Software/Visual_Studio/Tango.Web/Controllers/TangoController.cs
index 1fae9cccc..854d1cf96 100644
--- a/Software/Visual_Studio/Tango.Web/Controllers/JsonController.cs
+++ b/Software/Visual_Studio/Tango.Web/Controllers/TangoController.cs
@@ -10,14 +10,16 @@ using System.Web;
using System.Web.Http;
using System.Web.Http.Controllers;
using Tango.Logging;
+using Tango.Transport.Web;
+using Tango.Web.Authentication;
namespace Tango.Web.Controllers
{
- public class JsonController : ApiController
+ public class TangoController : ApiController
{
protected LogManager LogManager { get; private set; }
- public JsonController()
+ public TangoController()
{
LogManager = LogManager.Default;
}
@@ -43,10 +45,12 @@ namespace Tango.Web.Controllers
{
request = context.Request.Content.ReadAsStringAsync().Result;
}
- catch {}
+ catch { }
LogManager.Log($"Request Received on {controllerName + "/" + actionName}: \n{request}");
+ OnRequestArrived(context.Request);
+
var result = await base.ExecuteAsync(context, cancellationToken);
return result;
}
@@ -60,16 +64,61 @@ namespace Tango.Web.Controllers
{
code = HttpStatusCode.BadRequest;
}
- else if (ex is AuthenticationException)
+ else if (ex is AuthenticationException || ex is TokenExpiredException)
{
code = HttpStatusCode.Unauthorized;
}
+ var httpException = new HttpResponseException(Request.CreateErrorResponse(code, ex));
+
#if DEBUG
- throw new HttpResponseException(Request.CreateErrorResponse(code, ex.ToString()));
+ throw httpException;
#else
- throw new HttpResponseException(Request.CreateErrorResponse(code, ex.FlattenMessage()));
+ //Remove Stack trace
+ var expandedException = httpException.Response.Content as System.Net.Http.ObjectContent<System.Web.Http.HttpError>;
+
+ if (expandedException != null)
+ {
+ var expandedExceptionValues = expandedException.Value as HttpError;
+
+ if (expandedExceptionValues != null)
+ {
+ expandedExceptionValues["StackTrace"] = "StackTrace not provided.";
+ }
+ }
#endif
+
+
+ throw httpException;
+ }
+ }
+
+ protected virtual void OnRequestArrived(HttpRequestMessage request)
+ {
+ //Do nothing.
+ }
+ }
+
+ public class TangoController<T> : TangoController where T : class
+ {
+ public WebToken<T> RequestToken { get; set; }
+
+ protected override void OnRequestArrived(HttpRequestMessage request)
+ {
+ base.OnRequestArrived(request);
+
+ var authorizationHeader = request.Headers.Authorization;
+
+ if (authorizationHeader != null && authorizationHeader.Parameter != null)
+ {
+ try
+ {
+ RequestToken = WebToken<T>.FromToken(authorizationHeader.Parameter);
+ }
+ catch (Exception ex)
+ {
+ throw new HttpParseException("Could not parse the provided token embedded object.", ex);
+ }
}
}
}
diff --git a/Software/Visual_Studio/Tango.Web/Tango.Web.csproj b/Software/Visual_Studio/Tango.Web/Tango.Web.csproj
index 56711df28..961ec04e8 100644
--- a/Software/Visual_Studio/Tango.Web/Tango.Web.csproj
+++ b/Software/Visual_Studio/Tango.Web/Tango.Web.csproj
@@ -48,6 +48,9 @@
<Reference Include="Google.Protobuf, Version=3.4.1.0, Culture=neutral, PublicKeyToken=a7d26565bac4d604, processorArchitecture=MSIL">
<HintPath>..\packages\Google.Protobuf.3.4.1\lib\net45\Google.Protobuf.dll</HintPath>
</Reference>
+ <Reference Include="JWT, Version=5.0.0.0, Culture=neutral, processorArchitecture=MSIL">
+ <HintPath>..\packages\JWT.5.0.0\lib\net46\JWT.dll</HintPath>
+ </Reference>
<Reference Include="Microsoft.AI.Agent.Intercept, Version=2.0.6.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<HintPath>..\packages\Microsoft.ApplicationInsights.Agent.Intercept.2.0.6\lib\net45\Microsoft.AI.Agent.Intercept.dll</HintPath>
</Reference>
@@ -186,13 +189,14 @@
<HintPath>..\packages\Microsoft.Web.Infrastructure.1.0.0.0\lib\net40\Microsoft.Web.Infrastructure.dll</HintPath>
</Reference>
<Reference Include="Microsoft.WindowsAzure.Storage, Version=4.3.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL" />
- <Reference Include="Newtonsoft.Json, Version=8.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
- <HintPath>..\packages\Newtonsoft.Json.8.0.3\lib\net45\Newtonsoft.Json.dll</HintPath>
+ <Reference Include="Newtonsoft.Json, Version=9.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
+ <HintPath>..\packages\Newtonsoft.Json.9.0.1\lib\net45\Newtonsoft.Json.dll</HintPath>
</Reference>
<Reference Include="System" />
<Reference Include="System.ComponentModel.DataAnnotations" />
<Reference Include="System.Configuration" />
<Reference Include="System.Core" />
+ <Reference Include="System.IdentityModel" />
<Reference Include="System.Net.Http.Formatting, Version=5.2.3.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<HintPath>..\packages\Microsoft.AspNet.WebApi.Client.5.2.3\lib\net45\System.Net.Http.Formatting.dll</HintPath>
</Reference>
@@ -257,7 +261,7 @@
<Compile Include="TangoWebApplication.cs" />
<Compile Include="TangoWebClient.cs" />
<Compile Include="WebConfig.cs" />
- <Compile Include="Controllers\JsonController.cs" />
+ <Compile Include="Controllers\TangoController.cs" />
<Compile Include="Formatters\JsonNetFormatter.cs" />
<Compile Include="Helpers\ObservablesContextHelper.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
@@ -268,8 +272,12 @@
<Compile Include="WebSettings.cs" />
</ItemGroup>
<ItemGroup>
- <None Include="app.config" />
- <None Include="packages.config" />
+ <None Include="app.config">
+ <SubType>Designer</SubType>
+ </None>
+ <None Include="packages.config">
+ <SubType>Designer</SubType>
+ </None>
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\Tango.BL\Tango.BL.csproj">
diff --git a/Software/Visual_Studio/Tango.Web/TangoWebClient.cs b/Software/Visual_Studio/Tango.Web/TangoWebClient.cs
index bb943533a..42a9d801c 100644
--- a/Software/Visual_Studio/Tango.Web/TangoWebClient.cs
+++ b/Software/Visual_Studio/Tango.Web/TangoWebClient.cs
@@ -15,8 +15,8 @@ namespace Tango.Web
private bool _disposed;
private TLoginRequest _lastLoginRequest;
- private DeploymentSlot _environment;
- public DeploymentSlot Environment
+ private DeploymentSlot? _environment;
+ public DeploymentSlot? Environment
{
get { return _environment; }
set
@@ -31,26 +31,40 @@ namespace Tango.Web
}
}
+ public String Address { get; set; }
public String Controller { get; private set; }
+ public String Token { get; private set; }
public WebToken WebToken { get; private set; }
public bool IsAuthenticated { get; private set; }
public TangoWebClient(DeploymentSlot environment, String controller)
{
+ _client = new WebTransportClient();
Controller = controller;
Environment = environment;
- _client = new WebTransportClient();
}
- public TangoWebClient(DeploymentSlot environment, String controller, WebToken token) : this(environment, controller)
+ public TangoWebClient(DeploymentSlot environment, String controller, String token) : this(environment, controller)
{
- WebToken = token;
+ Token = token;
+ }
+
+ public TangoWebClient(String address, String controller, String token)
+ {
+ _client = new WebTransportClient();
+ Address = address;
+ Controller = controller;
+ Token = token;
}
public async Task<TLoginResponse> Login(TLoginRequest request)
{
var response = await _client.PostJson<TLoginRequest, TLoginResponse>(GetActionAddress("Login"), request);
- WebToken = response.WebToken;
+ Token = response.AccessToken;
+ _client.AuthenticationToken = Token;
+
+ WebToken = WebToken.FromToken(Token);
+
_lastLoginRequest = request;
IsAuthenticated = true;
return response;
@@ -58,27 +72,11 @@ namespace Tango.Web
protected virtual async Task<TResponse> Post<TRequest, TResponse>(String action, TRequest request) where TRequest : class, IWebRequestMessage where TResponse : class, IWebResponseMessage
{
- bool has_own_token = false;
-
- if (request is WebRequestSecureMessage)
+ if (IsAuthenticated)
{
- has_own_token = (request as WebRequestSecureMessage).AccessToken != null;
-
- if (!has_own_token)
+ if (DateTime.UtcNow >= WebToken.Expiration)
{
- if (IsAuthenticated)
- {
- if (DateTime.UtcNow >= WebToken.Expiration)
- {
- await Login(_lastLoginRequest);
- }
- }
- else
- {
- throw new AuthenticationException("This tango web client has not been authenticated with the service. Please use the login method to authenticate.");
- }
-
- (request as WebRequestSecureMessage).AccessToken = WebToken.AccessToken;
+ await Login(_lastLoginRequest);
}
}
@@ -87,28 +85,15 @@ namespace Tango.Web
var response = await _client.PostJson<TRequest, TResponse>(GetActionAddress(action), request);
return response;
}
- catch (SessionExpiredException)
+ catch (TokenExpiredException)
{
- if (!has_own_token)
+ try
{
- try
- {
- await Login(_lastLoginRequest);
-
- if (request is WebRequestSecureMessage)
- {
- (request as WebRequestSecureMessage).AccessToken = WebToken.AccessToken;
- }
-
- var response = await _client.PostJson<TRequest, TResponse>(GetActionAddress(action), request);
- return response;
- }
- catch
- {
- throw;
- }
+ await Login(_lastLoginRequest);
+ var response = await _client.PostJson<TRequest, TResponse>(GetActionAddress(action), request);
+ return response;
}
- else
+ catch
{
throw;
}
@@ -126,7 +111,14 @@ namespace Tango.Web
protected virtual String GetServiceAddress()
{
- return Environment.ToAddress() + $"/api/{Controller}/";
+ if (Environment != null)
+ {
+ return Environment.Value.ToAddress() + $"/api/{Controller}/";
+ }
+ else
+ {
+ return Address + $"/api/{Controller}/";
+ }
}
public virtual void Dispose()
diff --git a/Software/Visual_Studio/Tango.Web/app.config b/Software/Visual_Studio/Tango.Web/app.config
index 63664236a..bc38de989 100644
--- a/Software/Visual_Studio/Tango.Web/app.config
+++ b/Software/Visual_Studio/Tango.Web/app.config
@@ -8,7 +8,7 @@
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<assemblyIdentity name="Newtonsoft.Json" publicKeyToken="30ad4fe6b2a6aeed" culture="neutral" />
- <bindingRedirect oldVersion="0.0.0.0-8.0.0.0" newVersion="8.0.0.0" />
+ <bindingRedirect oldVersion="0.0.0.0-9.0.0.0" newVersion="9.0.0.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="WebGrease" publicKeyToken="31bf3856ad364e35" culture="neutral" />
@@ -30,6 +30,10 @@
<assemblyIdentity name="Microsoft.IdentityModel.Clients.ActiveDirectory" publicKeyToken="31bf3856ad364e35" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-2.7.0.0" newVersion="2.7.0.0" />
</dependentAssembly>
+ <dependentAssembly>
+ <assemblyIdentity name="System.Reactive.Core" publicKeyToken="94bc3704cddfc263" culture="neutral" />
+ <bindingRedirect oldVersion="0.0.0.0-3.0.3000.0" newVersion="3.0.3000.0" />
+ </dependentAssembly>
</assemblyBinding>
</runtime>
<entityFramework>
diff --git a/Software/Visual_Studio/Tango.Web/packages.config b/Software/Visual_Studio/Tango.Web/packages.config
index cb6027500..0a940a2ea 100644
--- a/Software/Visual_Studio/Tango.Web/packages.config
+++ b/Software/Visual_Studio/Tango.Web/packages.config
@@ -3,6 +3,7 @@
<package id="Antlr" version="3.4.1.9004" targetFramework="net461" />
<package id="EntityFramework" version="6.2.0" targetFramework="net461" />
<package id="Google.Protobuf" version="3.4.1" targetFramework="net461" />
+ <package id="JWT" version="5.0.0" targetFramework="net461" />
<package id="Microsoft.ApplicationInsights" version="2.2.0" targetFramework="net461" />
<package id="Microsoft.ApplicationInsights.Agent.Intercept" version="2.0.6" targetFramework="net461" />
<package id="Microsoft.ApplicationInsights.DependencyCollector" version="2.2.0" targetFramework="net461" />
@@ -29,7 +30,7 @@
<package id="Microsoft.SqlServer.SqlManagementObjects" version="140.17283.0" targetFramework="net461" />
<package id="Microsoft.Web.Infrastructure" version="1.0.0.0" targetFramework="net461" />
<package id="Modernizr" version="2.6.2" targetFramework="net461" />
- <package id="Newtonsoft.Json" version="8.0.3" targetFramework="net461" />
+ <package id="Newtonsoft.Json" version="9.0.1" targetFramework="net461" />
<package id="Respond" version="1.2.0" targetFramework="net461" />
<package id="System.Spatial" version="5.6.4" targetFramework="net461" />
<package id="WebGrease" version="1.5.2" targetFramework="net461" />
diff --git a/Software/Visual_Studio/Utilities/Tango.BugReporter/App.config b/Software/Visual_Studio/Utilities/Tango.BugReporter/App.config
index 1955443c4..09c4c4217 100644
--- a/Software/Visual_Studio/Utilities/Tango.BugReporter/App.config
+++ b/Software/Visual_Studio/Utilities/Tango.BugReporter/App.config
@@ -7,7 +7,7 @@
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<assemblyIdentity name="Newtonsoft.Json" publicKeyToken="30ad4fe6b2a6aeed" culture="neutral" />
- <bindingRedirect oldVersion="0.0.0.0-8.0.0.0" newVersion="8.0.0.0" />
+ <bindingRedirect oldVersion="0.0.0.0-9.0.0.0" newVersion="9.0.0.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="Microsoft.IdentityModel.Clients.ActiveDirectory" publicKeyToken="31bf3856ad364e35" culture="neutral" />
diff --git a/Software/Visual_Studio/Utilities/Tango.MachineEM.UI/App.config b/Software/Visual_Studio/Utilities/Tango.MachineEM.UI/App.config
index eba7ddbbd..ef214165a 100644
--- a/Software/Visual_Studio/Utilities/Tango.MachineEM.UI/App.config
+++ b/Software/Visual_Studio/Utilities/Tango.MachineEM.UI/App.config
@@ -63,7 +63,7 @@
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="Newtonsoft.Json" publicKeyToken="30ad4fe6b2a6aeed" culture="neutral" />
- <bindingRedirect oldVersion="0.0.0.0-8.0.0.0" newVersion="8.0.0.0" />
+ <bindingRedirect oldVersion="0.0.0.0-9.0.0.0" newVersion="9.0.0.0" />
</dependentAssembly>
</assemblyBinding>
</runtime>
diff --git a/Software/Visual_Studio/Utilities/Tango.RemoteRunner.UI/App.config b/Software/Visual_Studio/Utilities/Tango.RemoteRunner.UI/App.config
index 3275d5443..862732d18 100644
--- a/Software/Visual_Studio/Utilities/Tango.RemoteRunner.UI/App.config
+++ b/Software/Visual_Studio/Utilities/Tango.RemoteRunner.UI/App.config
@@ -59,7 +59,7 @@
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="Newtonsoft.Json" publicKeyToken="30ad4fe6b2a6aeed" culture="neutral" />
- <bindingRedirect oldVersion="0.0.0.0-8.0.0.0" newVersion="8.0.0.0" />
+ <bindingRedirect oldVersion="0.0.0.0-9.0.0.0" newVersion="9.0.0.0" />
</dependentAssembly>
</assemblyBinding>
</runtime>
diff --git a/Software/Visual_Studio/Utilities/Tango.Stubs.CLI/App.config b/Software/Visual_Studio/Utilities/Tango.Stubs.CLI/App.config
index 6b464734d..45f745b55 100644
--- a/Software/Visual_Studio/Utilities/Tango.Stubs.CLI/App.config
+++ b/Software/Visual_Studio/Utilities/Tango.Stubs.CLI/App.config
@@ -11,7 +11,7 @@
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="Newtonsoft.Json" publicKeyToken="30ad4fe6b2a6aeed" culture="neutral" />
- <bindingRedirect oldVersion="0.0.0.0-8.0.0.0" newVersion="8.0.0.0" />
+ <bindingRedirect oldVersion="0.0.0.0-9.0.0.0" newVersion="9.0.0.0" />
</dependentAssembly>
</assemblyBinding>
</runtime>
diff --git a/Software/Visual_Studio/Utilities/Tango.Stubs.CLI/Tango.Stubs.CLI.csproj b/Software/Visual_Studio/Utilities/Tango.Stubs.CLI/Tango.Stubs.CLI.csproj
index 3f63a6f0d..102c64cb7 100644
--- a/Software/Visual_Studio/Utilities/Tango.Stubs.CLI/Tango.Stubs.CLI.csproj
+++ b/Software/Visual_Studio/Utilities/Tango.Stubs.CLI/Tango.Stubs.CLI.csproj
@@ -41,8 +41,8 @@
<Reference Include="Google.Protobuf, Version=3.4.1.0, Culture=neutral, PublicKeyToken=a7d26565bac4d604, processorArchitecture=MSIL">
<HintPath>..\..\packages\Google.Protobuf.3.4.1\lib\net45\Google.Protobuf.dll</HintPath>
</Reference>
- <Reference Include="Newtonsoft.Json, Version=8.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
- <HintPath>..\..\packages\Newtonsoft.Json.8.0.3\lib\net45\Newtonsoft.Json.dll</HintPath>
+ <Reference Include="Newtonsoft.Json, Version=9.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
+ <HintPath>..\..\packages\Newtonsoft.Json.9.0.1\lib\net45\Newtonsoft.Json.dll</HintPath>
</Reference>
<Reference Include="System" />
<Reference Include="System.Core" />
@@ -93,7 +93,7 @@
<Import Project="..\..\packages\Costura.Fody.1.6.2\build\dotnet\Costura.Fody.targets" Condition="Exists('..\..\packages\Costura.Fody.1.6.2\build\dotnet\Costura.Fody.targets')" />
<ProjectExtensions>
<VisualStudio>
- <UserProperties BuildVersion_StartDate="2000/1/1" BuildVersion_UseGlobalSettings="False" BuildVersion_BuildVersioningStyle="None.None.Increment.TimeStamp" BuildVersion_UpdateAssemblyVersion="True" BuildVersion_AssemblyInfoFilename="Properties\AssemblyInfo.cs" />
+ <UserProperties BuildVersion_AssemblyInfoFilename="Properties\AssemblyInfo.cs" BuildVersion_UpdateAssemblyVersion="True" BuildVersion_BuildVersioningStyle="None.None.Increment.TimeStamp" BuildVersion_UseGlobalSettings="False" BuildVersion_StartDate="2000/1/1" />
</VisualStudio>
</ProjectExtensions>
</Project> \ No newline at end of file
diff --git a/Software/Visual_Studio/Utilities/Tango.Stubs.CLI/packages.config b/Software/Visual_Studio/Utilities/Tango.Stubs.CLI/packages.config
index 2ec46e138..93113a56a 100644
--- a/Software/Visual_Studio/Utilities/Tango.Stubs.CLI/packages.config
+++ b/Software/Visual_Studio/Utilities/Tango.Stubs.CLI/packages.config
@@ -3,5 +3,5 @@
<package id="Costura.Fody" version="1.6.2" targetFramework="net46" developmentDependency="true" />
<package id="Fody" version="2.0.0" targetFramework="net46" developmentDependency="true" />
<package id="Google.Protobuf" version="3.4.1" targetFramework="net46" />
- <package id="Newtonsoft.Json" version="8.0.3" targetFramework="net46" />
+ <package id="Newtonsoft.Json" version="9.0.1" targetFramework="net461" />
</packages> \ No newline at end of file
diff --git a/Software/Visual_Studio/Utilities/Tango.Stubs.UI/App.config b/Software/Visual_Studio/Utilities/Tango.Stubs.UI/App.config
index 02866ad95..e060dcc60 100644
--- a/Software/Visual_Studio/Utilities/Tango.Stubs.UI/App.config
+++ b/Software/Visual_Studio/Utilities/Tango.Stubs.UI/App.config
@@ -191,7 +191,7 @@
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="Newtonsoft.Json" publicKeyToken="30ad4fe6b2a6aeed" culture="neutral" />
- <bindingRedirect oldVersion="0.0.0.0-8.0.0.0" newVersion="8.0.0.0" />
+ <bindingRedirect oldVersion="0.0.0.0-9.0.0.0" newVersion="9.0.0.0" />
</dependentAssembly>
</assemblyBinding>
</runtime>
diff --git a/Software/Visual_Studio/Utilities/Tango.Stubs.UI/Tango.Stubs.UI.csproj b/Software/Visual_Studio/Utilities/Tango.Stubs.UI/Tango.Stubs.UI.csproj
index 9d6a8b15e..0cff0bf07 100644
--- a/Software/Visual_Studio/Utilities/Tango.Stubs.UI/Tango.Stubs.UI.csproj
+++ b/Software/Visual_Studio/Utilities/Tango.Stubs.UI/Tango.Stubs.UI.csproj
@@ -52,8 +52,8 @@
<Reference Include="MahApps.Metro, Version=1.5.0.23, Culture=neutral, PublicKeyToken=f4fb5a3c4d1e5b4f, processorArchitecture=MSIL">
<HintPath>..\..\packages\MahApps.Metro.1.5.0\lib\net45\MahApps.Metro.dll</HintPath>
</Reference>
- <Reference Include="Newtonsoft.Json, Version=8.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
- <HintPath>..\..\packages\Newtonsoft.Json.8.0.3\lib\net45\Newtonsoft.Json.dll</HintPath>
+ <Reference Include="Newtonsoft.Json, Version=9.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
+ <HintPath>..\..\packages\Newtonsoft.Json.9.0.1\lib\net45\Newtonsoft.Json.dll</HintPath>
</Reference>
<Reference Include="System" />
<Reference Include="System.Data" />
@@ -189,7 +189,7 @@
<Import Project="..\..\packages\Costura.Fody.1.6.2\build\dotnet\Costura.Fody.targets" Condition="Exists('..\..\packages\Costura.Fody.1.6.2\build\dotnet\Costura.Fody.targets')" />
<ProjectExtensions>
<VisualStudio>
- <UserProperties BuildVersion_AssemblyInfoFilename="Properties\AssemblyInfo.cs" BuildVersion_UpdateAssemblyVersion="True" BuildVersion_BuildVersioningStyle="None.None.Increment.TimeStamp" BuildVersion_UseGlobalSettings="False" BuildVersion_StartDate="2000/1/1" />
+ <UserProperties BuildVersion_StartDate="2000/1/1" BuildVersion_UseGlobalSettings="False" BuildVersion_BuildVersioningStyle="None.None.Increment.TimeStamp" BuildVersion_UpdateAssemblyVersion="True" BuildVersion_AssemblyInfoFilename="Properties\AssemblyInfo.cs" />
</VisualStudio>
</ProjectExtensions>
</Project> \ No newline at end of file
diff --git a/Software/Visual_Studio/Utilities/Tango.Stubs.UI/packages.config b/Software/Visual_Studio/Utilities/Tango.Stubs.UI/packages.config
index 7725c864a..b064d7f85 100644
--- a/Software/Visual_Studio/Utilities/Tango.Stubs.UI/packages.config
+++ b/Software/Visual_Studio/Utilities/Tango.Stubs.UI/packages.config
@@ -5,5 +5,5 @@
<package id="FontAwesome.WPF" version="4.7.0.9" targetFramework="net46" />
<package id="Google.Protobuf" version="3.4.1" targetFramework="net46" />
<package id="MahApps.Metro" version="1.5.0" targetFramework="net46" />
- <package id="Newtonsoft.Json" version="8.0.3" targetFramework="net46" />
+ <package id="Newtonsoft.Json" version="9.0.1" targetFramework="net461" />
</packages> \ No newline at end of file
diff --git a/Software/Visual_Studio/Utilities/Tango.TransportRouter.UI/App.config b/Software/Visual_Studio/Utilities/Tango.TransportRouter.UI/App.config
index 23bbb5aa7..45b81480f 100644
--- a/Software/Visual_Studio/Utilities/Tango.TransportRouter.UI/App.config
+++ b/Software/Visual_Studio/Utilities/Tango.TransportRouter.UI/App.config
@@ -59,7 +59,7 @@
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="Newtonsoft.Json" publicKeyToken="30ad4fe6b2a6aeed" culture="neutral" />
- <bindingRedirect oldVersion="0.0.0.0-8.0.0.0" newVersion="8.0.0.0" />
+ <bindingRedirect oldVersion="0.0.0.0-9.0.0.0" newVersion="9.0.0.0" />
</dependentAssembly>
</assemblyBinding>
</runtime>
diff --git a/Software/Visual_Studio/Utilities/Tango.UITests/App.config b/Software/Visual_Studio/Utilities/Tango.UITests/App.config
index ff7bf1461..f2a26c582 100644
--- a/Software/Visual_Studio/Utilities/Tango.UITests/App.config
+++ b/Software/Visual_Studio/Utilities/Tango.UITests/App.config
@@ -62,7 +62,7 @@
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="Newtonsoft.Json" publicKeyToken="30ad4fe6b2a6aeed" culture="neutral" />
- <bindingRedirect oldVersion="0.0.0.0-8.0.0.0" newVersion="8.0.0.0" />
+ <bindingRedirect oldVersion="0.0.0.0-9.0.0.0" newVersion="9.0.0.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="Microsoft.Data.Edm" publicKeyToken="31bf3856ad364e35" culture="neutral" />
diff --git a/Software/Visual_Studio/Utilities/Tango.WebClientGenerator/App.config b/Software/Visual_Studio/Utilities/Tango.WebClientGenerator/App.config
index d748e2305..f74b85d15 100644
--- a/Software/Visual_Studio/Utilities/Tango.WebClientGenerator/App.config
+++ b/Software/Visual_Studio/Utilities/Tango.WebClientGenerator/App.config
@@ -7,7 +7,7 @@
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<assemblyIdentity name="Newtonsoft.Json" publicKeyToken="30ad4fe6b2a6aeed" culture="neutral" />
- <bindingRedirect oldVersion="0.0.0.0-8.0.0.0" newVersion="8.0.0.0" />
+ <bindingRedirect oldVersion="0.0.0.0-9.0.0.0" newVersion="9.0.0.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="Microsoft.Data.Edm" publicKeyToken="31bf3856ad364e35" culture="neutral" />
@@ -27,7 +27,7 @@
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="Microsoft.IdentityModel.Clients.ActiveDirectory" publicKeyToken="31bf3856ad364e35" culture="neutral" />
- <bindingRedirect oldVersion="0.0.0.0-2.7.0.0" newVersion="2.7.0.0" />
+ <bindingRedirect oldVersion="0.0.0.0-3.19.8.16603" newVersion="3.19.8.16603" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Reactive.Core" publicKeyToken="94bc3704cddfc263" culture="neutral" />
diff --git a/Software/Visual_Studio/Utilities/Tango.WebClientGenerator/Program.cs b/Software/Visual_Studio/Utilities/Tango.WebClientGenerator/Program.cs
index e95f57344..d645f0e5e 100644
--- a/Software/Visual_Studio/Utilities/Tango.WebClientGenerator/Program.cs
+++ b/Software/Visual_Studio/Utilities/Tango.WebClientGenerator/Program.cs
@@ -23,7 +23,7 @@ namespace Tango.WebClientGenerator
GenerateWebClient<MachineStudio.Common.Web.LoginRequest, MachineStudio.Common.Web.LoginResponse, MachineService.Controllers.MachineStudioController>("Tango.MachineStudio.Common.Web", "MachineStudioWebClientBase", PathHelper.GetSolutionFolder() + @"\MachineStudio\Tango.MachineStudio.Common\Web");
}
- private static void GenerateWebClient<TLoginRequest, TLoginResponse, TController>(String nameSpace, String name, String path) where TLoginRequest : WebRequestMessage where TLoginResponse : WebTokenResponse where TController : JsonController
+ private static void GenerateWebClient<TLoginRequest, TLoginResponse, TController>(String nameSpace, String name, String path) where TLoginRequest : WebRequestMessage where TLoginResponse : WebTokenResponse where TController : TangoController
{
TangoWebClientCodeFile model = new TangoWebClientCodeFile();
model.Namespace = nameSpace;
diff --git a/Software/Visual_Studio/VSIX/Tango.BuildExtensions/app.config b/Software/Visual_Studio/VSIX/Tango.BuildExtensions/app.config
index 49b6f5ebe..55a256ebb 100644
--- a/Software/Visual_Studio/VSIX/Tango.BuildExtensions/app.config
+++ b/Software/Visual_Studio/VSIX/Tango.BuildExtensions/app.config
@@ -8,7 +8,7 @@
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="Newtonsoft.Json" publicKeyToken="30ad4fe6b2a6aeed" culture="neutral" />
- <bindingRedirect oldVersion="0.0.0.0-8.0.0.0" newVersion="8.0.0.0" />
+ <bindingRedirect oldVersion="0.0.0.0-9.0.0.0" newVersion="9.0.0.0" />
</dependentAssembly>
</assemblyBinding>
</runtime>
diff --git a/Software/Visual_Studio/Web/Tango.MachineService/App_Start/WebApiConfig.cs b/Software/Visual_Studio/Web/Tango.MachineService/App_Start/WebApiConfig.cs
index 0a63e9acb..73265328c 100644
--- a/Software/Visual_Studio/Web/Tango.MachineService/App_Start/WebApiConfig.cs
+++ b/Software/Visual_Studio/Web/Tango.MachineService/App_Start/WebApiConfig.cs
@@ -22,10 +22,10 @@ namespace Tango.MachineService
defaults: new { id = RouteParameter.Optional });
config.Formatters.Insert(0, new ProtoBufFormatter());
- config.Formatters.Insert(1, new JsonNetFormatter(new JsonSerializerSettings()
- {
- PreserveReferencesHandling = PreserveReferencesHandling.All,
- }));
+ //config.Formatters.Insert(1, new JsonNetFormatter(new JsonSerializerSettings()
+ //{
+ // PreserveReferencesHandling = PreserveReferencesHandling.All,
+ //}));
}
}
}
diff --git a/Software/Visual_Studio/Web/Tango.MachineService/Controllers/MachineStudioController.cs b/Software/Visual_Studio/Web/Tango.MachineService/Controllers/MachineStudioController.cs
index 054c8d781..467b6ae28 100644
--- a/Software/Visual_Studio/Web/Tango.MachineService/Controllers/MachineStudioController.cs
+++ b/Software/Visual_Studio/Web/Tango.MachineService/Controllers/MachineStudioController.cs
@@ -24,12 +24,15 @@ using Tango.MachineService.Filters;
namespace Tango.MachineService.Controllers
{
- public class MachineStudioController : JsonController
+ public class MachineStudioController : TangoController<MachineStudioController.TokenObject>
{
private static List<MachineStudioPendingUpload> _pendingUploads;
private ActiveDirectoryManager _ad_manager;
- public static TokensManager<String> TokensManager { get; set; }
+ public class TokenObject
+ {
+ public String UserGuid { get; set; }
+ }
#region Constructors
@@ -38,8 +41,6 @@ namespace Tango.MachineService.Controllers
/// </summary>
static MachineStudioController()
{
- TokensManager = new TokensManager<string>();
- TokensManager.ExpirationTime = TimeSpan.FromDays(10);
_pendingUploads = new List<MachineStudioPendingUpload>();
}
@@ -61,11 +62,13 @@ namespace Tango.MachineService.Controllers
/// <param name="request">The request.</param>
/// <returns></returns>
[HttpPost]
- [MachineStudioLoginFilter]
+ [JwtTokenFilter]
public CheckForUpdatesResponse CheckForUpdates(CheckForUpdatesRequest request)
{
LogManager.Log("Request received...");
+ var userID = RequestToken.Object.UserGuid;
+
CheckForUpdatesResponse response = new CheckForUpdatesResponse();
using (ObservablesContext db = ObservablesContextHelper.CreateContext())
@@ -103,7 +106,7 @@ namespace Tango.MachineService.Controllers
/// <param name="request">The request.</param>
/// <returns></returns>
[HttpPost]
- [MachineStudioLoginFilter]
+ [JwtTokenFilter]
public DownloadLatestVersionResponse DownloadLatestVersion(DownloadLatestVersionRequest request)
{
LogManager.Log("Request received...");
@@ -138,14 +141,14 @@ namespace Tango.MachineService.Controllers
/// <exception cref="System.ArgumentException">New version must be greater than latest version.</exception>
/// <exception cref="AuthenticationException">Invalid user credentials.</exception>
[HttpPost]
- [MachineStudioLoginFilter]
+ [JwtTokenFilter]
public UploadVersionResponse UploadVersion(UploadVersionRequest request)
{
UploadVersionResponse response = new UploadVersionResponse();
using (ObservablesContext db = ObservablesContextHelper.CreateContext())
{
- String userID = TokensManager.GetTokenObject(request.AccessToken);
+ String userID = RequestToken.Object.UserGuid;
var user = new UserBuilder(db).Set(userID).WithRolesAndPermissions().Build();
@@ -195,7 +198,7 @@ namespace Tango.MachineService.Controllers
/// <returns></returns>
/// <exception cref="System.ArgumentException">Invalid Token.</exception>
[HttpPost]
- [MachineStudioLoginFilter]
+ [JwtTokenFilter]
public UploadCompletedResponse NotifyUploadCompleted(UploadCompletedRequest request)
{
MachineStudioPendingUpload upload = _pendingUploads.FirstOrDefault(x => x.Token == request.Token);
@@ -347,7 +350,10 @@ namespace Tango.MachineService.Controllers
Password = request.Password,
},
- WebToken = TokensManager.GetOrCreate(user.Guid),
+ AccessToken = WebToken<TokenObject>.CreateNew(MachineServiceConfig.JWT_TOKEN_SECRET, new TokenObject()
+ {
+ UserGuid = user.Guid,
+ }, DateTime.UtcNow.AddDays(1)).AccessToken,
VersionChangeRequired = versionChangeRequired,
RequiredVersion = requiredVersion,
};
diff --git a/Software/Visual_Studio/Web/Tango.MachineService/Controllers/PPCController.cs b/Software/Visual_Studio/Web/Tango.MachineService/Controllers/PPCController.cs
index 70d64be51..912d2e5e9 100644
--- a/Software/Visual_Studio/Web/Tango.MachineService/Controllers/PPCController.cs
+++ b/Software/Visual_Studio/Web/Tango.MachineService/Controllers/PPCController.cs
@@ -26,30 +26,22 @@ using Tango.MachineService.Filters;
namespace Tango.MachineService.Controllers
{
- public class PPCController : JsonController
+ public class PPCController : TangoController<PPCController.TokenObject>
{
private static List<PPCPendingUpload> _pendingUploads;
private ActiveDirectoryManager _ad_manager;
- public class TokenObject : IEquatable<TokenObject>
+ public class TokenObject
{
public LoginMode Mode { get; set; }
public String UserGuid { get; set; }
public String MachineGuid { get; set; }
-
- public bool Equals(TokenObject other)
- {
- return UserGuid == other.UserGuid || MachineGuid == MachineGuid;
- }
}
- public static TokensManager<TokenObject> TokensManager { get; set; }
-
#region Constructors
static PPCController()
{
- TokensManager = new TokensManager<TokenObject>();
_pendingUploads = new List<PPCPendingUpload>();
}
@@ -62,8 +54,8 @@ namespace Tango.MachineService.Controllers
#region Setup & Update
- [PPCLoginFilter]
[HttpPost]
+ [JwtTokenFilter]
public MachineSetupResponse MachineSetup(MachineSetupRequest request)
{
MachineSetupResponse response = new MachineSetupResponse();
@@ -73,7 +65,7 @@ namespace Tango.MachineService.Controllers
using (ObservablesContext db = ObservablesContextHelper.CreateContext())
{
db.Configuration.LazyLoadingEnabled = false;
- String machine_guid = TokensManager.GetTokenObject(request.AccessToken).MachineGuid;
+ String machine_guid = RequestToken.Object.MachineGuid;
var machine = db.Machines.SingleOrDefault(x => x.Guid == machine_guid);
@@ -136,8 +128,8 @@ namespace Tango.MachineService.Controllers
return response;
}
- [PPCLoginFilter]
[HttpPost]
+ [JwtTokenFilter]
public DownloadUpdateResponse MachineUpdate(DownloadUpdateRequest request)
{
DownloadUpdateResponse response = new DownloadUpdateResponse();
@@ -145,7 +137,7 @@ namespace Tango.MachineService.Controllers
using (ObservablesContext db = ObservablesContextHelper.CreateContext())
{
db.Configuration.LazyLoadingEnabled = false;
- String machine_guid = TokensManager.GetTokenObject(request.AccessToken).MachineGuid;
+ String machine_guid = RequestToken.Object.MachineGuid;
var machine = db.Machines.SingleOrDefault(x => x.Guid == machine_guid);
@@ -195,15 +187,15 @@ namespace Tango.MachineService.Controllers
return response;
}
- [PPCLoginFilter]
[HttpPost]
+ [JwtTokenFilter]
public CheckForUpdateResponse CheckForUpdate(CheckForUpdateRequest request)
{
CheckForUpdateResponse response = new CheckForUpdateResponse();
using (ObservablesContext db = ObservablesContextHelper.CreateContext())
{
- String machine_guid = TokensManager.GetTokenObject(request.AccessToken).MachineGuid;
+ String machine_guid = RequestToken.Object.MachineGuid;
var machine = db.Machines.SingleOrDefault(x => x.Guid == machine_guid);
@@ -227,8 +219,8 @@ namespace Tango.MachineService.Controllers
return response;
}
- [PPCLoginFilter]
[HttpPost]
+ [JwtTokenFilter]
public UpdateDBResponse UpdateDB(UpdateDBRequest request)
{
UpdateDBResponse response = new UpdateDBResponse();
@@ -236,7 +228,7 @@ namespace Tango.MachineService.Controllers
using (ObservablesContext db = ObservablesContextHelper.CreateContext())
{
- String machine_guid = TokensManager.GetTokenObject(request.AccessToken).MachineGuid;
+ String machine_guid = RequestToken.Object.MachineGuid;
var machine = db.Machines.SingleOrDefault(x => x.Guid == machine_guid);
@@ -301,8 +293,8 @@ namespace Tango.MachineService.Controllers
return response;
}
- [PPCLoginFilter]
[HttpPost]
+ [JwtTokenFilter]
public UploadVersionResponse UploadVersion(UploadVersionRequest request)
{
UploadVersionResponse response = new UploadVersionResponse();
@@ -315,7 +307,7 @@ namespace Tango.MachineService.Controllers
db.UsersRoles.ToList();
db.RolesPermissions.ToList();
- var user_guid = TokensManager.GetTokenObject(request.AccessToken).UserGuid;
+ var user_guid = RequestToken.Object.UserGuid;
var user = new UserBuilder(db).Set(user_guid).WithRolesAndPermissions().Build();
@@ -369,8 +361,8 @@ namespace Tango.MachineService.Controllers
return response;
}
- [PPCLoginFilter]
[HttpPost]
+ [JwtTokenFilter]
public UploadCompletedResponse NotifyUploadCompleted(UploadCompletedRequest request)
{
PPCPendingUpload upload = _pendingUploads.FirstOrDefault(x => x.Token == request.Token);
@@ -439,11 +431,11 @@ namespace Tango.MachineService.Controllers
throw new AuthenticationException("Domain user found but the database entry validation failed.");
}
- response.WebToken = TokensManager.GetOrCreate(new TokenObject()
+ response.AccessToken = WebToken<TokenObject>.CreateNew(MachineServiceConfig.JWT_TOKEN_SECRET, new TokenObject()
{
Mode = LoginMode.User,
UserGuid = user.Guid,
- });
+ }).AccessToken;
}
else if (request.Mode == LoginMode.Machine)
{
@@ -454,11 +446,11 @@ namespace Tango.MachineService.Controllers
throw new AuthenticationException("Invalid serial number.");
}
- response.WebToken = TokensManager.GetOrCreate(new TokenObject()
+ response.AccessToken = WebToken<TokenObject>.CreateNew(MachineServiceConfig.JWT_TOKEN_SECRET, new TokenObject()
{
Mode = LoginMode.Machine,
MachineGuid = machine.Guid,
- });
+ }).AccessToken;
}
}
diff --git a/Software/Visual_Studio/Web/Tango.MachineService/Filters/JwtTokenFilter.cs b/Software/Visual_Studio/Web/Tango.MachineService/Filters/JwtTokenFilter.cs
new file mode 100644
index 000000000..4cf22cc43
--- /dev/null
+++ b/Software/Visual_Studio/Web/Tango.MachineService/Filters/JwtTokenFilter.cs
@@ -0,0 +1,46 @@
+using Newtonsoft.Json;
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Net;
+using System.Net.Http;
+using System.Security.Authentication;
+using System.Web;
+using System.Web.Http;
+using System.Web.Http.Controllers;
+using System.Web.Http.Filters;
+using Tango.Transport.Web;
+using Tango.Web.Authentication;
+
+namespace Tango.MachineService.Filters
+{
+ public class JwtTokenFilter : ActionFilterAttribute
+ {
+ public override void OnActionExecuting(HttpActionContext actionContext)
+ {
+ var authorizationHeader = actionContext.Request.Headers.Authorization;
+
+ if (authorizationHeader != null && authorizationHeader.Parameter != null)
+ {
+ try
+ {
+ WebToken.Validate(MachineServiceConfig.JWT_TOKEN_SECRET, authorizationHeader.Parameter);
+ }
+ catch (JWT.TokenExpiredException)
+ {
+ throw new TokenExpiredException("Token expired.");
+ }
+ catch (JWT.SignatureVerificationException)
+ {
+ throw new InvalidTokenException("Invalid token.");
+ }
+ }
+ else
+ {
+ throw new AuthenticationException("No token specified.");
+ }
+
+ base.OnActionExecuting(actionContext);
+ }
+ }
+} \ No newline at end of file
diff --git a/Software/Visual_Studio/Web/Tango.MachineService/Filters/MachineStudioLoginFilter.cs b/Software/Visual_Studio/Web/Tango.MachineService/Filters/MachineStudioLoginFilter.cs
deleted file mode 100644
index dfa78f0a0..000000000
--- a/Software/Visual_Studio/Web/Tango.MachineService/Filters/MachineStudioLoginFilter.cs
+++ /dev/null
@@ -1,35 +0,0 @@
-using Newtonsoft.Json;
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Net;
-using System.Net.Http;
-using System.Security.Authentication;
-using System.Web;
-using System.Web.Http;
-using System.Web.Http.Controllers;
-using System.Web.Http.Filters;
-using Tango.Transport.Web;
-
-namespace Tango.MachineService.Filters
-{
- public class MachineStudioLoginFilter : ActionFilterAttribute
- {
- public override void OnActionExecuting(HttpActionContext actionContext)
- {
- var json = actionContext.Request.Content.ReadAsStringAsync().Result;
- WebRequestSecureMessage msg = JsonConvert.DeserializeObject<WebRequestSecureMessage>(json);
-
- try
- {
- Controllers.MachineStudioController.TokensManager.Validate(msg.AccessToken);
- }
- catch (Exception ex)
- {
- throw new HttpResponseException(actionContext.Request.CreateErrorResponse(HttpStatusCode.Unauthorized, ex));
- }
-
- base.OnActionExecuting(actionContext);
- }
- }
-} \ No newline at end of file
diff --git a/Software/Visual_Studio/Web/Tango.MachineService/Filters/PPCLoginFilter.cs b/Software/Visual_Studio/Web/Tango.MachineService/Filters/PPCLoginFilter.cs
deleted file mode 100644
index 322023b7d..000000000
--- a/Software/Visual_Studio/Web/Tango.MachineService/Filters/PPCLoginFilter.cs
+++ /dev/null
@@ -1,35 +0,0 @@
-using Newtonsoft.Json;
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Net;
-using System.Net.Http;
-using System.Security.Authentication;
-using System.Web;
-using System.Web.Http;
-using System.Web.Http.Controllers;
-using System.Web.Http.Filters;
-using Tango.Transport.Web;
-
-namespace Tango.MachineService.Filters
-{
- public class PPCLoginFilter : ActionFilterAttribute
- {
- public override void OnActionExecuting(HttpActionContext actionContext)
- {
- var json = actionContext.Request.Content.ReadAsStringAsync().Result;
- WebRequestSecureMessage msg = JsonConvert.DeserializeObject<WebRequestSecureMessage>(json);
-
- try
- {
- Controllers.PPCController.TokensManager.Validate(msg.AccessToken);
- }
- catch (Exception ex)
- {
- throw new HttpResponseException(actionContext.Request.CreateErrorResponse(HttpStatusCode.Unauthorized, ex));
- }
-
- base.OnActionExecuting(actionContext);
- }
- }
-} \ No newline at end of file
diff --git a/Software/Visual_Studio/Web/Tango.MachineService/MachineServiceConfig.cs b/Software/Visual_Studio/Web/Tango.MachineService/MachineServiceConfig.cs
index 289fb08e2..a6aa71944 100644
--- a/Software/Visual_Studio/Web/Tango.MachineService/MachineServiceConfig.cs
+++ b/Software/Visual_Studio/Web/Tango.MachineService/MachineServiceConfig.cs
@@ -12,5 +12,6 @@ namespace Tango.MachineService
public static String TANGO_VERSIONS_CONTAINER => ConfigurationManager.AppSettings[nameof(TANGO_VERSIONS_CONTAINER)].ToString();
public static String MACHINE_STUDIO_VERSIONS_CONTAINER => ConfigurationManager.AppSettings[nameof(MACHINE_STUDIO_VERSIONS_CONTAINER)].ToString();
public static bool ENFORCE_MACHINE_STUDIO_VERSION => bool.Parse(ConfigurationManager.AppSettings[nameof(ENFORCE_MACHINE_STUDIO_VERSION)].ToString());
+ public static String JWT_TOKEN_SECRET => ConfigurationManager.AppSettings[nameof(JWT_TOKEN_SECRET)].ToString();
}
} \ No newline at end of file
diff --git a/Software/Visual_Studio/Web/Tango.MachineService/Tango.MachineService.csproj b/Software/Visual_Studio/Web/Tango.MachineService/Tango.MachineService.csproj
index 038849c72..6dbbe49ab 100644
--- a/Software/Visual_Studio/Web/Tango.MachineService/Tango.MachineService.csproj
+++ b/Software/Visual_Studio/Web/Tango.MachineService/Tango.MachineService.csproj
@@ -56,6 +56,9 @@
<Reference Include="Google.Protobuf, Version=3.4.1.0, Culture=neutral, PublicKeyToken=a7d26565bac4d604, processorArchitecture=MSIL">
<HintPath>..\..\packages\Google.Protobuf.3.4.1\lib\net45\Google.Protobuf.dll</HintPath>
</Reference>
+ <Reference Include="JWT, Version=5.0.0.0, Culture=neutral, processorArchitecture=MSIL">
+ <HintPath>..\..\packages\JWT.5.0.0\lib\net46\JWT.dll</HintPath>
+ </Reference>
<Reference Include="Microsoft.Azure.Common, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" />
<Reference Include="Microsoft.Azure.Common.NetFramework, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL" />
<Reference Include="Microsoft.Azure.Management.Sql, Version=0.9.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL" />
@@ -161,8 +164,8 @@
<HintPath>..\..\packages\Microsoft.SqlServer.SqlManagementObjects.140.17283.0\lib\net40\Microsoft.SqlServer.WmiEnum.dll</HintPath>
</Reference>
<Reference Include="Microsoft.WindowsAzure.Storage, Version=4.3.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL" />
- <Reference Include="Newtonsoft.Json, Version=8.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
- <HintPath>..\..\packages\Newtonsoft.Json.8.0.3\lib\net45\Newtonsoft.Json.dll</HintPath>
+ <Reference Include="Newtonsoft.Json, Version=9.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
+ <HintPath>..\..\packages\Newtonsoft.Json.9.0.1\lib\net45\Newtonsoft.Json.dll</HintPath>
</Reference>
<Reference Include="System" />
<Reference Include="System.Data" />
@@ -275,8 +278,7 @@
</Compile>
<Compile Include="App_Start\BundleConfig.cs" />
<Compile Include="App_Start\FilterConfig.cs" />
- <Compile Include="Filters\MachineStudioLoginFilter.cs" />
- <Compile Include="Filters\PPCLoginFilter.cs" />
+ <Compile Include="Filters\JwtTokenFilter.cs" />
<Compile Include="MachineServiceConfig.cs" />
<Compile Include="Controllers\MachineStudioController.cs" />
<Compile Include="Models\MachineStudioPendingUpload.cs" />
@@ -379,7 +381,7 @@
<SaveServerSettingsInUserFile>False</SaveServerSettingsInUserFile>
</WebProjectProperties>
</FlavorProperties>
- <UserProperties BuildVersion_AssemblyInfoFilename="Properties\AssemblyInfo.cs" BuildVersion_UpdateAssemblyVersion="True" BuildVersion_BuildVersioningStyle="None.None.Increment.TimeStamp" BuildVersion_UseGlobalSettings="False" BuildVersion_StartDate="2000/1/1" />
+ <UserProperties BuildVersion_StartDate="2000/1/1" BuildVersion_UseGlobalSettings="False" BuildVersion_BuildVersioningStyle="None.None.Increment.TimeStamp" BuildVersion_UpdateAssemblyVersion="True" BuildVersion_AssemblyInfoFilename="Properties\AssemblyInfo.cs" />
</VisualStudio>
</ProjectExtensions>
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
diff --git a/Software/Visual_Studio/Web/Tango.MachineService/Web.config b/Software/Visual_Studio/Web/Tango.MachineService/Web.config
index 72c56b38f..fb10e615e 100644
--- a/Software/Visual_Studio/Web/Tango.MachineService/Web.config
+++ b/Software/Visual_Studio/Web/Tango.MachineService/Web.config
@@ -16,16 +16,17 @@
<add key="DB_ADDRESS" value="twine.database.windows.net" />
<add key="DB_USER_NAME" value="Roy" />
<add key="DB_PASSWORD" value="Aa123456" />
- <add key="DB_CATALOG" value="Tango" />
+ <add key="DB_CATALOG" value="Tango_DEV" />
<add key="STORAGE_ACCOUNT" value="DefaultEndpointsProtocol=https;AccountName=tangostorage;AccountKey=S4z/D+Yg6mwMis+bs/VpcDLA9yE1iZaYq23shQlRIi2KmM9E7JY8zdZjeAPOPdG3gONHoNDEpsgH6D4cqQ/bsA==;EndpointSuffix=core.windows.net" />
<add key="TENANT_ID" value="2ebd63a5-bc2f-41dc-9066-4409ed5e5dd4" />
<add key="CLIENT_ID" value="ec612854-7abc-457b-808a-5d0c5ba80c57" />
<add key="APP_SECRET" value="54)019A7wv+#86l*PQcQWYKu%fd4Dv!@G=VhCiDI5rD+H4BTH" />
- <add key="TANGO_VERSIONS_CONTAINER" value="tango-versions" />
- <add key="MACHINE_STUDIO_VERSIONS_CONTAINER" value="machine-studio-versions" />
+ <add key="TANGO_VERSIONS_CONTAINER" value="tango-versions-dev" />
+ <add key="MACHINE_STUDIO_VERSIONS_CONTAINER" value="machine-studio-versions-dev" />
<add key="DEPLOYMENT_SLOT" value="DEV" />
<add key="ENVIRONMENT_GROUP" value="Tango DEV" />
<add key="ENFORCE_MACHINE_STUDIO_VERSION" value="true" />
+ <add key="JWT_TOKEN_SECRET" value="GQDstcKsx0NHjPOuXOYg5MbeJ1XT0uFiwDVvVBrk" />
</appSettings>
<!--
For a description of web.config changes see http://go.microsoft.com/fwlink/?LinkId=235367.
@@ -59,7 +60,7 @@
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<assemblyIdentity name="Newtonsoft.Json" culture="neutral" publicKeyToken="30ad4fe6b2a6aeed" />
- <bindingRedirect oldVersion="0.0.0.0-8.0.0.0" newVersion="8.0.0.0" />
+ <bindingRedirect oldVersion="0.0.0.0-9.0.0.0" newVersion="9.0.0.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Web.Optimization" publicKeyToken="31bf3856ad364e35" />
diff --git a/Software/Visual_Studio/Web/Tango.MachineService/packages.config b/Software/Visual_Studio/Web/Tango.MachineService/packages.config
index e9f37dbe5..7bc1a3288 100644
--- a/Software/Visual_Studio/Web/Tango.MachineService/packages.config
+++ b/Software/Visual_Studio/Web/Tango.MachineService/packages.config
@@ -3,6 +3,7 @@
<package id="Antlr" version="3.4.1.9004" targetFramework="net45" />
<package id="EntityFramework" version="6.2.0" targetFramework="net461" />
<package id="Google.Protobuf" version="3.4.1" targetFramework="net46" />
+ <package id="JWT" version="5.0.0" targetFramework="net461" />
<package id="Microsoft.ApplicationInsights" version="2.2.0" targetFramework="net45" requireReinstallation="true" />
<package id="Microsoft.ApplicationInsights.Agent.Intercept" version="2.0.6" targetFramework="net45" />
<package id="Microsoft.ApplicationInsights.DependencyCollector" version="2.2.0" targetFramework="net45" />
@@ -25,7 +26,7 @@
<package id="Microsoft.SqlServer.SqlManagementObjects" version="140.17283.0" targetFramework="net461" />
<package id="Microsoft.Web.Infrastructure" version="1.0.0.0" targetFramework="net45" />
<package id="Modernizr" version="2.6.2" targetFramework="net45" />
- <package id="Newtonsoft.Json" version="8.0.3" targetFramework="net46" />
+ <package id="Newtonsoft.Json" version="9.0.1" targetFramework="net461" />
<package id="Respond" version="1.2.0" targetFramework="net45" />
<package id="System.Data.SQLite" version="1.0.108.0" targetFramework="net46" />
<package id="System.Data.SQLite.Core" version="1.0.108.0" targetFramework="net46" />