Skip to content

Commit

Permalink
Merge pull request #89 from dlmelendez/rel/6.1
Browse files Browse the repository at this point in the history
Rel/6.1
  • Loading branch information
dlmelendez authored Apr 27, 2022
2 parents c4c9230 + 622b7b3 commit 6002d68
Show file tree
Hide file tree
Showing 48 changed files with 1,920 additions and 1,886 deletions.
137 changes: 137 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,137 @@
# To learn more about .editorconfig see https://aka.ms/editorconfigdocs
###############################
# Core EditorConfig Options #
###############################
# All files
[*]
indent_style = space

# XML project files
[*.{csproj,vbproj,vcxproj,vcxproj.filters,proj,projitems,shproj}]
indent_size = 2

# XML config files
[*.{props,targets,ruleset,config,nuspec,resx,vsixmanifest,vsct}]
indent_size = 2

# Code files
[*.{cs,csx,vb,vbx}]
indent_size = 4
insert_final_newline = true
charset = utf-8-bom
###############################
# .NET Coding Conventions #
###############################
[*.{cs,vb}]
# Organize usings
dotnet_sort_system_directives_first = true
# this. preferences
dotnet_style_qualification_for_field = false:silent
dotnet_style_qualification_for_property = false:silent
dotnet_style_qualification_for_method = false:silent
dotnet_style_qualification_for_event = false:silent
# Language keywords vs BCL types preferences
dotnet_style_predefined_type_for_locals_parameters_members = true:silent
dotnet_style_predefined_type_for_member_access = true:silent
# Parentheses preferences
dotnet_style_parentheses_in_arithmetic_binary_operators = always_for_clarity:silent
dotnet_style_parentheses_in_relational_binary_operators = always_for_clarity:silent
dotnet_style_parentheses_in_other_binary_operators = always_for_clarity:silent
dotnet_style_parentheses_in_other_operators = never_if_unnecessary:silent
# Modifier preferences
dotnet_style_require_accessibility_modifiers = for_non_interface_members:silent
dotnet_style_readonly_field = true:suggestion
# Expression-level preferences
dotnet_style_object_initializer = false:none
dotnet_style_collection_initializer = true:suggestion
dotnet_style_explicit_tuple_names = true:suggestion
dotnet_style_null_propagation = true:suggestion
dotnet_style_coalesce_expression = true:suggestion
dotnet_style_prefer_is_null_check_over_reference_equality_method = true:silent
dotnet_style_prefer_inferred_tuple_names = true:suggestion
dotnet_style_prefer_inferred_anonymous_type_member_names = true:suggestion
dotnet_style_prefer_auto_properties = true:silent
dotnet_style_prefer_conditional_expression_over_assignment = true:silent
dotnet_style_prefer_conditional_expression_over_return = true:silent
###############################
# Naming Conventions #
###############################
# Style Definitions
dotnet_naming_style.pascal_case_style.capitalization = pascal_case
# Use PascalCase for constant fields
dotnet_naming_rule.constant_fields_should_be_pascal_case.severity = suggestion
dotnet_naming_rule.constant_fields_should_be_pascal_case.symbols = constant_fields
dotnet_naming_rule.constant_fields_should_be_pascal_case.style = pascal_case_style
dotnet_naming_symbols.constant_fields.applicable_kinds = field
dotnet_naming_symbols.constant_fields.applicable_accessibilities = *
dotnet_naming_symbols.constant_fields.required_modifiers = const
###############################
# C# Coding Conventions #
###############################
[*.cs]
# var preferences
csharp_style_var_for_built_in_types = true:none
csharp_style_var_when_type_is_apparent = true:none
csharp_style_var_elsewhere = true:none
# Expression-bodied members
csharp_style_expression_bodied_methods = false:silent
csharp_style_expression_bodied_constructors = false:silent
csharp_style_expression_bodied_operators = false:silent
csharp_style_expression_bodied_properties = true:silent
csharp_style_expression_bodied_indexers = true:silent
csharp_style_expression_bodied_accessors = true:silent
# Pattern matching preferences
csharp_style_pattern_matching_over_is_with_cast_check = true:suggestion
csharp_style_pattern_matching_over_as_with_null_check = true:suggestion
csharp_style_prefer_range_operator = false:silent
# Null-checking preferences
csharp_style_throw_expression = true:suggestion
csharp_style_conditional_delegate_call = true:suggestion
# Modifier preferences
csharp_preferred_modifier_order = public,private,protected,internal,static,extern,new,virtual,abstract,sealed,override,readonly,unsafe,volatile,async:suggestion
# Expression-level preferences
csharp_prefer_braces = true:silent
csharp_style_deconstructed_variable_declaration = false:silent
csharp_prefer_simple_default_expression = true:suggestion
csharp_style_pattern_local_over_anonymous_function = true:suggestion
csharp_style_inlined_variable_declaration = true:suggestion
###############################
# C# Formatting Rules #
###############################
# New line preferences
csharp_new_line_before_open_brace = all
csharp_new_line_before_else = true
csharp_new_line_before_catch = true
csharp_new_line_before_finally = true
csharp_new_line_before_members_in_object_initializers = true
csharp_new_line_before_members_in_anonymous_types = true
csharp_new_line_between_query_expression_clauses = true
# Indentation preferences
csharp_indent_case_contents = true
csharp_indent_switch_labels = true
csharp_indent_labels = flush_left
# Space preferences
csharp_space_after_cast = false
csharp_space_after_keywords_in_control_flow_statements = true
csharp_space_between_method_call_parameter_list_parentheses = false
csharp_space_between_method_declaration_parameter_list_parentheses = false
csharp_space_between_parentheses = false
csharp_space_before_colon_in_inheritance_clause = true
csharp_space_after_colon_in_inheritance_clause = true
csharp_space_around_binary_operators = before_and_after
csharp_space_between_method_declaration_empty_parameter_list_parentheses = false
csharp_space_between_method_call_name_and_opening_parenthesis = false
csharp_space_between_method_call_empty_parameter_list_parentheses = false
# Wrapping preferences
csharp_preserve_single_line_statements = true
csharp_preserve_single_line_blocks = true
###############################
# VB Coding Conventions #
###############################

