Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bump Azure.Identity from 1.8.2 to 1.10.2 in /src/ElCamino.Identity.AzureTable.DataUtility #1

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Azure.Data.Tables" Version="12.6.1" />
<PackageReference Include="Azure.Data.Tables" Version="12.7.0" />
<PackageReference Include="Microsoft.Extensions.Identity.Stores" Version="2.2.0" />
</ItemGroup>
<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,19 +1,25 @@
// MIT License Copyright 2020 (c) David Melendez. All rights reserved. See License.txt in the project root for license information.


using System;
using Azure.Core;

namespace ElCamino.AspNetCore.Identity.AzureTable.Model
{
public class IdentityConfiguration
{
public string TablePrefix { get; set; }

public string StorageConnectionString { get; set; }

public string IndexTableName { get; set; }

public string UserTableName { get; set; }

public string RoleTableName { get; set; }

public Uri StorageConnectionUri { get; set; }
public TokenCredential TokenCredential { get; set; }

}
}
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Azure.Data.Tables" Version="12.6.1" />
<PackageReference Include="Azure.Data.Tables" Version="12.7.0" />
<PackageReference Include="Microsoft.CSharp" Version="4.7.0" />
<PackageReference Include="Microsoft.AspNetCore.Identity" Version="2.2.0" />
</ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,32 @@ public IdentityCloudContext(IdentityConfiguration config)
protected virtual void Initialize(IdentityConfiguration config)
{
_config = config;
_client = new TableServiceClient(_config.StorageConnectionString);

if (string.IsNullOrEmpty(_config.StorageConnectionString) && _config.StorageConnectionUri == null)
{
throw new ArgumentNullException(nameof(config.StorageConnectionString), "Either StorageConnectionString or StorageConnectionUri are required");
}
else if (!string.IsNullOrEmpty(_config.StorageConnectionString))
{
_client = new TableServiceClient(_config.StorageConnectionString);

if (_config.TokenCredential != null)
{
//If we've been passed a TokenCredential we can use that instead of the credentials in the connection string
_client = new TableServiceClient(_client.Uri, _config.TokenCredential);
}
}
else if (_config.StorageConnectionUri != null)
{
if (config.TokenCredential == null)
{
throw new ArgumentNullException(nameof(config.TokenCredential), "TokenCredential is required when Uri is specified");
}
else
{
_client = new TableServiceClient(_client.Uri, config.TokenCredential);
}
}

_indexTable = _client.GetTableClient(FormatTableNameWithPrefix(!string.IsNullOrWhiteSpace(_config.IndexTableName) ? _config.IndexTableName : TableConstants.TableNames.IndexTable));
_roleTable = _client.GetTableClient(FormatTableNameWithPrefix(!string.IsNullOrWhiteSpace(_config.RoleTableName) ? _config.RoleTableName : TableConstants.TableNames.RolesTable));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="Azure.Data.Tables" Version="12.6.1" />
<PackageReference Include="Azure.Data.Tables" Version="12.7.0" />
</ItemGroup>

<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<Project Sdk="Microsoft.NET.Sdk.Web">
<Project Sdk="Microsoft.NET.Sdk.Web">

<PropertyGroup>
<TargetFramework>net7.0</TargetFramework>
Expand Down Expand Up @@ -41,7 +41,8 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="Azure.Data.Tables" Version="12.6.1" />
<PackageReference Include="Azure.Data.Tables" Version="12.7.0" />
<PackageReference Include="Azure.Identity" Version="1.10.2" />
<PackageReference Include="Microsoft.AspNetCore.Identity" Version="2.2.0" />
<PackageReference Include="Microsoft.Extensions.Identity.Core" Version="7.0.0" />
<PackageReference Include="Microsoft.Extensions.Identity.Stores" Version="7.0.0" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="Azure.Data.Tables" Version="12.6.1" />
<PackageReference Include="Azure.Data.Tables" Version="12.7.0" />
<PackageReference Include="Microsoft.CodeCoverage" Version="17.4.0" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.4.0" />
<PackageReference Include="Newtonsoft.Json" Version="13.0.1" />
Expand Down