Skip to content
This repository has been archived by the owner on Nov 1, 2023. It is now read-only.

Commit

Permalink
bump dependencies to latest (#1782)
Browse files Browse the repository at this point in the history
remove/implement "cached todo" from some methods,

Co-authored-by: stas <statis@microsoft.com>
  • Loading branch information
2 people authored and AdamL-Microsoft committed Apr 18, 2022
1 parent ba72bbd commit d9fbf9a
Show file tree
Hide file tree
Showing 5 changed files with 86 additions and 89 deletions.
24 changes: 12 additions & 12 deletions src/ApiService/ApiService/ApiService.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -15,19 +15,19 @@
<PackageReference Include="Microsoft.Azure.Functions.Worker.Sdk" Version="1.3.0" OutputItemType="Analyzer" />
<PackageReference Include="Microsoft.Azure.Functions.Worker" Version="1.6.0" />
<PackageReference Include="Azure.Data.Tables" Version="12.5.0" />
<PackageReference Include="Azure.ResourceManager.Compute" Version="1.0.0-beta.6" />
<PackageReference Include="Azure.Core" Version="1.23.0" />
<PackageReference Include="Azure.Identity" Version="1.5.0" />
<PackageReference Include="Azure.Messaging.EventGrid" Version="4.9.0" />
<PackageReference Include="Azure.ResourceManager" Version="1.0.0-beta.8" />
<PackageReference Include="Azure.ResourceManager.Network" Version="1.0.0-beta.5" />
<PackageReference Include="Azure.ResourceManager.Resources" Version="1.0.0-beta.6" />
<PackageReference Include="Azure.ResourceManager.Storage" Version="1.0.0-beta.6" />
<PackageReference Include="Azure.ResourceManager.Compute" Version="1.0.0-beta.8" />
<PackageReference Include="Azure.Core" Version="1.24.0" />
<PackageReference Include="Azure.Identity" Version="1.6.0" />
<PackageReference Include="Azure.Messaging.EventGrid" Version="4.10.0" />
<PackageReference Include="Azure.ResourceManager" Version="1.0.0" />
<PackageReference Include="Azure.ResourceManager.Network" Version="1.0.0-beta.7" />
<PackageReference Include="Azure.ResourceManager.Resources" Version="1.0.0" />
<PackageReference Include="Azure.ResourceManager.Storage" Version="1.0.0-beta.8" />
<PackageReference Include="Azure.Storage.Queues" Version="12.9.0" />
<PackageReference Include="Microsoft.Graph" Version="4.20.0" />
<PackageReference Include="Microsoft.Identity.Client" Version="4.42.0" />
<PackageReference Include="Microsoft.Identity.Web.TokenCache" Version="1.23.0" />
<PackageReference Include="System.IdentityModel.Tokens.Jwt" Version="6.16.0" />
<PackageReference Include="Microsoft.Graph" Version="4.24.0" />
<PackageReference Include="Microsoft.Identity.Client" Version="4.43.0" />
<PackageReference Include="Microsoft.Identity.Web.TokenCache" Version="1.23.1" />
<PackageReference Include="System.IdentityModel.Tokens.Jwt" Version="6.17.0" />
<PackageReference Include="System.Linq.Async" Version="6.0.1" />
<PackageReference Include="Microsoft.Azure.Functions.Worker.Extensions.SignalRService" Version="1.7.0" />
</ItemGroup>
Expand Down
2 changes: 0 additions & 2 deletions src/ApiService/ApiService/onefuzzlib/Creds.cs
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ public DefaultAzureCredential GetIdentity()
return new DefaultAzureCredential();
}

// TODO: @cached
public string GetSubcription()
{
var storageResourceId = EnvironmentVariables.OneFuzz.DataStorage
Expand All @@ -34,7 +33,6 @@ public string GetSubcription()
return storageResource.SubscriptionId!;
}

