diff --git a/README.md b/README.md index 98cfa18..503342a 100644 --- a/README.md +++ b/README.md @@ -8,7 +8,7 @@ keywords: categories: - identity - security -lastmod: 2023-03-30T22:40:05.226Z +lastmod: 2023-06-10T04:11:49.055Z date: 2023-03-30T22:39:06.273Z type: readme license: MIT @@ -18,6 +18,7 @@ project: Dgmjr.Identity --- # Identity + Identity classes Classes for identity and security. Once I get the Decomposer working, I'll be rewriing this to move away from the ASP.NET identity classes. They're too rigid and shoudlv'e been implemented as interfaces anyway. diff --git a/src/Claims/ClaimTypes/ClaimType.cs b/src/Claims/ClaimTypes/ClaimType.cs index 9961667..f5c3269 100644 --- a/src/Claims/ClaimTypes/ClaimType.cs +++ b/src/Claims/ClaimTypes/ClaimType.cs @@ -15,6 +15,8 @@ public virtual bool Equals(ClaimType? other) public override bool Equals(object? other) => Equas(other as ClaimType); + public override bool Equals(object? obj) => Equals(obj as ClaimType); + public override int GetHashCode() => Uri.GetHashCode(); public int CompareTo(ClaimValueType other) diff --git a/src/Claims/ClaimValueTypes/ClaimValueTypes.Namespaces.cs b/src/Claims/ClaimValueTypes/ClaimValueTypes.Namespaces.cs index 09d730e..35d977d 100644 --- a/src/Claims/ClaimValueTypes/ClaimValueTypes.Namespaces.cs +++ b/src/Claims/ClaimValueTypes/ClaimValueTypes.Namespaces.cs @@ -4,6 +4,7 @@ public static partial class ClaimValueTypeUris { public static class Namespaces { + public const string xs = "http://www.w3.org/2001/XMLSchema"; /// TR/ public const string TR = $"{nameof(TR)}/"; /// xmlschema11-2/ diff --git a/src/Claims/ClaimValueTypes/ClaimValueTypes.cs b/src/Claims/ClaimValueTypes/ClaimValueTypes.cs index 88a2aa1..2c484d2 100644 --- a/src/Claims/ClaimValueTypes/ClaimValueTypes.cs +++ b/src/Claims/ClaimValueTypes/ClaimValueTypes.cs @@ -38,87 +38,87 @@ public static partial class ClaimValueTypeUris /// : public const string PhoneNumber = $"{BaseUri}:{NS.PhoneNumber}"; + public const string xs = nameof(xs); + /// A URI that represents the base64Binary XML data type. - /// http://www.w3.org/2001/XMLSchema#base64Binary + /// xs:base64Binary public const string Base64Binary = SysSecCvt.Base64Binary; /// A URI that represents the base64Octet XML data type. - /// http://www.w3.org/2001/XMLSchema#base64Octet - public const string Base64Octet = SysSecCvt.Base64Octet; + /// xs:base64Octet + public const string Base64Octet = SysSecCvt.Base64octet; /// A URI that represents the boolean XML data type. - /// http://www.w3.org/2001/XMLSchema#boolean + /// xs:boolean public const string Boolean = SysSecCvt.Boolean; /// A URI that represents the date XML data type. - /// http://www.w3.org/2001/XMLSchema#date + /// xs:date public const string Date = SysSecCvt.Date; /// A URI that represents the dateTime XML data type. - /// http://www.w3.org/2001/XMLSchema#dateTime - public const string DateTime = SysSecCvt.DateTime; + /// xs:dateTime + public const string DateTime = SysSecCvt.Datetime; /// A URI that represents the daytimeDuration XQuery data type. /// http://www.w3.org/TR/2002/WD-xquery-operators-20020816#dayTimeDuration - public const string DaytimeDuration = SysSecCvt.DaytimeDuration; + public const string DaytimeDuration = SysSecCvt.Daytimeduration; /// A URI that represents the dns SOAP data type. /// http://schemas.xmlsoap.org/claims/dns - public const string DnsName = SysSecCvt.DnsName; + public const string DnsName = SysSecCvt.Dnsname; /// A URI that represents the double XML data type. - /// http://www.w3.org/2001/XMLSchema#double + /// xs:double public const string Double = SysSecCvt.Double; /// A URI that represents the DSAKeyValue XML Signature data type. /// http://www.w3.org/2000/09/xmldsig#DSAKeyValue - public const string DsaKeyValue = SysSecCvt.DsaKeyValue; /// A URI that represents the emailaddress SOAP data type. /// http://schemas.xmlsoap.org/ws/2005/05/identity/claims/emailaddress - public const string Email = SysSecCvt.Email; /// A URI that represents the fqbn XML data type. - /// http://www.w3.org/2001/XMLSchema#fqbn + /// xs:fqbn public const string Fqbn = SysSecCvt.Fqbn; /// A URI that represents the hexBinary XML data type. - /// http://www.w3.org/2001/XMLSchema#hexBinary - public const string HexBinary = SysSecCvt.HexBinary; + /// xs:hexBinary + public const string HexBinary = SysSecCvt.Hexbinary; /// A URI that represents the integer XML data type. - /// http://www.w3.org/2001/XMLSchema#integer + /// xs:integer public const string Integer = SysSecCvt.Integer; /// A URI that represents the integer32 XML data type. - /// http://www.w3.org/2001/XMLSchema#integer32 + /// xs:integer32 public const string Integer32 = SysSecCvt.Integer32; /// A URI that represents the integer64 XML data type. - /// http://www.w3.org/2001/XMLSchema#integer64 + /// xs:integer64 public const string Integer64 = SysSecCvt.Integer64; /// A URI that represents the KeyInfo XML Signature data type. /// http://www.w3.org/2000/09/xmldsig#KeyInfo - public const string KeyInfo = SysSecCvt.KeyInfo; + public const string KeyInfo = SysSecCvt.KeyInfo;//"http://www.w3.org/2000/09/xmldsig#KeyInfo"; /// A URI that represents the rfc822Name XACML 1.0 data type. /// urn:oasis:names:tc:xacml:1.0:data-type:rfc822Name - public const string Rfc822Name = SysSecCvt.Rfc822Name; + public const string Rfc822Name = SysSecCvt.Rfc822name; /// A URI that represents the rsa SOAP data type. /// public const string Rsa = SysSecCvt.Rsa; /// A URI that represents the RSAKeyValue XML Signature data type. /// http://www.w3.org/2000/09/xmldsig#RSAKeyValue - public const string RsaKeyValue = SysSecCvt.RsaKeyValue; + public const string RsaKeyValue = SysSecCvt.Rsakeyvalue; /// A URI that represents the sid XML data type. - /// http://www.w3.org/2001/XMLSchema#sid + /// xs:sid public const string Sid = SysSecCvt.Sid; /// A URI that represents the string XML data type. - /// http://www.w3.org/2001/XMLSchema#string + /// xs:string public const string String = SysSecCvt.String; /// A URI that represents the time XML data type. - /// http://www.w3.org/2001/XMLSchema#time + /// xs:time public const string Time = SysSecCvt.Time; /// A URI that represents the uinteger32 XML data type. - /// http://www.w3.org/2001/XMLSchema#uinteger32 - public const string UInteger32 = SysSecCvt.UInteger32; + /// xs:uinteger32 + public const string UInteger32 = SysSecCvt.Uinteger32; /// A URI that represents the uinteger64 XML data type. - /// http://www.w3.org/2001/XMLSchema#uinteger64 - public const string UInteger64 = SysSecCvt.UInteger64; + /// xs:uinteger64 + public const string UInteger64 = SysSecCvt.Uinteger64; /// A URI that represents the UPN SOAP data type. /// http://schemas.xmlsoap.org/claims/UPN - public const string UpnName = SysSecCvt.UpnName; + public const string UpnName = SysSecCvt.Upnname; /// A URI that represents the x500Name XACML 1.0 data type. /// urn:oasis:names:tc:xacml:1.0:data-type:x500Name - public const string X500Name = SysSecCvt.X500Name; + public const string X500Name = SysSecCvt.X500name; /// A URI that represents the yearMonthDuration XQuery data type. /// http://www.w3.org/TR/2002/WD-xquery-operators-20020816#yearMonthDuration - public const string YearMonthDuration = SysSecCvt.YearMonthDuration; + public const string YearMonthDuration = SysSecCvt.Yearmonthduration; /// A URI that represents an unknown claim value type /// : @@ -142,7 +142,7 @@ public static partial class ClaimValueTypeUris // /// // /// A URI that represents the boolean XML data type. // /// -// /// http://www.w3.org/2001/XMLSchema#boolean +// /// xs:boolean // public static readonly ClaimValueType BooleanClaimValueType = new(SysSecVt.Boolean, "A URI that represents the boolean XML data type.", v => v.RuleFor(c => c.Value).Must(v => bool.TryParse(v, out var result))); // /// // /// A URI that represents the emailaddress SOAP data type. @@ -152,47 +152,47 @@ public static partial class ClaimValueTypeUris // /// // /// A URI that represents the string XML data type. // /// -// /// http://www.w3.org/2001/XMLSchema#string +// /// xs:string // public static readonly ClaimValueType StringClaimValueType = new(SysSecVt.String, "A URI that represents the string XML data type.", v => v.RuleFor(c => c.Value)); // /// -// /// A URI that represents the sid XML data type. http://www.w3.org/2001/XMLSchema#sid +// /// A URI that represents the sid XML data type. xs:sid // /// -// /// http://www.w3.org/2001/XMLSchema#sid +// /// xs:sid // public static readonly ClaimValueType SidClaimValueType = new(SysSecVt.Sid, "A URI that represents the sid XML data type.", v => v.RuleFor(c => c.Value)); // /// -// /// A URI that represents the date XML data type. http://www.w3.org/2001/XMLSchema#date +// /// A URI that represents the date XML data type. xs:date // /// -// /// http://www.w3.org/2001/XMLSchema#date +// /// xs:date // public static readonly ClaimValueType DateClaimValueType = new(SysSecVt.Date, "A URI that represents the date XML data type.", v => v.RuleFor(c => c.Value).Must(v => System.DateTime.TryParse(v, out var result))); // /// -// /// A URI that represents the date XML data type. http://www.w3.org/2001/XMLSchema#dateTime +// /// A URI that represents the date XML data type. xs:dateTime // /// -// /// http://www.w3.org/2001/XMLSchema#dateTime +// /// xs:dateTime // public static readonly ClaimValueType DateTimeClaimValueType = new(SysSecVt.DateTime, "A URI that represents the date XML data type.", v => v.RuleFor(c => c.Value).Must(v => System.DateTime.TryParse(v, out var result))); // /// -// /// A URI that represents the integer32 XML data type. http://www.w3.org/2001/XMLSchema#integer32 +// /// A URI that represents the integer32 XML data type. xs:integer32 // /// -// /// http://www.w3.org/2001/XMLSchema#integer32 +// /// xs:integer32 // public static readonly ClaimValueType Integer64ClaimValueType = new(SysSecVt.Integer64, "A URI that represents the integer64 XML data type.", v => v.RuleFor(c => c.Value).Must(v => long.TryParse(v, out var result))); // /// -// /// A URI that represents the integer32 XML data type. http://www.w3.org/2001/XMLSchema#integer32" +// /// A URI that represents the integer32 XML data type. xs:integer32" // /// -// /// http://www.w3.org/2001/XMLSchema#integer32 +// /// xs:integer32 // public static readonly ClaimValueType Integer32ClaimValueType = new(SysSecVt.Integer32, "A URI that represents the integer32 XML data type.", v => v.RuleFor(c => c.Value).Must(v => int.TryParse(v, out var result))); // /// -// /// A URI that represents the unsigned integer64 XML data type. http://www.w3.org/2001/XMLSchema#uinteger64 +// /// A URI that represents the unsigned integer64 XML data type. xs:uinteger64 // /// -// // http://www.w3.org/2001/XMLSchema#uinteger64 +// // xs:uinteger64 // public static readonly ClaimValueType UnsignedInteger64ClaimValueType = new(SysSecVt.UInteger64, "A URI that represents the integer64 XML data type.", v => v.RuleFor(c => c.Value).Must(v => long.TryParse(v, out var result))); // /// -// /// A URI that represents the unsigned integer32 XML data type. http://www.w3.org/2001/XMLSchema#uinteger32" +// /// A URI that represents the unsigned integer32 XML data type. xs:uinteger32" // /// -// /// http://www.w3.org/2001/XMLSchema#uinteger32 +// /// xs:uinteger32 // public static readonly ClaimValueType UnsignedInteger32ClaimValueType = new(SysSecVt.UInteger32, "A URI that represents the integer32 XML data type.", v => v.RuleFor(c => c.Value).Must(v => int.TryParse(v, out var result))); // /// -// /// A URI that represents the base64Binary XML data type. http://www.w3.org/2001/XMLSchema#base64Binary +// /// A URI that represents the base64Binary XML data type. xs:base64Binary // /// -// // http://www.w3.org/2001/XMLSchema#base64Binary +// // xs:base64Binary // public static readonly ClaimValueType Base64BinaryClaimValueType = new(SysSecVt.Base64Binary, "A URI that represents the base64Binary XML data type.", v => v.RuleFor(c => c.Value).Must(c => true)); // /// diff --git a/src/Claims/Dgmjr.Identity.Claims.sln b/src/Claims/Dgmjr.Identity.Claims.sln index 36146a5..3659faa 100644 --- a/src/Claims/Dgmjr.Identity.Claims.sln +++ b/src/Claims/Dgmjr.Identity.Claims.sln @@ -1,4 +1,54 @@ Microsoft Visual Studio Solution File, Format Version 12.00 +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{B283EBC2-E01F-412D-9339-FD56EF114549}" + ProjectSection(SolutionItems) = preProject + ..\..\..\..\Packages\Versions.props = ..\..\..\..\Packages\Versions.props + ..\..\..\..\Packages\Versions.Local.json = ..\..\..\..\Packages\Versions.Local.json + ..\..\..\..\Packages\Versions.Local.props = ..\..\..\..\Packages\Versions.Local.props + ..\..\..\..\Packages\Packages.pkgs = ..\..\..\..\Packages\Packages.pkgs + ..\..\..\..\Packages\Packages\AnyOf.pkgs = ..\..\..\..\Packages\Packages\AnyOf.pkgs + ..\..\..\..\Packages\Packages\APIVersioning.pkgs = ..\..\..\..\Packages\Packages\APIVersioning.pkgs + ..\..\..\..\Packages\Packages\AutoMapper.pkgs = ..\..\..\..\Packages\Packages\AutoMapper.pkgs + ..\..\..\..\Packages\Packages\Azure.pkgs = ..\..\..\..\Packages\Packages\Azure.pkgs + ..\..\..\..\Packages\Packages\AzureFunctions.pkgs = ..\..\..\..\Packages\Packages\AzureFunctions.pkgs + ..\..\..\..\Packages\Packages\DDD.pkgs = ..\..\..\..\Packages\Packages\DDD.pkgs + ..\..\..\..\Packages\Packages\EFCore.pkgs = ..\..\..\..\Packages\Packages\EFCore.pkgs + ..\..\..\..\Packages\Packages\GlobalBuild.pkgs = ..\..\..\..\Packages\Packages\GlobalBuild.pkgs + ..\..\..\..\Packages\Packages\GlobalCodeGenerators.pkgs = ..\..\..\..\Packages\Packages\GlobalCodeGenerators.pkgs + ..\..\..\..\Packages\Packages\Images.pkgs = ..\..\..\..\Packages\Packages\Images.pkgs + ..\..\..\..\Packages\Packages\McMaster.CommandLineUtils.pkgs = ..\..\..\..\Packages\Packages\McMaster.CommandLineUtils.pkgs + ..\..\..\..\Packages\Packages\MediatR.pkgs = ..\..\..\..\Packages\Packages\MediatR.pkgs + ..\..\..\..\Packages\Packages\Microsoft.AspNetCore.pkgs = ..\..\..\..\Packages\Packages\Microsoft.AspNetCore.pkgs + ..\..\..\..\Packages\Packages\Microsoft.Extensions.pkgs = ..\..\..\..\Packages\Packages\Microsoft.Extensions.pkgs + ..\..\..\..\Packages\Packages\Microsoft.Identity.pkgs = ..\..\..\..\Packages\Packages\Microsoft.Identity.pkgs + ..\..\..\..\Packages\Packages\Microsoft.VisualStudio.Shell.Interop.pkgs = ..\..\..\..\Packages\Packages\Microsoft.VisualStudio.Shell.Interop.pkgs + ..\..\..\..\Packages\Packages\Miscellany.pkgs = ..\..\..\..\Packages\Packages\Miscellany.pkgs + ..\..\..\..\Packages\Packages\MSBuild.pkgs = ..\..\..\..\Packages\Packages\MSBuild.pkgs + ..\..\..\..\Packages\Packages\MSBuildProjectCreator.pkgs = ..\..\..\..\Packages\Packages\MSBuildProjectCreator.pkgs + ..\..\..\..\Packages\Packages\MSBuildSdks.pkgs = ..\..\..\..\Packages\Packages\MSBuildSdks.pkgs + ..\..\..\..\Packages\Packages\Newtonsoft.Json.pkgs = ..\..\..\..\Packages\Packages\Newtonsoft.Json.pkgs + ..\..\..\..\Packages\Packages\NuGet.pkgs = ..\..\..\..\Packages\Packages\NuGet.pkgs + ..\..\..\..\Packages\Packages\Powershell.pkgs = ..\..\..\..\Packages\Packages\Powershell.pkgs + ..\..\..\..\Packages\Packages\Roslyn.pkgs = ..\..\..\..\Packages\Packages\Roslyn.pkgs + ..\..\..\..\Packages\Packages\Serilog.pkgs = ..\..\..\..\Packages\Packages\Serilog.pkgs + ..\..\..\..\Packages\Packages\SlnGen.pkgs = ..\..\..\..\Packages\Packages\SlnGen.pkgs + ..\..\..\..\Packages\Packages\Swashbuckle.pkgs = ..\..\..\..\Packages\Packages\Swashbuckle.pkgs + ..\..\..\..\Packages\Packages\System.pkgs = ..\..\..\..\Packages\Packages\System.pkgs + ..\..\..\..\Packages\Packages\Telegram.pkgs = ..\..\..\..\Packages\Packages\Telegram.pkgs + ..\..\..\..\Packages\Packages\Testing.EfCore.pkgs = ..\..\..\..\Packages\Packages\Testing.EfCore.pkgs + ..\..\..\..\Packages\Packages\Testing.pkgs = ..\..\..\..\Packages\Packages\Testing.pkgs + ..\..\..\..\Packages\Packages\Validation.pkgs = ..\..\..\..\Packages\Packages\Validation.pkgs + ..\..\..\..\Packages\Packages\XmlDocMd.pkgs = ..\..\..\..\Packages\Packages\XmlDocMd.pkgs + ..\..\..\..\Packages\Versions\AspNetCoreIdentity.props = ..\..\..\..\Packages\Versions\AspNetCoreIdentity.props + ..\..\..\..\Packages\Versions\AutoMapper.props = ..\..\..\..\Packages\Versions\AutoMapper.props + ..\..\..\..\Packages\Versions\CoreIntegratedLibs.props = ..\..\..\..\Packages\Versions\CoreIntegratedLibs.props + ..\..\..\..\Packages\Versions\EFCore.props = ..\..\..\..\Packages\Versions\EFCore.props + ..\..\..\..\Packages\Versions\JsonPatch.props = ..\..\..\..\Packages\Versions\JsonPatch.props + ..\..\..\..\Packages\Versions\MediatR.props = ..\..\..\..\Packages\Versions\MediatR.props + ..\..\..\..\Packages\Versions\Microsoft.Extensions.Logging.props = ..\..\..\..\Packages\Versions\Microsoft.Extensions.Logging.props + ..\..\..\..\Packages\Versions\MSBuild.props = ..\..\..\..\Packages\Versions\MSBuild.props + ..\..\..\..\Packages\Versions\PowerShell.props = ..\..\..\..\Packages\Versions\PowerShell.props + EndProjectSection +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution EndGlobalSection