-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Fixed an issue when user tries to download a file with an ASCII character in the file name (in Download User Contents), Dropbox will not let you download the file. Files will all download now. - Reenabled Team Folder tab - Fixed Team Folder list change (product group changed list response from entries to team_folders) - Fixed Team Folder create change where default sync setting removed. - Added Team Folder sync setting to new button..lets you update sync setting if the account is allowed for managed syncs - Added all 9 Provisioning responses from the API when adding a user (etc. already on another team). - Rebuilt Provisioning listview in UI where a new column called ProvisionStatus now shows the response back from API on provisioning users. - Full encryption and decryption of user tokens in config file. Seemless to user. - Fixed issue where KeepAccount was getting set to true on default.
- Loading branch information
1 parent
5528230
commit f13f4c2
Showing
32 changed files
with
545 additions
and
247 deletions.
There are no files selected for viewing
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
42 changes: 42 additions & 0 deletions
42
Source/DfBAdminToolkit.Common/Extensions/StringExtension.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
using System; | ||
using System.Text; | ||
using System.Security.Cryptography; | ||
|
||
namespace DfBAdminToolkit.Common.Extensions | ||
{ | ||
public static class StringExtension | ||
{ | ||
public static string Encrypt( | ||
this string clearText, | ||
string optionalEntropy = null, | ||
DataProtectionScope scope = DataProtectionScope.LocalMachine) | ||
{ | ||
if (clearText == null) | ||
throw new ArgumentNullException("Clear text is null"); | ||
byte[] clearBytes = Encoding.UTF8.GetBytes(clearText); | ||
byte[] entropyBytes = string.IsNullOrEmpty(optionalEntropy) | ||
? null | ||
: Encoding.UTF8.GetBytes(optionalEntropy); | ||
byte[] encryptedBytes = ProtectedData.Protect(clearBytes, entropyBytes, scope); | ||
string encryptedString = "encrypted-" + Convert.ToBase64String(encryptedBytes); | ||
return encryptedString; | ||
} | ||
|
||
public static string Decrypt( | ||
this string encryptedText, | ||
string optionalEntropy = null, | ||
DataProtectionScope scope = DataProtectionScope.LocalMachine) | ||
{ | ||
if (encryptedText == null) | ||
throw new ArgumentNullException("Encrypted text is null"); | ||
//remove encrypted- tag from beginning | ||
encryptedText = encryptedText.Remove(0, 10); | ||
byte[] encryptedBytes = Convert.FromBase64String(encryptedText); | ||
byte[] entropyBytes = string.IsNullOrEmpty(optionalEntropy) | ||
? null | ||
: Encoding.UTF8.GetBytes(optionalEntropy); | ||
byte[] clearBytes = ProtectedData.Unprotect(encryptedBytes, entropyBytes, scope); | ||
return Encoding.UTF8.GetString(clearBytes); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.