Skip to content

Commit

Permalink
Uses unprotected files in Linux
Browse files Browse the repository at this point in the history
  • Loading branch information
msJinLei committed Nov 17, 2022
1 parent 6b227ba commit e550f7f
Showing 1 changed file with 1 addition and 10 deletions.
11 changes: 1 addition & 10 deletions src/Accounts/Authentication/KeyStore/StorageWrapper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,19 +14,13 @@
using Microsoft.Azure.Commands.Common.Authentication.Properties;
using Microsoft.Identity.Client.Extensions.Msal;
using System;
using System.Collections.Generic;
using System.Threading;

namespace Microsoft.Azure.Commands.ResourceManager.Common
{
class StorageWrapper : IStorage
{
//fixme: remove linux tag or set as plaintext
private const string KeyChainServiceName = "Microsoft.Azure.PowerShell";
private const string LinuxKeyRingSchema = "Microsoft.Azure.PowerShell";
private const string LinuxKeyRingCollection = MsalCacheHelper.LinuxKeyRingDefaultCollection;
private static readonly KeyValuePair<string, string> LinuxKeyRingAttr1 = new KeyValuePair<string, string>("MsalClientID", "Microsoft.Azure.PowerShell");
private static readonly KeyValuePair<string, string> LinuxKeyRingAttr2 = new KeyValuePair<string, string>("Microsoft.Azure.PowerShell", "1.0.0.0");

public string FileName { get; set; }
public string Directory { get; set; }
Expand All @@ -53,9 +47,7 @@ public IStorage Create()
{
storageProperties = new StorageCreationPropertiesBuilder(FileName, Directory)
.WithMacKeyChain(KeyChainServiceName + ".other_secrets", FileName)
.WithLinuxKeyring(FileName, "default", "KeyStoreCache"
, LinuxKeyRingAttr1, LinuxKeyRingAttr2);

.WithLinuxUnprotectedFile();
_storage = Storage.Create(storageProperties.Build());
VerifyPersistence();
}
Expand Down Expand Up @@ -142,6 +134,5 @@ public Exception GetLastError()
{
return _lastError;
}

}
}

0 comments on commit e550f7f

Please sign in to comment.