// TODO: @cached
public string GetBaseResourceGroup()
{
var storageResourceId = EnvironmentVariables.OneFuzz.DataStorage
Expand Down
11 changes: 5 additions & 6 deletions src/ApiService/ApiService/onefuzzlib/Storage.cs
Original file line number Diff line number Diff line change
Expand Up @@ -26,30 +26,29 @@ public interface IStorage
public class Storage : IStorage
{
private ICreds _creds;
private ArmClient _armClient;

public Storage(ICreds creds)
{
_creds = creds;
_armClient = new ArmClient(credential: _creds.GetIdentity(), defaultSubscriptionId: _creds.GetSubcription());
}

// TODO: @cached
public static string GetFuncStorage()
{
return EnvironmentVariables.OneFuzz.FuncStorage
?? throw new Exception("Func storage env var is missing");
}

// TODO: @cached
public static string GetFuzzStorage()
{
return EnvironmentVariables.OneFuzz.DataStorage
?? throw new Exception("Fuzz storage env var is missing");
}

// TODO: @cached
public ArmClient GetMgmtClient()
{
return new ArmClient(credential: _creds.GetIdentity(), defaultSubscriptionId: _creds.GetSubcription());
return _armClient;
}

// TODO: @cached
Expand All @@ -63,7 +62,7 @@ public IEnumerable<string> CorpusAccounts(ILogTracer log)

const string storageTypeTagKey = "storage_type";

var resourceGroup = client.GetResourceGroup(group);
var resourceGroup = client.GetResourceGroupResource(group);
foreach (var account in resourceGroup.GetStorageAccounts())
{
if (account.Id == skip)
Expand Down Expand Up @@ -109,7 +108,7 @@ public string GetPrimaryAccount(StorageType storageType)
{
var resourceId = new ResourceIdentifier(accountId);
var armClient = GetMgmtClient();
var storageAccount = armClient.GetStorageAccount(resourceId);
var storageAccount = armClient.GetStorageAccountResource(resourceId);
var key = storageAccount.GetKeys().Value.Keys.FirstOrDefault();
return (resourceId.Name, key?.Value);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ public async Task<TableClient> GetTableClient(string table)
public (string?, string?) GetStorageAccountNameAndKey(string accountId)
{
var resourceId = new ResourceIdentifier(accountId);
var storageAccount = _armClient.GetStorageAccount(resourceId);
var storageAccount = _armClient.GetStorageAccountResource(resourceId);
var key = storageAccount.GetKeys().Value.Keys.FirstOrDefault();
return (resourceId.Name, key?.Value);
}
Expand Down
136 changes: 68 additions & 68 deletions src/ApiService/ApiService/packages.lock.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@
"net6.0": {
"Azure.Core": {
"type": "Direct",
"requested": "[1.23.0, )",
"resolved": "1.23.0",
"contentHash": "myulcGStD89NN7BUhAjkcfDhIvRj2UUwZHEgjB50pL3vb0LEunrtinxKqUGUuOheQVCHlILKLNoUeCThQ1iCOg==",
"requested": "[1.24.0, )",
"resolved": "1.24.0",
"contentHash": "+/qI1j2oU1S4/nvxb2k/wDsol00iGf1AyJX5g3epV7eOpQEP/2xcgh/cxgKMeFgn3U2fmgSiBnQZdkV+l5y0Uw==",
"dependencies": {
"Microsoft.Bcl.AsyncInterfaces": "1.1.1",
"System.Diagnostics.DiagnosticSource": "4.6.0",
Expand All @@ -29,81 +29,81 @@
},
"Azure.Identity": {
"type": "Direct",
"requested": "[1.5.0, )",
"resolved": "1.5.0",
"contentHash": "VfF88dqrgKXZNOS/y4XrX/jmIfP3pkY+hBUzBNpoKml1nR+QshX6XlXWyToLtWV80TDQ1CmUVCJksktDg5+j1w==",
"requested": "[1.6.0, )",
"resolved": "1.6.0",
"contentHash": "EycyMsb6rD2PK9P0SyibFfEhvWWttdrYhyPF4f41uzdB/44yQlV+2Wehxyg489Rj6gbPvSPgbKq0xsHJBhipZA==",
"dependencies": {
"Azure.Core": "1.20.0",
"Microsoft.Identity.Client": "4.30.1",
"Microsoft.Identity.Client.Extensions.Msal": "2.18.4",
"Azure.Core": "1.24.0",
"Microsoft.Identity.Client": "4.39.0",
"Microsoft.Identity.Client.Extensions.Msal": "2.19.3",
"System.Memory": "4.5.4",
"System.Security.Cryptography.ProtectedData": "4.5.0",
"System.Text.Json": "4.6.0",
"System.Security.Cryptography.ProtectedData": "4.7.0",
"System.Text.Json": "4.7.2",
"System.Threading.Tasks.Extensions": "4.5.4"
}
},
"Azure.Messaging.EventGrid": {
"type": "Direct",
"requested": "[4.9.0, )",
"resolved": "4.9.0",
"contentHash": "ooM1/ueb5pVIf+/BmS/SQKGW0LuP2Rn1Zc+RasCF0aMkJ5/kbc4ZXVrUd2YQlDaoeUOTJGSLs/VoGv0W1GiS5g==",
"requested": "[4.10.0, )",
"resolved": "4.10.0",
"contentHash": "X3dh3Cek/7wFPUrBJ2KbnkJteGjWvKBoSBmD/uQm8reMIavCFTKhnl95F937eLn/2cSsm5l3oPHtYPFtDerA7Q==",
"dependencies": {
"Azure.Core": "1.22.0",
"Azure.Core": "1.24.0",
"System.Memory.Data": "1.0.2",
"System.Text.Json": "4.7.2"
}
},
"Azure.ResourceManager": {
"type": "Direct",
"requested": "[1.0.0-beta.8, )",
"resolved": "1.0.0-beta.8",
"contentHash": "L8fYEV5kjP+BY1d9J7/hzQ/IHr1capJn9gkhzAEY4BPvMFTE9Aqsbb3p06r+iItcLP0y87eacQodfyPczADXVg==",
"requested": "[1.0.0, )",
"resolved": "1.0.0",
"contentHash": "UGaoiPcJ8a9Et030+F3zc2KhTssPAgPm7uXm4E9kyNI4jYYenUe6zj2J1bTimaTfcOZnn5scSjSYxKtZCzftcA==",
"dependencies": {
"Azure.Core": "1.22.0",
"Azure.Core": "1.24.0",
"System.Text.Json": "4.7.2"
}
},
"Azure.ResourceManager.Compute": {
"type": "Direct",
"requested": "[1.0.0-beta.6, )",
"resolved": "1.0.0-beta.6",
"contentHash": "equl7PjMwhmFFj3qewcK+2kqbEQUM64elLan6jPIxRbHQkQ/QOm/mHRWuTerW0BdUvj48e+odB6gJc4wW0aZbQ==",
"requested": "[1.0.0-beta.8, )",
"resolved": "1.0.0-beta.8",
"contentHash": "rYYjjmEdmcOa8O4UgO/bdJ/qQclNZjuHdalxRJ0AhUHCORcM1f1BbIKR9CoN83IpfuEE+X+n5XY9QZcKvfrGVA==",
"dependencies": {
"Azure.Core": "1.22.0",
"Azure.ResourceManager": "1.0.0-beta.8",
"Azure.Core": "1.24.0",
"Azure.ResourceManager": "1.0.0",
"System.Text.Json": "4.7.2"
}
},
"Azure.ResourceManager.Network": {
"type": "Direct",
"requested": "[1.0.0-beta.5, )",
"resolved": "1.0.0-beta.5",
"contentHash": "F7p/eZatJ+8hPfHR+98LgNJC+nBH4GBDtluLk+ubgIF84DZ9KMjRSkvyv4d6Y9k8jHh8qYRt4lUUMpdwseSutA==",
"requested": "[1.0.0-beta.7, )",
"resolved": "1.0.0-beta.7",
"contentHash": "Ih8tb6OwxEEEEXATVzgX6oHJzVr9p4X6GfOfBnNAI3aIt9+G8blyQLltaCcJAGJ+dO1sBT/Nalgj/HinO+cBlw==",
"dependencies": {
"Azure.Core": "1.21.0",
"Azure.ResourceManager": "1.0.0-beta.7",
"System.Text.Json": "4.6.0"
"Azure.Core": "1.24.0",
"Azure.ResourceManager": "1.0.0",
"System.Text.Json": "4.7.2"
}
},
"Azure.ResourceManager.Resources": {
"type": "Direct",
"requested": "[1.0.0-beta.6, )",
"resolved": "1.0.0-beta.6",
"contentHash": "tKGuoj5WXte2YZWSfYVertSr8zAjg1pRqoRZkRPfntzSqBrTx7BrspEh6iNZyJngW0L33LOlHcvCvvosz0WJGQ==",
"requested": "[1.0.0, )",
"resolved": "1.0.0",
"contentHash": "oNQRWfh05v9BiY8DMQjV+++kVafR+3ry2FGfMKObovKNfAb4i5J6DQpv0CUIx4jeIZe0fnhxyXRRCe293YtMqw==",
"dependencies": {
"Azure.Core": "1.22.0",
"Azure.ResourceManager": "1.0.0-beta.8",
"Azure.Core": "1.24.0",
"Azure.ResourceManager": "1.0.0",
"System.Text.Json": "4.7.2"
}
},
"Azure.ResourceManager.Storage": {
"type": "Direct",
"requested": "[1.0.0-beta.6, )",
"resolved": "1.0.0-beta.6",
"contentHash": "zsBSj+cfBAgYzWAD7fRbTqyA7cALUeCeE2Tk34og2ZathKUl0Ngriki53u0dMif2LTkfKrO0UiBgyiNaeU/ixw==",
"requested": "[1.0.0-beta.8, )",
"resolved": "1.0.0-beta.8",
"contentHash": "tlVqStqG53lyGxr0dRq2KSkFdeC/+NQImWgsRXD9o5R4qBia4cx7zAGYBlnDeUxh1WldSZF5ZsBi2n5SAwxbxQ==",
"dependencies": {
"Azure.Core": "1.22.0",
"Azure.ResourceManager": "1.0.0-beta.8",
"Azure.Core": "1.24.0",
"Azure.ResourceManager": "1.0.0",
"System.Text.Json": "4.7.2"
}
},
Expand Down Expand Up @@ -200,40 +200,40 @@
},
"Microsoft.Graph": {
"type": "Direct",
"requested": "[4.20.0, )",
"resolved": "4.20.0",
"contentHash": "Pf8hdObmX3qF0AREu9e4dnk7inc3Pfw/sI/6l4RGTWDoORpP3Oyh0JoT/TJ+VIUaDk0W4fCUS0zSKhLpOr2UsQ==",
"requested": "[4.24.0, )",
"resolved": "4.24.0",
"contentHash": "OPyHQ+EzuYjp3XExGB0SvySXY3pxU+bXLl3ADdvje/yOMFvpNOpEu111tmh2aM/RCplaoMQjBA5oa9pUVIH0cg==",
"dependencies": {
"Microsoft.Graph.Core": "2.0.8"
}
},
"Microsoft.Identity.Client": {
"type": "Direct",
"requested": "[4.42.0, )",
"resolved": "4.42.0",
"contentHash": "BQeEI4mKDJaludUZwZXfmAs7y1Lhkbm81KDg4Q3JWY8tXi5S7vFFJ4+xcrZtEEuqtDnyhP+Yx0u+1PeOALuTGA=="
"requested": "[4.43.0, )",
"resolved": "4.43.0",
"contentHash": "uaUMZB3Ywi7IPVvgRZOQotlYhD8sA4wtZESkA0qF9SYAifr1RzJyaGTFtfbAyZ/J5kGUhRklrCJIRpd0MaihKQ=="
},
"Microsoft.Identity.Web.TokenCache": {
"type": "Direct",
"requested": "[1.23.0, )",
"resolved": "1.23.0",
"contentHash": "hk4x8v0fjfjxsYwUtamuYczlZS9zyk+g8tlaPFnEPo7ldFJjf/w912faFPqcDJoC8Va5Ykyw1prdQouORAn9zg==",
"requested": "[1.23.1, )",
"resolved": "1.23.1",
"contentHash": "fU85i6XDUXL/z6B+pTmNZbof0hL9Jkgsi6GWpQEWjL7Ek0GH0A8btxbqzojPCRdGN7EK/vyEVu5Smy9/spZj2g==",
"dependencies": {
"Microsoft.AspNetCore.DataProtection": "5.0.8",
"Microsoft.Extensions.Caching.Memory": "5.0.0",
"Microsoft.Extensions.Logging": "5.0.0",
"Microsoft.Identity.Client": "4.41.0",
"Microsoft.Identity.Client": "4.42.0",
"System.Text.Encodings.Web": "5.0.1"
}
},
"System.IdentityModel.Tokens.Jwt": {
"type": "Direct",
"requested": "[6.16.0, )",
"resolved": "6.16.0",
"contentHash": "QnZUawkmLkzEhwgvlqcm2YNAoRgz27zVY+2LzMBMWMcfFhl2Sv8aavZOeuFMofmYJsST9h7BilOn7MzFSUMihQ==",
"requested": "[6.17.0, )",
"resolved": "6.17.0",
"contentHash": "G3rY4WLr54Mo+97+AEq0ANpiKvW7E8Qu5bKWfVMa7rkyJtvrOxUqp/OLqrGw/6JDbD5GlxnAtFKukGteUuB0rQ==",
"dependencies": {
"Microsoft.IdentityModel.JsonWebTokens": "6.16.0",
"Microsoft.IdentityModel.Tokens": "6.16.0"
"Microsoft.IdentityModel.JsonWebTokens": "6.17.0",
"Microsoft.IdentityModel.Tokens": "6.17.0"
}
},
"System.Linq.Async": {
Expand Down Expand Up @@ -691,25 +691,25 @@
},
"Microsoft.Identity.Client.Extensions.Msal": {
"type": "Transitive",
"resolved": "2.18.4",
"contentHash": "HpG4oLwhQsy0ce7OWq9iDdLtJKOvKRStIKoSEOeBMKuohfuOWNDyhg8fMAJkpG/kFeoe4J329fiMHcJmmB+FPw==",
"resolved": "2.19.3",
"contentHash": "zVVZjn8aW7W79rC1crioDgdOwaFTQorsSO6RgVlDDjc7MvbEGz071wSNrjVhzR0CdQn6Sefx7Abf1o7vasmrLg==",
"dependencies": {
"Microsoft.Identity.Client": "4.30.0",
"Microsoft.Identity.Client": "4.38.0",
"System.Security.Cryptography.ProtectedData": "4.5.0"
}
},
"Microsoft.IdentityModel.JsonWebTokens": {
"type": "Transitive",
"resolved": "6.16.0",
"contentHash": "FJtXVXvjoza64VPFOPBxqnhe0yyQ5B/7A09+RpTXIzowr5+A4xcX42patsLrNGmFUvXZAHhS2u/6ojTzhYatpg==",
"resolved": "6.17.0",
"contentHash": "I3cSVE185qF3a222/iQIdmBFhrhZBtz7wZ1RUUbMuHC1un79XCI7vggbWdmbqIttFcUoeziemadO6t+3FLjcSA==",
"dependencies": {
"Microsoft.IdentityModel.Tokens": "6.16.0"
"Microsoft.IdentityModel.Tokens": "6.17.0"
}
},
"Microsoft.IdentityModel.Logging": {
"type": "Transitive",
"resolved": "6.16.0",
"contentHash": "Fuo5SpYUpFRw90hBM3PDA1uQsrHmbIaxvwkldJcfi0O51gz/qjSFMe8136NFRoKA3NxZZScpz/47oFkRU2WA/A=="
"resolved": "6.17.0",
"contentHash": "Ix6/CMLDoo939NDf1ARDuGK6YERY7pAX9WYbfwb4gZqx7r52unMFIykJk+zlEBX7jjtbDz/0uzikQFvheV9KsQ=="
},
"Microsoft.IdentityModel.Protocols": {
"type": "Transitive",
Expand All @@ -731,11 +731,11 @@
},
"Microsoft.IdentityModel.Tokens": {
"type": "Transitive",
"resolved": "6.16.0",
"contentHash": "dL7r4bdRbDG0RmyYGw9cpO/pA3GVaxV+lI1ConYuQuRiAxd1ONFlxHue1o8wR8+lEB972cekzfj45WSNaq3+xA==",
"resolved": "6.17.0",
"contentHash": "mhOe+d9BQg5U45TkTCyXAFOjl7RvwaFj6v9qo8b+WFolkuGsfjSFfQ+WI9D3ho9sD/fK75gvL4JptmjLzyUPkw==",
"dependencies": {
"Microsoft.CSharp": "4.5.0",
"Microsoft.IdentityModel.Logging": "6.16.0",
"Microsoft.IdentityModel.Logging": "6.17.0",
"System.Security.Cryptography.Cng": "4.5.0"
}
},
Expand Down Expand Up @@ -950,8 +950,8 @@
},
"System.Security.Cryptography.ProtectedData": {
"type": "Transitive",
"resolved": "4.5.0",
"contentHash": "wLBKzFnDCxP12VL9ANydSYhk59fC4cvOr9ypYQLPnAj48NQIhqnjdD2yhP8yEKyBJEjERWS9DisKL7rX5eU25Q=="
"resolved": "4.7.0",
"contentHash": "ehYW0m9ptxpGWvE4zgqongBVWpSDU/JCFD4K7krxkQwSz/sFQjEXCUqpvencjy6DYDbn7Ig09R8GFffu8TtneQ=="
},
"System.Security.Cryptography.Xml": {
"type": "Transitive",
Expand Down

0 comments on commit d9fbf9a

Please sign in to comment.