# IDE0007: Use implicit type
dotnet_diagnostic.IDE0007.severity = none

[*.vb]
# Modifier preferences
visual_basic_preferred_modifier_order = Partial,Default,Private,Protected,Public,Friend,NotOverridable,Overridable,MustOverride,Overloads,Overrides,MustInherit,NotInheritable,Static,Shared,Shadows,ReadOnly,WriteOnly,Dim,Const,WithEvents,Widening,Narrowing,Custom,Async:suggestion
15 changes: 12 additions & 3 deletions ElCamino.AspNetCore.Identity.AzureTable.sln
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 16
VisualStudioVersion = 16.0.29326.143
# Visual Studio Version 17
VisualStudioVersion = 17.0.32112.339
MinimumVisualStudioVersion = 10.0.40219.1
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ElCamino.AspNetCore.Identity.AzureTable", "src\ElCamino.AspNetCore.Identity.AzureTable\ElCamino.AspNetCore.Identity.AzureTable.csproj", "{5FBD2375-18B4-426A-A875-7D99521A4DD0}"
EndProject
Expand All @@ -10,6 +10,7 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ElCamino.Identity.AzureTabl
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{EF35BCF8-88F2-4DDD-AD83-B2A095393CE4}"
ProjectSection(SolutionItems) = preProject
.editorconfig = .editorconfig
LICENSE = LICENSE
ModelClasses.dgml = ModelClasses.dgml
README.md = README.md
Expand All @@ -18,7 +19,9 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ElCamino.AspNetCore.Identity.AzureTable.Templates", "templates\ElCamino.AspNetCore.Identity.AzureTable.Templates.csproj", "{F8EBDAC0-0F00-4EED-99B4-6F7FF234CCBB}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ElCamino.AspNetCore.Identity.AzureTable.Model", "src\ElCamino.AspNetCore.Identity.AzureTable.Model\ElCamino.AspNetCore.Identity.AzureTable.Model.csproj", "{C90FB0E3-5BE2-41E7-9DA3-9083C7700F91}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ElCamino.AspNetCore.Identity.AzureTable.Model", "src\ElCamino.AspNetCore.Identity.AzureTable.Model\ElCamino.AspNetCore.Identity.AzureTable.Model.csproj", "{C90FB0E3-5BE2-41E7-9DA3-9083C7700F91}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ElCamino.Azure.Data.Tables", "src\ElCamino.Azure.Data.Tables\ElCamino.Azure.Data.Tables.csproj", "{DAF57676-8534-4A62-BC7B-317753F2A275}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Expand Down Expand Up @@ -57,6 +60,12 @@ Global
{C90FB0E3-5BE2-41E7-9DA3-9083C7700F91}.Release|Any CPU.Build.0 = Release|Any CPU
{C90FB0E3-5BE2-41E7-9DA3-9083C7700F91}.Signed|Any CPU.ActiveCfg = Debug|Any CPU
{C90FB0E3-5BE2-41E7-9DA3-9083C7700F91}.Signed|Any CPU.Build.0 = Debug|Any CPU
{DAF57676-8534-4A62-BC7B-317753F2A275}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{DAF57676-8534-4A62-BC7B-317753F2A275}.Debug|Any CPU.Build.0 = Debug|Any CPU
{DAF57676-8534-4A62-BC7B-317753F2A275}.Release|Any CPU.ActiveCfg = Release|Any CPU
{DAF57676-8534-4A62-BC7B-317753F2A275}.Release|Any CPU.Build.0 = Release|Any CPU
{DAF57676-8534-4A62-BC7B-317753F2A275}.Signed|Any CPU.ActiveCfg = Debug|Any CPU
{DAF57676-8534-4A62-BC7B-317753F2A275}.Signed|Any CPU.Build.0 = Debug|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

<PropertyGroup>
<Description>Azure Table Storage Provider to support ASPNET Core Identity Models</Description>
<Copyright>Copyright © 2021 David Melendez, MIT License</Copyright>
<Copyright>Copyright © 2022 David Melendez, MIT License</Copyright>
<AssemblyTitle>Azure Table Storage Provider for ASP.NET Identity Core Models</AssemblyTitle>
<Authors>David Melendez</Authors>
<TargetFrameworks>netstandard2.0;net6.0</TargetFrameworks>
Expand All @@ -22,7 +22,7 @@
<RepositoryType>git</RepositoryType>
<RepositoryUrl>https://github.com/dlmelendez/identityazuretable.git</RepositoryUrl>
<GeneratePackageOnBuild>True</GeneratePackageOnBuild>
<Version>6.0</Version>
<Version>6.1</Version>
<PackageProjectUrl>https://dlmelendez.github.io/identityazuretable</PackageProjectUrl>
<!--<DebugType>Full</DebugType>-->
<!-- DebugType Full is needed for test code coverage, but .nuget symbols doesn't like it-->
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ namespace ElCamino.AspNetCore.Identity.AzureTable.Model
{
public interface IKeyHelper
{
#region Identity User
string PreFixIdentityUserClaim { get; }
string PreFixIdentityUserClaimUpperBound { get; }
string PreFixIdentityUserRole { get; }
Expand All @@ -27,17 +26,12 @@ public interface IKeyHelper
string FormatterIdentityUserId { get; }
string FormatterIdentityUserName { get; }

#endregion

#region Identity Role
string PreFixIdentityRole { get; }
string PreFixIdentityRoleUpperBound { get; }
string PreFixIdentityRoleClaim { get; }
string FormatterIdentityRole { get; }
string FormatterIdentityRoleClaim { get; }

#endregion

string GeneratePartitionKeyIndexByLogin(string plainLoginProvider, string plainProviderKey);

string GenerateRowKeyUserEmail(string plainEmail);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ public IdentityUser() : base() { }
public IdentityUser(string userName)
: this()
{
this.UserName = userName;
UserName = userName;
}

/// <summary>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@

<PropertyGroup>
<Description>Azure Table Storage Provider to support ASPNET Core Identity</Description>
<Copyright>Copyright © 2021 David Melendez, MIT License</Copyright>
<Copyright>Copyright © 2022 David Melendez, MIT License</Copyright>
<AssemblyTitle>Azure Table Storage Provider for ASP.NET Identity Core</AssemblyTitle>
<Authors>David Melendez</Authors>
<TargetFrameworks>netstandard2.0;net6.0</TargetFrameworks>
<LangVersion>9.0</LangVersion>
<LangVersion>10.0</LangVersion>
<AssemblyName>ElCamino.AspNetCore.Identity.AzureTable</AssemblyName>
<AssemblyOriginatorKeyFile>../../tools/Key.snk</AssemblyOriginatorKeyFile>
<SignAssembly>true</SignAssembly>
Expand All @@ -21,13 +21,15 @@
<RepositoryType>git</RepositoryType>
<RepositoryUrl>https://github.com/dlmelendez/identityazuretable.git</RepositoryUrl>
<GeneratePackageOnBuild>True</GeneratePackageOnBuild>
<Version>6.0</Version>
<Version>6.1</Version>
<PackageProjectUrl>https://dlmelendez.github.io/identityazuretable</PackageProjectUrl>
<!--<DebugType>Full</DebugType>-->
<!-- DebugType Full is needed for test code coverage, but .nuget symbols doesn't like it-->
<PackageLicenseExpression>MIT</PackageLicenseExpression>
<IncludeSymbols>true</IncludeSymbols>
<SymbolPackageFormat>snupkg</SymbolPackageFormat>
<PackageReadmeFile>README.md</PackageReadmeFile>
<NeutralLanguage>en-US</NeutralLanguage>
</PropertyGroup>

<ItemGroup>
Expand All @@ -46,11 +48,16 @@
</ItemGroup>

<ItemGroup>
<None Include="..\..\README.md">
<Pack>True</Pack>
<PackagePath>\</PackagePath>
</None>
<None Include="projectNugetPic.png" Pack="true" PackagePath="\" />
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\ElCamino.AspNetCore.Identity.AzureTable.Model\ElCamino.AspNetCore.Identity.AzureTable.Model.csproj" />
<ProjectReference Include="..\ElCamino.Azure.Data.Tables\ElCamino.Azure.Data.Tables.csproj" />
</ItemGroup>


Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ namespace ElCamino.AspNetCore.Identity.AzureTable.Helpers
{
public abstract class BaseKeyHelper : IKeyHelper
{
#region RowConstants
public virtual string PreFixIdentityUserClaim => TableConstants.RowKeyConstants.PreFixIdentityUserClaim;

public virtual string PreFixIdentityUserClaimUpperBound => TableConstants.RowKeyConstants.PreFixIdentityUserClaimUpperBound;
Expand Down Expand Up @@ -62,8 +61,6 @@ public abstract class BaseKeyHelper : IKeyHelper

public virtual string FormatterIdentityRoleClaim => TableConstants.RowKeyConstants.FormatterIdentityRoleClaim;

#endregion

public virtual string GeneratePartitionKeyIndexByLogin(string plainLoginProvider, string plainProviderKey)
{
string strTemp = string.Format("{0}_{1}", plainLoginProvider?.ToUpper(), plainProviderKey?.ToUpper());
Expand Down Expand Up @@ -114,7 +111,7 @@ public virtual string GenerateRowKeyIdentityRole(string plainRoleName)
public virtual string GeneratePartitionKeyIdentityRole(string plainRoleName)
{
string hash = ConvertKeyToHash(plainRoleName?.ToUpper());
return hash.Substring(0, 1);
return hash.Substring(startIndex: 0, length: 1);
}

public virtual string GenerateRowKeyIdentityUserClaim(string claimType, string claimValue)
Expand Down Expand Up @@ -150,7 +147,7 @@ public virtual string GenerateRowKeyIdentityUserLogin(string loginProvider, stri
return string.Format(FormatterIdentityUserLogin, hash);
}

public double KeyVersion => 6.0;
public double KeyVersion => 6.1;

public abstract string ConvertKeyToHash(string input);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,8 @@ public override string ConvertKeyToHash(string input)
{
if (input != null)
{
using (SHA1 sha = SHA1.Create())
{
return GetHash(sha, input, Encoding.Unicode, 40);
}
using SHA1 sha = SHA1.Create();
return GetHash(sha, input, Encoding.Unicode, 40);
}
return null;
}
Expand Down
Loading

0 comments on commit 6002d68

Please sign in to comment.