From ace21f35a573026130dca6fdac7332bb282134fd Mon Sep 17 00:00:00 2001 From: DotNet Bot Date: Wed, 27 Sep 2023 23:21:57 +0000 Subject: [PATCH 01/10] Merged PR 33979: [internal/release/frameshift/6.0] Update dependencies from dnceng/internal/dotnet-runtime This pull request updates the following dependencies [marker]: <> (Begin:1c4b8d14-56b4-436a-cadd-08dbbf3cebf2) ## From https://github.com/dotnet/runtime - **Subscription**: 1c4b8d14-56b4-436a-cadd-08dbbf3cebf2 - **Build**: 20230925.15 - **Date Produced**: September 26, 2023 7:07:48 AM UTC - **Commit**: 301ba1ee5d1cfff28a8866924733603f3adf4936 - **Branch**: refs/heads/frameshift/internal/release/6.0 [DependencyUpdate]: <> (Begin) - **Updates**: - **Microsoft.Internal.Runtime.AspNetCore.Transport**: [from 6.0.21-servicing.23363.11 to 6.0.23-servicing.23475.15][1] - **Microsoft.NET.Runtime.MonoAOTCompiler.Task**: [from 6.0.21 to 6.0.23][1] - **Microsoft.NET.Runtime.WebAssembly.Sdk**: [from 6.0.21 to 6.0.23][1] - **Microsoft.NETCore.App.Ref**: [from 6.0.21 to 6.0.23][1] - **Microsoft.NETCore.App.Runtime.AOT.win-x64.Cross.browser-wasm**: [from 6.0.21 to 6.0.23][1] - **Microsoft.NETCore.App.Runtime.win-x64**: [from 6.0.21 to 6.0.23][1] - **Microsoft.NETCore.BrowserDebugHost.Transport**: [from 6.0.21-servicing.23363.11 to 6.0.23-servicing.23475.15][1] [1]: https://github.com/dotnet/runtime/compare/e40b3abf1b...301ba1ee5d [DependencyUpdate]: <> (End) [marker]: <> (End:1c4b8d14-56b4-436a-cadd-08dbbf3cebf2) --- NuGet.config | 2 ++ eng/Version.Details.xml | 42 ++++++++++++++++++++--------------------- eng/Versions.props | 14 +++++++------- 3 files changed, 30 insertions(+), 28 deletions(-) diff --git a/NuGet.config b/NuGet.config index 1e2458c409ad..7c42342bf5ad 100644 --- a/NuGet.config +++ b/NuGet.config @@ -4,6 +4,7 @@ + @@ -25,6 +26,7 @@ + diff --git a/eng/Version.Details.xml b/eng/Version.Details.xml index daa673a9468b..9af5757a4c2a 100644 --- a/eng/Version.Details.xml +++ b/eng/Version.Details.xml @@ -177,9 +177,9 @@ https://github.com/dotnet/runtime 4822e3c3aa77eb82b2fb33c9321f923cf11ddde6 - - https://dev.azure.com/dnceng/internal/_git/dotnet-runtime - e40b3abf1b41621d4298642a5fd300ebf7cccf6d + + https://github.com/dotnet/runtime + 301ba1ee5d1cfff28a8866924733603f3adf4936 https://dev.azure.com/dnceng/internal/_git/dotnet-runtime @@ -245,33 +245,33 @@ https://github.com/dotnet/runtime 4822e3c3aa77eb82b2fb33c9321f923cf11ddde6 - - https://dev.azure.com/dnceng/internal/_git/dotnet-runtime - e40b3abf1b41621d4298642a5fd300ebf7cccf6d + + https://github.com/dotnet/runtime + 301ba1ee5d1cfff28a8866924733603f3adf4936 - - https://dev.azure.com/dnceng/internal/_git/dotnet-runtime - e40b3abf1b41621d4298642a5fd300ebf7cccf6d + + https://github.com/dotnet/runtime + 301ba1ee5d1cfff28a8866924733603f3adf4936 - - https://dev.azure.com/dnceng/internal/_git/dotnet-runtime - e40b3abf1b41621d4298642a5fd300ebf7cccf6d + + https://github.com/dotnet/runtime + 301ba1ee5d1cfff28a8866924733603f3adf4936 - - https://dev.azure.com/dnceng/internal/_git/dotnet-runtime - e40b3abf1b41621d4298642a5fd300ebf7cccf6d + + https://github.com/dotnet/runtime + 301ba1ee5d1cfff28a8866924733603f3adf4936 - - https://dev.azure.com/dnceng/internal/_git/dotnet-runtime - e40b3abf1b41621d4298642a5fd300ebf7cccf6d + + https://github.com/dotnet/runtime + 301ba1ee5d1cfff28a8866924733603f3adf4936 - - https://dev.azure.com/dnceng/internal/_git/dotnet-runtime - e40b3abf1b41621d4298642a5fd300ebf7cccf6d + + https://github.com/dotnet/runtime + 301ba1ee5d1cfff28a8866924733603f3adf4936 diff --git a/eng/Versions.props b/eng/Versions.props index c08c43481bca..81ae58ddbf63 100644 --- a/eng/Versions.props +++ b/eng/Versions.props @@ -63,12 +63,12 @@ 6.0.0 - 6.0.21 - 6.0.21 - 6.0.21 - 6.0.21 - 6.0.21 - 6.0.21-servicing.23363.11 + 6.0.23 + 6.0.23 + 6.0.23 + 6.0.23 + 6.0.23 + 6.0.23-servicing.23475.15 6.0.0 6.0.1 6.0.0 @@ -103,7 +103,7 @@ 6.0.0 6.0.0 6.0.0 - 6.0.21-servicing.23363.11 + 6.0.23-servicing.23475.15 6.0.1 6.0.0 6.0.2 From b0468b9b0af17e4ad4be36198684741e1462bbcd Mon Sep 17 00:00:00 2001 From: Andrew Casey Date: Fri, 22 Sep 2023 18:50:04 -0700 Subject: [PATCH 02/10] Track indicators of excessive stream resets If the server has to send a lot of ENHANCE_YOUR_CALM messages or the output control flow queue is very large, there are probably a larger than expected number of client-initiated stream resets. --- .../src/Internal/Http2/Http2Connection.cs | 106 ++++++++++++++++-- .../Internal/Infrastructure/IKestrelTrace.cs | 4 + .../Internal/Infrastructure/KestrelTrace.cs | 16 +++ .../perf/Microbenchmarks/Mocks/MockTrace.cs | 2 + .../Http2SampleApp/Http2SampleApp.csproj | 2 +- .../shared/test/CompositeKestrelTrace.cs | 12 ++ 6 files changed, 134 insertions(+), 8 deletions(-) diff --git a/src/Servers/Kestrel/Core/src/Internal/Http2/Http2Connection.cs b/src/Servers/Kestrel/Core/src/Internal/Http2/Http2Connection.cs index ac3e9d166d4d..e6adcfc28dc9 100644 --- a/src/Servers/Kestrel/Core/src/Internal/Http2/Http2Connection.cs +++ b/src/Servers/Kestrel/Core/src/Internal/Http2/Http2Connection.cs @@ -33,6 +33,42 @@ internal partial class Http2Connection : IHttp2StreamLifetimeHandler, IHttpHeade private const PseudoHeaderFields _mandatoryRequestPseudoHeaderFields = PseudoHeaderFields.Method | PseudoHeaderFields.Path | PseudoHeaderFields.Scheme; + private const string EnhanceYourCalmMaximumCountProperty = "Microsoft.AspNetCore.Server.Kestrel.Http2.EnhanceYourCalmCount"; + private const string MaximumFlowControlQueueSizeProperty = "Microsoft.AspNetCore.Server.Kestrel.Http2.MaxConnectionFlowControlQueueSize"; + + private static readonly int _enhanceYourCalmMaximumCount = AppContext.GetData(EnhanceYourCalmMaximumCountProperty) is int eycMaxCount + ? eycMaxCount + : 10; + + // Accumulate _enhanceYourCalmCount over the course of EnhanceYourCalmTickWindowCount ticks. + // This should make bursts less likely to trigger disconnects. + private const int EnhanceYourCalmTickWindowCount = 5; + + private static bool IsEnhanceYourCalmEnabled => _enhanceYourCalmMaximumCount > 0; + + private static readonly int? ConfiguredMaximumFlowControlQueueSize = GetConfiguredMaximumFlowControlQueueSize(); + + private static int? GetConfiguredMaximumFlowControlQueueSize() + { + var data = AppContext.GetData(MaximumFlowControlQueueSizeProperty); + + if (data is int count) + { + return count; + } + + if (data is string countStr && int.TryParse(countStr, out var parsed)) + { + return parsed; + } + + return null; + } + + private readonly int _maximumFlowControlQueueSize; + + private bool IsMaximumFlowControlQueueSizeEnabled => _maximumFlowControlQueueSize > 0; + private readonly HttpConnectionContext _context; private readonly Http2FrameWriter _frameWriter; private readonly Pipe _input; @@ -40,7 +76,8 @@ internal partial class Http2Connection : IHttp2StreamLifetimeHandler, IHttpHeade private readonly int _minAllocBufferSize; private readonly HPackDecoder _hpackDecoder; private readonly InputFlowControl _inputFlowControl; - private readonly OutputFlowControl _outputFlowControl = new OutputFlowControl(new MultipleAwaitableProvider(), Http2PeerSettings.DefaultInitialWindowSize); + private readonly OutputFlowControl _outputFlowControl; + private readonly AwaitableProvider _outputFlowControlAwaitableProvider; // Keep our own reference so we can track queue size private readonly Http2PeerSettings _serverSettings = new Http2PeerSettings(); private readonly Http2PeerSettings _clientSettings = new Http2PeerSettings(); @@ -59,6 +96,9 @@ internal partial class Http2Connection : IHttp2StreamLifetimeHandler, IHttpHeade private int _clientActiveStreamCount; private int _serverActiveStreamCount; + private int _enhanceYourCalmCount; + private int _tickCount; + // The following are the only fields that can be modified outside of the ProcessRequestsAsync loop. private readonly ConcurrentQueue _completedStreams = new ConcurrentQueue(); private readonly StreamCloseAwaitable _streamCompletionAwaitable = new StreamCloseAwaitable(); @@ -88,6 +128,9 @@ public Http2Connection(HttpConnectionContext context) // Capture the ExecutionContext before dispatching HTTP/2 middleware. Will be restored by streams when processing request _context.InitialExecutionContext = ExecutionContext.Capture(); + _outputFlowControlAwaitableProvider = new MultipleAwaitableProvider(); + _outputFlowControl = new OutputFlowControl(_outputFlowControlAwaitableProvider, Http2PeerSettings.DefaultInitialWindowSize); + _frameWriter = new Http2FrameWriter( context.Transport.Output, context.ConnectionContext, @@ -129,6 +172,16 @@ public Http2Connection(HttpConnectionContext context) _serverSettings.MaxHeaderListSize = (uint)httpLimits.MaxRequestHeadersTotalSize; _serverSettings.InitialWindowSize = (uint)http2Limits.InitialStreamWindowSize; + _maximumFlowControlQueueSize = ConfiguredMaximumFlowControlQueueSize is null + ? 4 * http2Limits.MaxStreamsPerConnection + : (int)ConfiguredMaximumFlowControlQueueSize; + + if (_maximumFlowControlQueueSize < http2Limits.MaxStreamsPerConnection) + { + _maximumFlowControlQueueSize = http2Limits.MaxStreamsPerConnection; + Log.LogTrace($"The configured maximum flow control queue size {ConfiguredMaximumFlowControlQueueSize} is less than the maximum streams per connection {http2Limits.MaxStreamsPerConnection} - increasing to match."); + } + // Start pool off at a smaller size if the max number of streams is less than the InitialStreamPoolSize StreamPool = new PooledStreamStack(Math.Min(InitialStreamPoolSize, http2Limits.MaxStreamsPerConnection)); @@ -352,13 +405,20 @@ public async Task ProcessRequestsAsync(IHttpApplication appl stream.Abort(new IOException(CoreStrings.Http2StreamAborted, connectionError)); } - // Use the server _serverActiveStreamCount to drain all requests on the server side. - // Can't use _clientActiveStreamCount now as we now decrement that count earlier/ - // Can't use _streams.Count as we wait for RST/END_STREAM before removing the stream from the dictionary - while (_serverActiveStreamCount > 0) + // For some reason, this loop doesn't terminate when we're trying to abort. + // Since we're making a narrow fix for a patch, we'll bypass it in such scenarios. + // TODO: This is probably a bug - something in here should probably detect aborted + // connections and short-circuit. + if (!(IsEnhanceYourCalmEnabled || IsMaximumFlowControlQueueSizeEnabled) || error is not Http2ConnectionErrorException) { - await _streamCompletionAwaitable; - UpdateCompletedStreams(); + // Use the server _serverActiveStreamCount to drain all requests on the server side. + // Can't use _clientActiveStreamCount now as we now decrement that count earlier/ + // Can't use _streams.Count as we wait for RST/END_STREAM before removing the stream from the dictionary + while (_serverActiveStreamCount > 0) + { + await _streamCompletionAwaitable; + UpdateCompletedStreams(); + } } while (StreamPool.TryPop(out var pooledStream)) @@ -1053,6 +1113,20 @@ private void StartStream() throw new Http2StreamErrorException(_currentHeadersStream.StreamId, CoreStrings.Http2ErrorMaxStreams, Http2ErrorCode.REFUSED_STREAM); } + if (IsMaximumFlowControlQueueSizeEnabled && _outputFlowControlAwaitableProvider.ActiveCount > _maximumFlowControlQueueSize) + { + Log.Http2FlowControlQueueOperationsExceeded(_context.ConnectionId, _maximumFlowControlQueueSize); + + // Now that we've logged a useful message, we can put vague text in the exception + // messages in case they somehow make it back to the client (not expected) + + // This will close the socket - we want to do that right away + Abort(new ConnectionAbortedException("HTTP/2 connection exceeded the outgoing flow control maximum queue size.")); + + // Throwing an exception as well will help us clean up on our end more quickly by (e.g.) skipping processing of already-buffered input + throw new Http2ConnectionErrorException(CoreStrings.Http2ConnectionFaulted, Http2ErrorCode.INTERNAL_ERROR); + } + // We don't use the _serverActiveRequestCount here as during shutdown, it and the dictionary counts get out of sync. // The streams still exist in the dictionary until the client responds with a RST or END_STREAM. // Also, we care about the dictionary size for too much memory consumption. @@ -1061,6 +1135,20 @@ private void StartStream() // Server is getting hit hard with connection resets. // Tell client to calm down. // TODO consider making when to send ENHANCE_YOUR_CALM configurable? + + if (IsEnhanceYourCalmEnabled && Interlocked.Increment(ref _enhanceYourCalmCount) > EnhanceYourCalmTickWindowCount * _enhanceYourCalmMaximumCount) + { + Log.Http2TooManyEnhanceYourCalms(_context.ConnectionId, _enhanceYourCalmMaximumCount); + + // Now that we've logged a useful message, we can put vague text in the exception + // messages in case they somehow make it back to the client (not expected) + + // This will close the socket - we want to do that right away + Abort(new ConnectionAbortedException(CoreStrings.Http2ConnectionFaulted)); + // Throwing an exception as well will help us clean up on our end more quickly by (e.g.) skipping processing of already-buffered input + throw new Http2ConnectionErrorException(CoreStrings.Http2ConnectionFaulted, Http2ErrorCode.ENHANCE_YOUR_CALM); + } + throw new Http2StreamErrorException(_currentHeadersStream.StreamId, CoreStrings.Http2TellClientToCalmDown, Http2ErrorCode.ENHANCE_YOUR_CALM); } } @@ -1123,6 +1211,10 @@ private void AbortStream(int streamId, IOException error) void IRequestProcessor.Tick(DateTimeOffset now) { Input.CancelPendingRead(); + if (IsEnhanceYourCalmEnabled && ++_tickCount % EnhanceYourCalmTickWindowCount == 0) + { + Interlocked.Exchange(ref _enhanceYourCalmCount, 0); + } } void IHttp2StreamLifetimeHandler.OnStreamCompleted(Http2Stream stream) diff --git a/src/Servers/Kestrel/Core/src/Internal/Infrastructure/IKestrelTrace.cs b/src/Servers/Kestrel/Core/src/Internal/Infrastructure/IKestrelTrace.cs index 6a75f4657b14..6fb38405572f 100644 --- a/src/Servers/Kestrel/Core/src/Internal/Infrastructure/IKestrelTrace.cs +++ b/src/Servers/Kestrel/Core/src/Internal/Infrastructure/IKestrelTrace.cs @@ -78,8 +78,12 @@ internal interface IKestrelTrace : ILogger void Http2FrameSending(string connectionId, Http2Frame frame); + void Http2TooManyEnhanceYourCalms(string connectionId, int count); + void Http2MaxConcurrentStreamsReached(string connectionId); + void Http2FlowControlQueueOperationsExceeded(string connectionId, int count); + void InvalidResponseHeaderRemoved(); void Http3ConnectionError(string connectionId, Http3ConnectionErrorException ex); diff --git a/src/Servers/Kestrel/Core/src/Internal/Infrastructure/KestrelTrace.cs b/src/Servers/Kestrel/Core/src/Internal/Infrastructure/KestrelTrace.cs index 3c3b7bc4af07..364c5ed0f252 100644 --- a/src/Servers/Kestrel/Core/src/Internal/Infrastructure/KestrelTrace.cs +++ b/src/Servers/Kestrel/Core/src/Internal/Infrastructure/KestrelTrace.cs @@ -395,6 +395,22 @@ public void Http3GoAwayStreamId(string connectionId, long goAwayStreamId) Http3GoAwayStreamId(_http3Logger, connectionId, goAwayStreamId); } + [LoggerMessage(54, LogLevel.Error, @"Connection id ""{ConnectionId}"" aborted since at least ""{Count}"" ENHANCE_YOUR_CALM responses were required per second.", EventName = "Http2TooManyEnhanceYourCalms")] + private static partial void Http2TooManyEnhanceYourCalms(ILogger logger, string connectionId, int count); + + public void Http2TooManyEnhanceYourCalms(string connectionId, int count) + { + Http2TooManyEnhanceYourCalms(_http2Logger, connectionId, count); + } + + [LoggerMessage(55, LogLevel.Error, @"Connection id ""{ConnectionId}"" exceeded the output flow control maximum queue size of ""{Count}"".", EventName = "Http2FlowControlQueueOperationsExceeded")] + private static partial void Http2FlowControlQueueOperationsExceeded(ILogger logger, string connectionId, int count); + + public void Http2FlowControlQueueOperationsExceeded(string connectionId, int count) + { + Http2FlowControlQueueOperationsExceeded(_http3Logger, connectionId, count); + } + public virtual void Log(LogLevel logLevel, EventId eventId, TState state, Exception? exception, Func formatter) => _generalLogger.Log(logLevel, eventId, state, exception, formatter); diff --git a/src/Servers/Kestrel/perf/Microbenchmarks/Mocks/MockTrace.cs b/src/Servers/Kestrel/perf/Microbenchmarks/Mocks/MockTrace.cs index 7a87e2ee4041..ce71ea8255d9 100644 --- a/src/Servers/Kestrel/perf/Microbenchmarks/Mocks/MockTrace.cs +++ b/src/Servers/Kestrel/perf/Microbenchmarks/Mocks/MockTrace.cs @@ -59,7 +59,9 @@ public void Http2ConnectionClosing(string connectionId) { } public void Http2ConnectionClosed(string connectionId, int highestOpenedStreamId) { } public void Http2FrameReceived(string connectionId, Http2Frame frame) { } public void Http2FrameSending(string connectionId, Http2Frame frame) { } + public void Http2TooManyEnhanceYourCalms(string connectionId, int count) { } public void Http2MaxConcurrentStreamsReached(string connectionId) { } + public void Http2FlowControlQueueOperationsExceeded(string connectionId, int count) { } public void InvalidResponseHeaderRemoved() { } public void Http3ConnectionError(string connectionId, Http3ConnectionErrorException ex) { } public void Http3ConnectionClosing(string connectionId) { } diff --git a/src/Servers/Kestrel/samples/Http2SampleApp/Http2SampleApp.csproj b/src/Servers/Kestrel/samples/Http2SampleApp/Http2SampleApp.csproj index cc404533ad8f..d0930e69fee0 100644 --- a/src/Servers/Kestrel/samples/Http2SampleApp/Http2SampleApp.csproj +++ b/src/Servers/Kestrel/samples/Http2SampleApp/Http2SampleApp.csproj @@ -1,4 +1,4 @@ - + $(DefaultNetCoreTargetFramework) diff --git a/src/Servers/Kestrel/shared/test/CompositeKestrelTrace.cs b/src/Servers/Kestrel/shared/test/CompositeKestrelTrace.cs index 523e77a059ac..cede2f59521c 100644 --- a/src/Servers/Kestrel/shared/test/CompositeKestrelTrace.cs +++ b/src/Servers/Kestrel/shared/test/CompositeKestrelTrace.cs @@ -234,12 +234,24 @@ public void Http2FrameSending(string connectionId, Http2Frame frame) _trace2.Http2FrameSending(connectionId, frame); } + public void Http2TooManyEnhanceYourCalms(string connectionId, int count) + { + _trace1.Http2TooManyEnhanceYourCalms(connectionId, count); + _trace2.Http2TooManyEnhanceYourCalms(connectionId, count); + } + public void Http2MaxConcurrentStreamsReached(string connectionId) { _trace1.Http2MaxConcurrentStreamsReached(connectionId); _trace2.Http2MaxConcurrentStreamsReached(connectionId); } + public void Http2FlowControlQueueOperationsExceeded(string connectionId, int count) + { + _trace1.Http2FlowControlQueueOperationsExceeded(connectionId, count); + _trace2.Http2FlowControlQueueOperationsExceeded(connectionId, count); + } + public void InvalidResponseHeaderRemoved() { _trace1.InvalidResponseHeaderRemoved(); From 2a8a47bc1b6f787e165c57b19a0ff2048d33371a Mon Sep 17 00:00:00 2001 From: Andrew Casey Date: Tue, 26 Sep 2023 17:58:44 -0700 Subject: [PATCH 03/10] Address PR feedback --- .../src/Internal/Http2/Http2Connection.cs | 23 +++++++++++++++---- .../Internal/Infrastructure/IKestrelTrace.cs | 2 ++ .../Internal/Infrastructure/KestrelTrace.cs | 12 ++++++++-- .../perf/Microbenchmarks/Mocks/MockTrace.cs | 1 + .../shared/test/CompositeKestrelTrace.cs | 6 +++++ 5 files changed, 37 insertions(+), 7 deletions(-) diff --git a/src/Servers/Kestrel/Core/src/Internal/Http2/Http2Connection.cs b/src/Servers/Kestrel/Core/src/Internal/Http2/Http2Connection.cs index e6adcfc28dc9..34069616c6e3 100644 --- a/src/Servers/Kestrel/Core/src/Internal/Http2/Http2Connection.cs +++ b/src/Servers/Kestrel/Core/src/Internal/Http2/Http2Connection.cs @@ -36,9 +36,22 @@ internal partial class Http2Connection : IHttp2StreamLifetimeHandler, IHttpHeade private const string EnhanceYourCalmMaximumCountProperty = "Microsoft.AspNetCore.Server.Kestrel.Http2.EnhanceYourCalmCount"; private const string MaximumFlowControlQueueSizeProperty = "Microsoft.AspNetCore.Server.Kestrel.Http2.MaxConnectionFlowControlQueueSize"; - private static readonly int _enhanceYourCalmMaximumCount = AppContext.GetData(EnhanceYourCalmMaximumCountProperty) is int eycMaxCount - ? eycMaxCount - : 10; + private static readonly int _enhanceYourCalmMaximumCount = GetEnhanceYourCalmMaximumCount(); + + private static int GetEnhanceYourCalmMaximumCount() + { + var data = AppContext.GetData(EnhanceYourCalmMaximumCountProperty); + if (data is int count) + { + return count; + } + if (data is string countStr && int.TryParse(countStr, out var parsed)) + { + return parsed; + } + + return 20; // Empirically derived + } // Accumulate _enhanceYourCalmCount over the course of EnhanceYourCalmTickWindowCount ticks. // This should make bursts less likely to trigger disconnects. @@ -176,10 +189,10 @@ public Http2Connection(HttpConnectionContext context) ? 4 * http2Limits.MaxStreamsPerConnection : (int)ConfiguredMaximumFlowControlQueueSize; - if (_maximumFlowControlQueueSize < http2Limits.MaxStreamsPerConnection) + if (IsMaximumFlowControlQueueSizeEnabled && _maximumFlowControlQueueSize < http2Limits.MaxStreamsPerConnection) { + Log.Http2FlowControlQueueMaximumTooLow(context.ConnectionId, http2Limits.MaxStreamsPerConnection, _maximumFlowControlQueueSize); _maximumFlowControlQueueSize = http2Limits.MaxStreamsPerConnection; - Log.LogTrace($"The configured maximum flow control queue size {ConfiguredMaximumFlowControlQueueSize} is less than the maximum streams per connection {http2Limits.MaxStreamsPerConnection} - increasing to match."); } // Start pool off at a smaller size if the max number of streams is less than the InitialStreamPoolSize diff --git a/src/Servers/Kestrel/Core/src/Internal/Infrastructure/IKestrelTrace.cs b/src/Servers/Kestrel/Core/src/Internal/Infrastructure/IKestrelTrace.cs index 6fb38405572f..28b7b5cd8b05 100644 --- a/src/Servers/Kestrel/Core/src/Internal/Infrastructure/IKestrelTrace.cs +++ b/src/Servers/Kestrel/Core/src/Internal/Infrastructure/IKestrelTrace.cs @@ -84,6 +84,8 @@ internal interface IKestrelTrace : ILogger void Http2FlowControlQueueOperationsExceeded(string connectionId, int count); + void Http2FlowControlQueueMaximumTooLow(string connectionId, int expected, int actual); + void InvalidResponseHeaderRemoved(); void Http3ConnectionError(string connectionId, Http3ConnectionErrorException ex); diff --git a/src/Servers/Kestrel/Core/src/Internal/Infrastructure/KestrelTrace.cs b/src/Servers/Kestrel/Core/src/Internal/Infrastructure/KestrelTrace.cs index 364c5ed0f252..439fb69fbec4 100644 --- a/src/Servers/Kestrel/Core/src/Internal/Infrastructure/KestrelTrace.cs +++ b/src/Servers/Kestrel/Core/src/Internal/Infrastructure/KestrelTrace.cs @@ -395,7 +395,7 @@ public void Http3GoAwayStreamId(string connectionId, long goAwayStreamId) Http3GoAwayStreamId(_http3Logger, connectionId, goAwayStreamId); } - [LoggerMessage(54, LogLevel.Error, @"Connection id ""{ConnectionId}"" aborted since at least ""{Count}"" ENHANCE_YOUR_CALM responses were required per second.", EventName = "Http2TooManyEnhanceYourCalms")] + [LoggerMessage(54, LogLevel.Debug, @"Connection id ""{ConnectionId}"" aborted since at least ""{Count}"" ENHANCE_YOUR_CALM responses were required per second.", EventName = "Http2TooManyEnhanceYourCalms")] private static partial void Http2TooManyEnhanceYourCalms(ILogger logger, string connectionId, int count); public void Http2TooManyEnhanceYourCalms(string connectionId, int count) @@ -403,7 +403,7 @@ public void Http2TooManyEnhanceYourCalms(string connectionId, int count) Http2TooManyEnhanceYourCalms(_http2Logger, connectionId, count); } - [LoggerMessage(55, LogLevel.Error, @"Connection id ""{ConnectionId}"" exceeded the output flow control maximum queue size of ""{Count}"".", EventName = "Http2FlowControlQueueOperationsExceeded")] + [LoggerMessage(55, LogLevel.Debug, @"Connection id ""{ConnectionId}"" exceeded the output flow control maximum queue size of ""{Count}"".", EventName = "Http2FlowControlQueueOperationsExceeded")] private static partial void Http2FlowControlQueueOperationsExceeded(ILogger logger, string connectionId, int count); public void Http2FlowControlQueueOperationsExceeded(string connectionId, int count) @@ -411,6 +411,14 @@ public void Http2FlowControlQueueOperationsExceeded(string connectionId, int cou Http2FlowControlQueueOperationsExceeded(_http3Logger, connectionId, count); } + [LoggerMessage(56, LogLevel.Debug, @"Connection id ""{ConnectionId}"" configured maximum flow control queue size ""{Actual}"" is less than the maximum streams per connection ""{Expected}"" - increasing to match.", EventName = "Http2FlowControlQueueMaximumTooLow")] + private static partial void Http2FlowControlQueueMaximumTooLow(ILogger logger, string connectionId, int expected, int actual); + + public void Http2FlowControlQueueMaximumTooLow(string connectionId, int expected, int actual) + { + Http2FlowControlQueueMaximumTooLow(_http3Logger, connectionId, expected, actual); + } + public virtual void Log(LogLevel logLevel, EventId eventId, TState state, Exception? exception, Func formatter) => _generalLogger.Log(logLevel, eventId, state, exception, formatter); diff --git a/src/Servers/Kestrel/perf/Microbenchmarks/Mocks/MockTrace.cs b/src/Servers/Kestrel/perf/Microbenchmarks/Mocks/MockTrace.cs index ce71ea8255d9..c9052461b9ed 100644 --- a/src/Servers/Kestrel/perf/Microbenchmarks/Mocks/MockTrace.cs +++ b/src/Servers/Kestrel/perf/Microbenchmarks/Mocks/MockTrace.cs @@ -62,6 +62,7 @@ public void Http2FrameSending(string connectionId, Http2Frame frame) { } public void Http2TooManyEnhanceYourCalms(string connectionId, int count) { } public void Http2MaxConcurrentStreamsReached(string connectionId) { } public void Http2FlowControlQueueOperationsExceeded(string connectionId, int count) { } + public void Http2FlowControlQueueMaximumTooLow(string connectionId, int expected, int actual) { } public void InvalidResponseHeaderRemoved() { } public void Http3ConnectionError(string connectionId, Http3ConnectionErrorException ex) { } public void Http3ConnectionClosing(string connectionId) { } diff --git a/src/Servers/Kestrel/shared/test/CompositeKestrelTrace.cs b/src/Servers/Kestrel/shared/test/CompositeKestrelTrace.cs index cede2f59521c..1245abfd2a4b 100644 --- a/src/Servers/Kestrel/shared/test/CompositeKestrelTrace.cs +++ b/src/Servers/Kestrel/shared/test/CompositeKestrelTrace.cs @@ -252,6 +252,12 @@ public void Http2FlowControlQueueOperationsExceeded(string connectionId, int cou _trace2.Http2FlowControlQueueOperationsExceeded(connectionId, count); } + public void Http2FlowControlQueueMaximumTooLow(string connectionId, int expected, int actual) + { + _trace1.Http2FlowControlQueueMaximumTooLow(connectionId, expected, actual); + _trace2.Http2FlowControlQueueMaximumTooLow(connectionId, expected, actual); + } + public void InvalidResponseHeaderRemoved() { _trace1.InvalidResponseHeaderRemoved(); From 7d6aec8e0b8a011b13ec29c56d8d1223b40fee02 Mon Sep 17 00:00:00 2001 From: Andrew Casey Date: Tue, 26 Sep 2023 20:00:09 -0700 Subject: [PATCH 04/10] Address PR feedback --- .../Core/src/Internal/Http2/Http2Connection.cs | 12 +++++++----- .../Core/src/Internal/Infrastructure/KestrelTrace.cs | 6 +++--- 2 files changed, 10 insertions(+), 8 deletions(-) diff --git a/src/Servers/Kestrel/Core/src/Internal/Http2/Http2Connection.cs b/src/Servers/Kestrel/Core/src/Internal/Http2/Http2Connection.cs index 34069616c6e3..5280f3e2b275 100644 --- a/src/Servers/Kestrel/Core/src/Internal/Http2/Http2Connection.cs +++ b/src/Servers/Kestrel/Core/src/Internal/Http2/Http2Connection.cs @@ -33,14 +33,14 @@ internal partial class Http2Connection : IHttp2StreamLifetimeHandler, IHttpHeade private const PseudoHeaderFields _mandatoryRequestPseudoHeaderFields = PseudoHeaderFields.Method | PseudoHeaderFields.Path | PseudoHeaderFields.Scheme; - private const string EnhanceYourCalmMaximumCountProperty = "Microsoft.AspNetCore.Server.Kestrel.Http2.EnhanceYourCalmCount"; + private const string MaximumEnhanceYourCalmCountProperty = "Microsoft.AspNetCore.Server.Kestrel.Http2.MaxEnhanceYourCalmCount"; private const string MaximumFlowControlQueueSizeProperty = "Microsoft.AspNetCore.Server.Kestrel.Http2.MaxConnectionFlowControlQueueSize"; - private static readonly int _enhanceYourCalmMaximumCount = GetEnhanceYourCalmMaximumCount(); + private static readonly int _enhanceYourCalmMaximumCount = GetMaximumEnhanceYourCalmCount(); - private static int GetEnhanceYourCalmMaximumCount() + private static int GetMaximumEnhanceYourCalmCount() { - var data = AppContext.GetData(EnhanceYourCalmMaximumCountProperty); + var data = AppContext.GetData(MaximumEnhanceYourCalmCountProperty); if (data is int count) { return count; @@ -186,7 +186,7 @@ public Http2Connection(HttpConnectionContext context) _serverSettings.InitialWindowSize = (uint)http2Limits.InitialStreamWindowSize; _maximumFlowControlQueueSize = ConfiguredMaximumFlowControlQueueSize is null - ? 4 * http2Limits.MaxStreamsPerConnection + ? 4 * http2Limits.MaxStreamsPerConnection // 4 is a magic number to give us some padding above the expected maximum size : (int)ConfiguredMaximumFlowControlQueueSize; if (IsMaximumFlowControlQueueSizeEnabled && _maximumFlowControlQueueSize < http2Limits.MaxStreamsPerConnection) @@ -1224,6 +1224,8 @@ private void AbortStream(int streamId, IOException error) void IRequestProcessor.Tick(DateTimeOffset now) { Input.CancelPendingRead(); + // We count EYCs over a window of a given length to avoid flagging short-lived bursts. + // At the end of each window, reset the count. if (IsEnhanceYourCalmEnabled && ++_tickCount % EnhanceYourCalmTickWindowCount == 0) { Interlocked.Exchange(ref _enhanceYourCalmCount, 0); diff --git a/src/Servers/Kestrel/Core/src/Internal/Infrastructure/KestrelTrace.cs b/src/Servers/Kestrel/Core/src/Internal/Infrastructure/KestrelTrace.cs index 439fb69fbec4..6a9279e5a3f0 100644 --- a/src/Servers/Kestrel/Core/src/Internal/Infrastructure/KestrelTrace.cs +++ b/src/Servers/Kestrel/Core/src/Internal/Infrastructure/KestrelTrace.cs @@ -395,7 +395,7 @@ public void Http3GoAwayStreamId(string connectionId, long goAwayStreamId) Http3GoAwayStreamId(_http3Logger, connectionId, goAwayStreamId); } - [LoggerMessage(54, LogLevel.Debug, @"Connection id ""{ConnectionId}"" aborted since at least ""{Count}"" ENHANCE_YOUR_CALM responses were required per second.", EventName = "Http2TooManyEnhanceYourCalms")] + [LoggerMessage(54, LogLevel.Debug, @"Connection id ""{ConnectionId}"" aborted since at least {Count} ENHANCE_YOUR_CALM responses were recorded per second.", EventName = "Http2TooManyEnhanceYourCalms")] private static partial void Http2TooManyEnhanceYourCalms(ILogger logger, string connectionId, int count); public void Http2TooManyEnhanceYourCalms(string connectionId, int count) @@ -403,7 +403,7 @@ public void Http2TooManyEnhanceYourCalms(string connectionId, int count) Http2TooManyEnhanceYourCalms(_http2Logger, connectionId, count); } - [LoggerMessage(55, LogLevel.Debug, @"Connection id ""{ConnectionId}"" exceeded the output flow control maximum queue size of ""{Count}"".", EventName = "Http2FlowControlQueueOperationsExceeded")] + [LoggerMessage(55, LogLevel.Debug, @"Connection id ""{ConnectionId}"" exceeded the output flow control maximum queue size of {Count}.", EventName = "Http2FlowControlQueueOperationsExceeded")] private static partial void Http2FlowControlQueueOperationsExceeded(ILogger logger, string connectionId, int count); public void Http2FlowControlQueueOperationsExceeded(string connectionId, int count) @@ -411,7 +411,7 @@ public void Http2FlowControlQueueOperationsExceeded(string connectionId, int cou Http2FlowControlQueueOperationsExceeded(_http3Logger, connectionId, count); } - [LoggerMessage(56, LogLevel.Debug, @"Connection id ""{ConnectionId}"" configured maximum flow control queue size ""{Actual}"" is less than the maximum streams per connection ""{Expected}"" - increasing to match.", EventName = "Http2FlowControlQueueMaximumTooLow")] + [LoggerMessage(56, LogLevel.Debug, @"Connection id ""{ConnectionId}"" configured maximum flow control queue size {Actual} is less than the maximum streams per connection {Expected}. Increasing configured value to {Expected}.", EventName = "Http2FlowControlQueueMaximumTooLow")] private static partial void Http2FlowControlQueueMaximumTooLow(ILogger logger, string connectionId, int expected, int actual); public void Http2FlowControlQueueMaximumTooLow(string connectionId, int expected, int actual) From 95bb0b8c16d3b27d41296a5a44f9f3b5d54d4a05 Mon Sep 17 00:00:00 2001 From: Andrew Casey Date: Tue, 26 Sep 2023 20:04:26 -0700 Subject: [PATCH 05/10] Increase the min max queue size to match 7 and 8 --- .../Kestrel/Core/src/Internal/Http2/Http2Connection.cs | 7 ++++--- .../Core/src/Internal/Infrastructure/KestrelTrace.cs | 2 +- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/src/Servers/Kestrel/Core/src/Internal/Http2/Http2Connection.cs b/src/Servers/Kestrel/Core/src/Internal/Http2/Http2Connection.cs index 5280f3e2b275..2e4a208fcc4e 100644 --- a/src/Servers/Kestrel/Core/src/Internal/Http2/Http2Connection.cs +++ b/src/Servers/Kestrel/Core/src/Internal/Http2/Http2Connection.cs @@ -189,10 +189,11 @@ public Http2Connection(HttpConnectionContext context) ? 4 * http2Limits.MaxStreamsPerConnection // 4 is a magic number to give us some padding above the expected maximum size : (int)ConfiguredMaximumFlowControlQueueSize; - if (IsMaximumFlowControlQueueSizeEnabled && _maximumFlowControlQueueSize < http2Limits.MaxStreamsPerConnection) + var minimumMaximumFlowControlQueueSize = 2 * http2Limits.MaxStreamsPerConnection; // Double to match 7.0 and 8.0 + if (IsMaximumFlowControlQueueSizeEnabled && _maximumFlowControlQueueSize < minimumMaximumFlowControlQueueSize) { - Log.Http2FlowControlQueueMaximumTooLow(context.ConnectionId, http2Limits.MaxStreamsPerConnection, _maximumFlowControlQueueSize); - _maximumFlowControlQueueSize = http2Limits.MaxStreamsPerConnection; + Log.Http2FlowControlQueueMaximumTooLow(context.ConnectionId, minimumMaximumFlowControlQueueSize, _maximumFlowControlQueueSize); + _maximumFlowControlQueueSize = minimumMaximumFlowControlQueueSize; } // Start pool off at a smaller size if the max number of streams is less than the InitialStreamPoolSize diff --git a/src/Servers/Kestrel/Core/src/Internal/Infrastructure/KestrelTrace.cs b/src/Servers/Kestrel/Core/src/Internal/Infrastructure/KestrelTrace.cs index 6a9279e5a3f0..c1a6021549f5 100644 --- a/src/Servers/Kestrel/Core/src/Internal/Infrastructure/KestrelTrace.cs +++ b/src/Servers/Kestrel/Core/src/Internal/Infrastructure/KestrelTrace.cs @@ -411,7 +411,7 @@ public void Http2FlowControlQueueOperationsExceeded(string connectionId, int cou Http2FlowControlQueueOperationsExceeded(_http3Logger, connectionId, count); } - [LoggerMessage(56, LogLevel.Debug, @"Connection id ""{ConnectionId}"" configured maximum flow control queue size {Actual} is less than the maximum streams per connection {Expected}. Increasing configured value to {Expected}.", EventName = "Http2FlowControlQueueMaximumTooLow")] + [LoggerMessage(56, LogLevel.Debug, @"Connection id ""{ConnectionId}"" configured maximum flow control queue size {Actual} is less than double the maximum streams per connection {Expected}. Increasing configured value to {Expected}.", EventName = "Http2FlowControlQueueMaximumTooLow")] private static partial void Http2FlowControlQueueMaximumTooLow(ILogger logger, string connectionId, int expected, int actual); public void Http2FlowControlQueueMaximumTooLow(string connectionId, int expected, int actual) From 1d49c492e467318607e5874fc6af645115fd0434 Mon Sep 17 00:00:00 2001 From: DotNet Bot Date: Thu, 28 Sep 2023 01:32:29 +0000 Subject: [PATCH 06/10] Merged PR 33993: [internal/release/frameshift/6.0] Update dependencies from dnceng/internal/dotnet-efcore This pull request updates the following dependencies [marker]: <> (Begin:5290da81-c92c-4654-752d-08dbbf92e774) ## From https://github.com/dotnet/efcore - **Subscription**: 5290da81-c92c-4654-752d-08dbbf92e774 - **Build**: 20230927.15 - **Date Produced**: September 28, 2023 1:08:02 AM UTC - **Commit**: 50a6896cca24b06e154bdf652c2e7aefd0dfb7a1 - **Branch**: refs/heads/internal/release/frameshift/6.0 [DependencyUpdate]: <> (Begin) - **Updates**: - **dotnet-ef**: [from 6.0.21 to 6.0.23][1] - **Microsoft.EntityFrameworkCore**: [from 6.0.21 to 6.0.23][1] - **Microsoft.EntityFrameworkCore.Design**: [from 6.0.21 to 6.0.23][1] - **Microsoft.EntityFrameworkCore.InMemory**: [from 6.0.21 to 6.0.23][1] - **Microsoft.EntityFrameworkCore.Relational**: [from 6.0.21 to 6.0.23][1] - **Microsoft.EntityFrameworkCore.Sqlite**: [from 6.0.21 to 6.0.23][1] - **Microsoft.EntityFrameworkCore.SqlServer**: [from 6.0.21 to 6.0.23][1] - **Microsoft.EntityFrameworkCore.Tools**: [from 6.0.21 to 6.0.23][1] [1]: https://github.com/dotnet/efcore/compare/fa741b8bad...50a6896cca [DependencyUpdate]: <> (End) [marker]: <> (End:5290da81-c92c-4654-752d-08dbbf92e774) --- NuGet.config | 2 ++ eng/Version.Details.xml | 48 ++++++++++++++++++++--------------------- eng/Versions.props | 16 +++++++------- 3 files changed, 34 insertions(+), 32 deletions(-) diff --git a/NuGet.config b/NuGet.config index 7c42342bf5ad..8bbcc5e342e0 100644 --- a/NuGet.config +++ b/NuGet.config @@ -7,6 +7,7 @@ + @@ -24,6 +25,7 @@ + diff --git a/eng/Version.Details.xml b/eng/Version.Details.xml index 9af5757a4c2a..ed44928afcc8 100644 --- a/eng/Version.Details.xml +++ b/eng/Version.Details.xml @@ -9,37 +9,37 @@ --> - - https://dev.azure.com/dnceng/internal/_git/dotnet-efcore - fa741b8bad8eebb503bba99e078538f97aff3f5d + + https://github.com/dotnet/efcore + 50a6896cca24b06e154bdf652c2e7aefd0dfb7a1 - - https://dev.azure.com/dnceng/internal/_git/dotnet-efcore - fa741b8bad8eebb503bba99e078538f97aff3f5d + + https://github.com/dotnet/efcore + 50a6896cca24b06e154bdf652c2e7aefd0dfb7a1 - - https://dev.azure.com/dnceng/internal/_git/dotnet-efcore - fa741b8bad8eebb503bba99e078538f97aff3f5d + + https://github.com/dotnet/efcore + 50a6896cca24b06e154bdf652c2e7aefd0dfb7a1 - - https://dev.azure.com/dnceng/internal/_git/dotnet-efcore - fa741b8bad8eebb503bba99e078538f97aff3f5d + + https://github.com/dotnet/efcore + 50a6896cca24b06e154bdf652c2e7aefd0dfb7a1 - - https://dev.azure.com/dnceng/internal/_git/dotnet-efcore - fa741b8bad8eebb503bba99e078538f97aff3f5d + + https://github.com/dotnet/efcore + 50a6896cca24b06e154bdf652c2e7aefd0dfb7a1 - - https://dev.azure.com/dnceng/internal/_git/dotnet-efcore - fa741b8bad8eebb503bba99e078538f97aff3f5d + + https://github.com/dotnet/efcore + 50a6896cca24b06e154bdf652c2e7aefd0dfb7a1 - - https://dev.azure.com/dnceng/internal/_git/dotnet-efcore - fa741b8bad8eebb503bba99e078538f97aff3f5d + + https://github.com/dotnet/efcore + 50a6896cca24b06e154bdf652c2e7aefd0dfb7a1 - - https://dev.azure.com/dnceng/internal/_git/dotnet-efcore - fa741b8bad8eebb503bba99e078538f97aff3f5d + + https://github.com/dotnet/efcore + 50a6896cca24b06e154bdf652c2e7aefd0dfb7a1 https://github.com/dotnet/runtime diff --git a/eng/Versions.props b/eng/Versions.props index 81ae58ddbf63..39fb8e05250c 100644 --- a/eng/Versions.props +++ b/eng/Versions.props @@ -122,14 +122,14 @@ 6.0.11 - 6.0.21 - 6.0.21 - 6.0.21 - 6.0.21 - 6.0.21 - 6.0.21 - 6.0.21 - 6.0.21 + 6.0.23 + 6.0.23 + 6.0.23 + 6.0.23 + 6.0.23 + 6.0.23 + 6.0.23 + 6.0.23 6.0.0-beta.23408.5 6.0.0-beta.23408.5 From b1eee58b6f09b977a5ab9c49f5da5904bee421c8 Mon Sep 17 00:00:00 2001 From: DotNet-Bot Date: Sat, 30 Sep 2023 00:13:18 +0000 Subject: [PATCH 07/10] Update dependencies from https://github.com/dotnet/runtime build 20230929.5 Microsoft.Internal.Runtime.AspNetCore.Transport , Microsoft.NETCore.BrowserDebugHost.Transport From Version 6.0.23-servicing.23475.15 -> To Version 6.0.23-servicing.23479.5 --- NuGet.config | 8 ++++++-- eng/Version.Details.xml | 4 ++-- eng/Versions.props | 4 ++-- 3 files changed, 10 insertions(+), 6 deletions(-) diff --git a/NuGet.config b/NuGet.config index 8bbcc5e342e0..22c8c5eb5bb8 100644 --- a/NuGet.config +++ b/NuGet.config @@ -4,10 +4,12 @@ - + + + @@ -25,10 +27,12 @@ + + - + diff --git a/eng/Version.Details.xml b/eng/Version.Details.xml index ed44928afcc8..160770633949 100644 --- a/eng/Version.Details.xml +++ b/eng/Version.Details.xml @@ -177,7 +177,7 @@ https://github.com/dotnet/runtime 4822e3c3aa77eb82b2fb33c9321f923cf11ddde6 - + https://github.com/dotnet/runtime 301ba1ee5d1cfff28a8866924733603f3adf4936 @@ -269,7 +269,7 @@ https://github.com/dotnet/runtime 301ba1ee5d1cfff28a8866924733603f3adf4936 - + https://github.com/dotnet/runtime 301ba1ee5d1cfff28a8866924733603f3adf4936 diff --git a/eng/Versions.props b/eng/Versions.props index 39fb8e05250c..5c43c68802dd 100644 --- a/eng/Versions.props +++ b/eng/Versions.props @@ -68,7 +68,7 @@ 6.0.23 6.0.23 6.0.23 - 6.0.23-servicing.23475.15 + 6.0.23-servicing.23479.5 6.0.0 6.0.1 6.0.0 @@ -103,7 +103,7 @@ 6.0.0 6.0.0 6.0.0 - 6.0.23-servicing.23475.15 + 6.0.23-servicing.23479.5 6.0.1 6.0.0 6.0.2 From fc82f0d6e59d13c81fae92f775de1cfbfc1a4000 Mon Sep 17 00:00:00 2001 From: Mackinnon Buck Date: Wed, 6 Sep 2023 10:40:25 -0700 Subject: [PATCH 08/10] Update jquery-validation to v1.19.5 (#50484) --- .../Pages/V4/_ValidationScriptsPartial.cshtml | 4 +- .../Pages/V5/_ValidationScriptsPartial.cshtml | 4 +- src/Identity/UI/src/THIRD-PARTY-NOTICES.txt | 2 +- .../dist/additional-methods.js | 424 +++++- .../dist/additional-methods.min.js | 6 +- .../jquery-validation/dist/jquery.validate.js | 118 +- .../dist/jquery.validate.min.js | 6 +- .../dist/additional-methods.js | 424 +++++- .../dist/additional-methods.min.js | 6 +- .../jquery-validation/dist/jquery.validate.js | 118 +- .../dist/jquery.validate.min.js | 6 +- .../Shared/_ValidationScriptsPartial.cshtml | 2 +- .../Shared/_ValidationScriptsPartial.cshtml | 2 +- .../dist/additional-methods.js | 424 +++++- .../dist/additional-methods.min.js | 6 +- .../jquery-validation/dist/jquery.validate.js | 118 +- .../dist/jquery.validate.min.js | 6 +- src/ProjectTemplates/THIRD-PARTY-NOTICES | 2 +- .../dist/additional-methods.js | 424 +++++- .../dist/additional-methods.min.js | 6 +- .../jquery-validation/dist/jquery.validate.js | 118 +- .../dist/jquery.validate.min.js | 6 +- .../dist/additional-methods.js | 424 +++++- .../dist/additional-methods.min.js | 6 +- .../jquery-validation/dist/jquery.validate.js | 118 +- .../dist/jquery.validate.min.js | 6 +- .../dist/additional-methods.js | 424 +++++- .../dist/additional-methods.min.js | 6 +- .../jquery-validation/dist/jquery.validate.js | 118 +- .../dist/jquery.validate.min.js | 6 +- .../samples/ClaimsTransformation/bower.json | 2 +- .../wwwroot/lib/jquery-validation/.bower.json | 16 +- .../dist/additional-methods.js | 1264 ++++++++++++----- .../dist/additional-methods.min.js | 8 +- .../jquery-validation/dist/jquery.validate.js | 855 +++++++---- .../dist/jquery.validate.min.js | 8 +- .../wwwroot/lib/jquery/.bower.json | 2 +- .../wwwroot/lib/jquery/dist/jquery.min.map | 2 +- src/Security/samples/Cookies/bower.json | 2 +- .../wwwroot/lib/jquery-validation/.bower.json | 16 +- .../dist/additional-methods.js | 1264 ++++++++++++----- .../dist/additional-methods.min.js | 8 +- .../jquery-validation/dist/jquery.validate.js | 855 +++++++---- .../dist/jquery.validate.min.js | 8 +- .../Cookies/wwwroot/lib/jquery/.bower.json | 2 +- .../wwwroot/lib/jquery/dist/jquery.min.map | 2 +- .../wwwroot/lib/jquery-validation/.bower.json | 19 +- .../dist/additional-methods.js | 1264 ++++++++++++----- .../jquery-validation/dist/jquery.validate.js | 855 +++++++---- .../wwwroot/lib/jquery-validation/.bower.json | 19 +- .../dist/additional-methods.js | 1264 ++++++++++++----- .../jquery-validation/dist/jquery.validate.js | 855 +++++++---- .../samples/PathSchemeSelection/bower.json | 2 +- .../wwwroot/lib/jquery-validation/.bower.json | 16 +- .../dist/additional-methods.js | 1264 ++++++++++++----- .../dist/additional-methods.min.js | 8 +- .../jquery-validation/dist/jquery.validate.js | 855 +++++++---- .../dist/jquery.validate.min.js | 8 +- .../wwwroot/lib/jquery/.bower.json | 2 +- .../wwwroot/lib/jquery/dist/jquery.min.map | 2 +- .../wwwroot/lib/jquery-validation/.bower.json | 19 +- .../dist/additional-methods.js | 1264 ++++++++++++----- .../dist/additional-methods.min.js | 8 +- .../jquery-validation/dist/jquery.validate.js | 855 +++++++---- .../dist/jquery.validate.min.js | 8 +- 65 files changed, 11695 insertions(+), 4546 deletions(-) diff --git a/src/Identity/UI/src/Areas/Identity/Pages/V4/_ValidationScriptsPartial.cshtml b/src/Identity/UI/src/Areas/Identity/Pages/V4/_ValidationScriptsPartial.cshtml index 74ca36266548..a67a209cbe94 100644 --- a/src/Identity/UI/src/Areas/Identity/Pages/V4/_ValidationScriptsPartial.cshtml +++ b/src/Identity/UI/src/Areas/Identity/Pages/V4/_ValidationScriptsPartial.cshtml @@ -3,11 +3,11 @@ - - + diff --git a/src/Identity/samples/IdentitySample.Mvc/Views/Shared/_ValidationScriptsPartial.cshtml b/src/Identity/samples/IdentitySample.Mvc/Views/Shared/_ValidationScriptsPartial.cshtml index 6cd4eed86820..da4aebe98a86 100644 --- a/src/Identity/samples/IdentitySample.Mvc/Views/Shared/_ValidationScriptsPartial.cshtml +++ b/src/Identity/samples/IdentitySample.Mvc/Views/Shared/_ValidationScriptsPartial.cshtml @@ -1,2 +1,2 @@ - + diff --git a/src/Identity/testassets/Identity.DefaultUI.WebSite/wwwroot/lib/jquery-validation/dist/additional-methods.js b/src/Identity/testassets/Identity.DefaultUI.WebSite/wwwroot/lib/jquery-validation/dist/additional-methods.js index e129bc0f74b9..c6a7229185ab 100644 --- a/src/Identity/testassets/Identity.DefaultUI.WebSite/wwwroot/lib/jquery-validation/dist/additional-methods.js +++ b/src/Identity/testassets/Identity.DefaultUI.WebSite/wwwroot/lib/jquery-validation/dist/additional-methods.js @@ -1,9 +1,9 @@ /*! - * jQuery Validation Plugin v1.17.0 + * jQuery Validation Plugin v1.19.5 * * https://jqueryvalidation.org/ * - * Copyright (c) 2017 Jörn Zaefferer + * Copyright (c) 2022 Jörn Zaefferer * Released under the MIT license */ (function( factory ) { @@ -43,6 +43,38 @@ }() ); +/** + * This is used in the United States to process payments, deposits, + * or transfers using the Automated Clearing House (ACH) or Fedwire + * systems. A very common use case would be to validate a form for + * an ACH bill payment. + */ +$.validator.addMethod( "abaRoutingNumber", function( value ) { + var checksum = 0; + var tokens = value.split( "" ); + var length = tokens.length; + + // Length Check + if ( length !== 9 ) { + return false; + } + + // Calc the checksum + // https://en.wikipedia.org/wiki/ABA_routing_transit_number + for ( var i = 0; i < length; i += 3 ) { + checksum += parseInt( tokens[ i ], 10 ) * 3 + + parseInt( tokens[ i + 1 ], 10 ) * 7 + + parseInt( tokens[ i + 2 ], 10 ); + } + + // If not zero and divisible by 10 then valid + if ( checksum !== 0 && checksum % 10 === 0 ) { + return true; + } + + return false; +}, "Please enter a valid routing number." ); + // Accept a value from a file input based on a required mimetype $.validator.addMethod( "accept", function( value, element, param ) { @@ -87,7 +119,7 @@ $.validator.addMethod( "accept", function( value, element, param ) { $.validator.addMethod( "alphanumeric", function( value, element ) { return this.optional( element ) || /^\w+$/i.test( value ); -}, "Letters, numbers, and underscores only please" ); +}, "Letters, numbers, and underscores only please." ); /* * Dutch bank account numbers (not 'giro' numbers) have 9 digits @@ -114,13 +146,13 @@ $.validator.addMethod( "bankaccountNL", function( value, element ) { sum = sum + factor * digit; } return sum % 11 === 0; -}, "Please specify a valid bank account number" ); +}, "Please specify a valid bank account number." ); $.validator.addMethod( "bankorgiroaccountNL", function( value, element ) { return this.optional( element ) || ( $.validator.methods.bankaccountNL.call( this, value, element ) ) || ( $.validator.methods.giroaccountNL.call( this, value, element ) ); -}, "Please specify a valid bank or giro account number" ); +}, "Please specify a valid bank or giro account number." ); /** * BIC is the business identifier code (ISO 9362). This BIC check is not a guarantee for authenticity. @@ -139,7 +171,7 @@ $.validator.addMethod( "bankorgiroaccountNL", function( value, element ) { */ $.validator.addMethod( "bic", function( value, element ) { return this.optional( element ) || /^([A-Z]{6}[A-Z2-9][A-NP-Z1-9])(X{3}|[A-WY-Z0-9][A-Z0-9]{2})?$/.test( value.toUpperCase() ); -}, "Please specify a valid BIC code" ); +}, "Please specify a valid BIC code." ); /* * Código de identificación fiscal ( CIF ) is the tax identification code for Spanish legal entities @@ -256,11 +288,141 @@ $.validator.addMethod( "cifES", function( value, element ) { }, "Please specify a valid CIF number." ); +/* + * Brazillian CNH number (Carteira Nacional de Habilitacao) is the License Driver number. + * CNH numbers have 11 digits in total: 9 numbers followed by 2 check numbers that are being used for validation. + */ +$.validator.addMethod( "cnhBR", function( value ) { + + // Removing special characters from value + value = value.replace( /([~!@#$%^&*()_+=`{}\[\]\-|\\:;'<>,.\/? ])+/g, "" ); + + // Checking value to have 11 digits only + if ( value.length !== 11 ) { + return false; + } + + var sum = 0, dsc = 0, firstChar, + firstCN, secondCN, i, j, v; + + firstChar = value.charAt( 0 ); + + if ( new Array( 12 ).join( firstChar ) === value ) { + return false; + } + + // Step 1 - using first Check Number: + for ( i = 0, j = 9, v = 0; i < 9; ++i, --j ) { + sum += +( value.charAt( i ) * j ); + } + + firstCN = sum % 11; + if ( firstCN >= 10 ) { + firstCN = 0; + dsc = 2; + } + + sum = 0; + for ( i = 0, j = 1, v = 0; i < 9; ++i, ++j ) { + sum += +( value.charAt( i ) * j ); + } + + secondCN = sum % 11; + if ( secondCN >= 10 ) { + secondCN = 0; + } else { + secondCN = secondCN - dsc; + } + + return ( String( firstCN ).concat( secondCN ) === value.substr( -2 ) ); + +}, "Please specify a valid CNH number." ); + +/* + * Brazillian value number (Cadastrado de Pessoas Juridica). + * value numbers have 14 digits in total: 12 numbers followed by 2 check numbers that are being used for validation. + */ +$.validator.addMethod( "cnpjBR", function( value, element ) { + "use strict"; + + if ( this.optional( element ) ) { + return true; + } + + // Removing no number + value = value.replace( /[^\d]+/g, "" ); + + // Checking value to have 14 digits only + if ( value.length !== 14 ) { + return false; + } + + // Elimina values invalidos conhecidos + if ( value === "00000000000000" || + value === "11111111111111" || + value === "22222222222222" || + value === "33333333333333" || + value === "44444444444444" || + value === "55555555555555" || + value === "66666666666666" || + value === "77777777777777" || + value === "88888888888888" || + value === "99999999999999" ) { + return false; + } + + // Valida DVs + var tamanho = ( value.length - 2 ); + var numeros = value.substring( 0, tamanho ); + var digitos = value.substring( tamanho ); + var soma = 0; + var pos = tamanho - 7; + + for ( var i = tamanho; i >= 1; i-- ) { + soma += numeros.charAt( tamanho - i ) * pos--; + if ( pos < 2 ) { + pos = 9; + } + } + + var resultado = soma % 11 < 2 ? 0 : 11 - soma % 11; + + if ( resultado !== parseInt( digitos.charAt( 0 ), 10 ) ) { + return false; + } + + tamanho = tamanho + 1; + numeros = value.substring( 0, tamanho ); + soma = 0; + pos = tamanho - 7; + + for ( var il = tamanho; il >= 1; il-- ) { + soma += numeros.charAt( tamanho - il ) * pos--; + if ( pos < 2 ) { + pos = 9; + } + } + + resultado = soma % 11 < 2 ? 0 : 11 - soma % 11; + + if ( resultado !== parseInt( digitos.charAt( 1 ), 10 ) ) { + return false; + } + + return true; + +}, "Please specify a CNPJ value number." ); + /* * Brazillian CPF number (Cadastrado de Pessoas Físicas) is the equivalent of a Brazilian tax registration number. * CPF numbers have 11 digits in total: 9 numbers followed by 2 check numbers that are being used for validation. */ -$.validator.addMethod( "cpfBR", function( value ) { +$.validator.addMethod( "cpfBR", function( value, element ) { + "use strict"; + + if ( this.optional( element ) ) { + return true; + } // Removing special characters from value value = value.replace( /([~!@#$%^&*()_+=`{}\[\]\-|\\:;'<>,.\/? ])+/g, "" ); @@ -315,7 +477,7 @@ $.validator.addMethod( "cpfBR", function( value ) { } return false; -}, "Please specify a valid CPF number" ); +}, "Please specify a valid CPF number." ); // https://jqueryvalidation.org/creditcard-method/ // based on https://en.wikipedia.org/wiki/Luhn_algorithm @@ -337,7 +499,7 @@ $.validator.addMethod( "creditcard", function( value, element ) { value = value.replace( /\D/g, "" ); // Basing min and max length on - // https://developer.ean.com/general_info/Valid_Credit_Card_Types + // https://dev.ean.com/general-info/valid-card-types/ if ( value.length < 13 || value.length > 19 ) { return false; } @@ -359,7 +521,7 @@ $.validator.addMethod( "creditcard", function( value, element ) { }, "Please enter a valid credit card number." ); /* NOTICE: Modified version of Castle.Components.Validator.CreditCardValidator - * Redistributed under the the Apache License 2.0 at http://www.apache.org/licenses/LICENSE-2.0 + * Redistributed under the Apache License 2.0 at http://www.apache.org/licenses/LICENSE-2.0 * Valid Types: mastercard, visa, amex, dinersclub, enroute, discover, jcb, unknown, all (overrides all other settings) */ $.validator.addMethod( "creditcardtypes", function( value, element, param ) { @@ -398,7 +560,7 @@ $.validator.addMethod( "creditcardtypes", function( value, element, param ) { if ( param.all ) { validTypes = 0x0001 | 0x0002 | 0x0004 | 0x0008 | 0x0010 | 0x0020 | 0x0040 | 0x0080; } - if ( validTypes & 0x0001 && /^(5[12345])/.test( value ) ) { // Mastercard + if ( validTypes & 0x0001 && ( /^(5[12345])/.test( value ) || /^(2[234567])/.test( value ) ) ) { // Mastercard return value.length === 16; } if ( validTypes & 0x0002 && /^(4)/.test( value ) ) { // Visa @@ -468,7 +630,7 @@ $.validator.addMethod( "currency", function( value, element, param ) { regex = new RegExp( regex ); return this.optional( element ) || regex.test( value ); -}, "Please specify a valid currency" ); +}, "Please specify a valid currency." ); $.validator.addMethod( "dateFA", function( value, element ) { return this.optional( element ) || /^[1-4]\d{3}\/((0?[1-6]\/((3[0-1])|([1-2][0-9])|(0?[1-9])))|((1[0-2]|(0?[7-9]))\/(30|([1-2][0-9])|(0?[1-9]))))$/.test( value ); @@ -529,7 +691,31 @@ $.validator.addMethod( "extension", function( value, element, param ) { */ $.validator.addMethod( "giroaccountNL", function( value, element ) { return this.optional( element ) || /^[0-9]{1,7}$/.test( value ); -}, "Please specify a valid giro account number" ); +}, "Please specify a valid giro account number." ); + +$.validator.addMethod( "greaterThan", function( value, element, param ) { + var target = $( param ); + + if ( this.settings.onfocusout && target.not( ".validate-greaterThan-blur" ).length ) { + target.addClass( "validate-greaterThan-blur" ).on( "blur.validate-greaterThan", function() { + $( element ).valid(); + } ); + } + + return value > target.val(); +}, "Please enter a greater value." ); + +$.validator.addMethod( "greaterThanEqual", function( value, element, param ) { + var target = $( param ); + + if ( this.settings.onfocusout && target.not( ".validate-greaterThanEqual-blur" ).length ) { + target.addClass( "validate-greaterThanEqual-blur" ).on( "blur.validate-greaterThanEqual", function() { + $( element ).valid(); + } ); + } + + return value >= target.val(); +}, "Please enter a greater value." ); /** * IBAN is the international bank account number. @@ -666,11 +852,11 @@ $.validator.addMethod( "iban", function( value, element ) { cRest = cOperator % 97; } return cRest === 1; -}, "Please specify a valid IBAN" ); +}, "Please specify a valid IBAN." ); $.validator.addMethod( "integer", function( value, element ) { return this.optional( element ) || /^-?\d+$/.test( value ); -}, "A positive or negative non-decimal number please" ); +}, "A positive or negative non-decimal number please." ); $.validator.addMethod( "ipv4", function( value, element ) { return this.optional( element ) || /^(25[0-5]|2[0-4]\d|[01]?\d\d?)\.(25[0-5]|2[0-4]\d|[01]?\d\d?)\.(25[0-5]|2[0-4]\d|[01]?\d\d?)\.(25[0-5]|2[0-4]\d|[01]?\d\d?)$/i.test( value ); @@ -680,17 +866,103 @@ $.validator.addMethod( "ipv6", function( value, element ) { return this.optional( element ) || /^((([0-9A-Fa-f]{1,4}:){7}[0-9A-Fa-f]{1,4})|(([0-9A-Fa-f]{1,4}:){6}:[0-9A-Fa-f]{1,4})|(([0-9A-Fa-f]{1,4}:){5}:([0-9A-Fa-f]{1,4}:)?[0-9A-Fa-f]{1,4})|(([0-9A-Fa-f]{1,4}:){4}:([0-9A-Fa-f]{1,4}:){0,2}[0-9A-Fa-f]{1,4})|(([0-9A-Fa-f]{1,4}:){3}:([0-9A-Fa-f]{1,4}:){0,3}[0-9A-Fa-f]{1,4})|(([0-9A-Fa-f]{1,4}:){2}:([0-9A-Fa-f]{1,4}:){0,4}[0-9A-Fa-f]{1,4})|(([0-9A-Fa-f]{1,4}:){6}((\b((25[0-5])|(1\d{2})|(2[0-4]\d)|(\d{1,2}))\b)\.){3}(\b((25[0-5])|(1\d{2})|(2[0-4]\d)|(\d{1,2}))\b))|(([0-9A-Fa-f]{1,4}:){0,5}:((\b((25[0-5])|(1\d{2})|(2[0-4]\d)|(\d{1,2}))\b)\.){3}(\b((25[0-5])|(1\d{2})|(2[0-4]\d)|(\d{1,2}))\b))|(::([0-9A-Fa-f]{1,4}:){0,5}((\b((25[0-5])|(1\d{2})|(2[0-4]\d)|(\d{1,2}))\b)\.){3}(\b((25[0-5])|(1\d{2})|(2[0-4]\d)|(\d{1,2}))\b))|([0-9A-Fa-f]{1,4}::([0-9A-Fa-f]{1,4}:){0,5}[0-9A-Fa-f]{1,4})|(::([0-9A-Fa-f]{1,4}:){0,6}[0-9A-Fa-f]{1,4})|(([0-9A-Fa-f]{1,4}:){1,7}:))$/i.test( value ); }, "Please enter a valid IP v6 address." ); +$.validator.addMethod( "lessThan", function( value, element, param ) { + var target = $( param ); + + if ( this.settings.onfocusout && target.not( ".validate-lessThan-blur" ).length ) { + target.addClass( "validate-lessThan-blur" ).on( "blur.validate-lessThan", function() { + $( element ).valid(); + } ); + } + + return value < target.val(); +}, "Please enter a lesser value." ); + +$.validator.addMethod( "lessThanEqual", function( value, element, param ) { + var target = $( param ); + + if ( this.settings.onfocusout && target.not( ".validate-lessThanEqual-blur" ).length ) { + target.addClass( "validate-lessThanEqual-blur" ).on( "blur.validate-lessThanEqual", function() { + $( element ).valid(); + } ); + } + + return value <= target.val(); +}, "Please enter a lesser value." ); + $.validator.addMethod( "lettersonly", function( value, element ) { return this.optional( element ) || /^[a-z]+$/i.test( value ); -}, "Letters only please" ); +}, "Letters only please." ); $.validator.addMethod( "letterswithbasicpunc", function( value, element ) { return this.optional( element ) || /^[a-z\-.,()'"\s]+$/i.test( value ); -}, "Letters or punctuation only please" ); +}, "Letters or punctuation only please." ); + +// Limit the number of files in a FileList. +$.validator.addMethod( "maxfiles", function( value, element, param ) { + if ( this.optional( element ) ) { + return true; + } + + if ( $( element ).attr( "type" ) === "file" ) { + if ( element.files && element.files.length > param ) { + return false; + } + } + + return true; +}, $.validator.format( "Please select no more than {0} files." ) ); + +// Limit the size of each individual file in a FileList. +$.validator.addMethod( "maxsize", function( value, element, param ) { + if ( this.optional( element ) ) { + return true; + } + + if ( $( element ).attr( "type" ) === "file" ) { + if ( element.files && element.files.length ) { + for ( var i = 0; i < element.files.length; i++ ) { + if ( element.files[ i ].size > param ) { + return false; + } + } + } + } + + return true; +}, $.validator.format( "File size must not exceed {0} bytes each." ) ); + +// Limit the size of all files in a FileList. +$.validator.addMethod( "maxsizetotal", function( value, element, param ) { + if ( this.optional( element ) ) { + return true; + } + + if ( $( element ).attr( "type" ) === "file" ) { + if ( element.files && element.files.length ) { + var totalSize = 0; + + for ( var i = 0; i < element.files.length; i++ ) { + totalSize += element.files[ i ].size; + if ( totalSize > param ) { + return false; + } + } + } + } + + return true; +}, $.validator.format( "Total size of all files must not exceed {0} bytes." ) ); + $.validator.addMethod( "mobileNL", function( value, element ) { return this.optional( element ) || /^((\+|00(\s|\s?\-\s?)?)31(\s|\s?\-\s?)?(\(0\)[\-\s]?)?|0)6((\s|\s?\-\s?)?[0-9]){8}$/.test( value ); -}, "Please specify a valid mobile number" ); +}, "Please specify a valid mobile number." ); + +$.validator.addMethod( "mobileRU", function( phone_number, element ) { + var ruPhone_number = phone_number.replace( /\(|\)|\s+|-/g, "" ); + return this.optional( element ) || ruPhone_number.length > 9 && /^((\+7|7|8)+([0-9]){10})$/.test( ruPhone_number ); +}, "Please specify a valid mobile number." ); /* For UK phone functions, do the following server side processing: * Compare original input with this RegEx pattern: @@ -704,7 +976,7 @@ $.validator.addMethod( "mobileUK", function( phone_number, element ) { phone_number = phone_number.replace( /\(|\)|\s+|-/g, "" ); return this.optional( element ) || phone_number.length > 9 && phone_number.match( /^(?:(?:(?:00\s?|\+)44\s?|0)7(?:[1345789]\d{2}|624)\s?\d{3}\s?\d{3})$/ ); -}, "Please specify a valid mobile number" ); +}, "Please specify a valid mobile number." ); $.validator.addMethod( "netmask", function( value, element ) { return this.optional( element ) || /^(254|252|248|240|224|192|128)\.0\.0\.0|255\.(254|252|248|240|224|192|128|0)\.0\.0|255\.255\.(254|252|248|240|224|192|128|0)\.0|255\.255\.255\.(254|252|248|240|224|192|128|0)/i.test( value ); @@ -804,13 +1076,71 @@ $.validator.addMethod( "nipPL", function( value ) { return ( intControlNr === parseInt( value[ 9 ], 10 ) ); }, "Please specify a valid NIP number." ); +/** + * Created for project jquery-validation. + * @Description Brazillian PIS or NIS number (Número de Identificação Social Pis ou Pasep) is the equivalent of a + * Brazilian tax registration number NIS of PIS numbers have 11 digits in total: 10 numbers followed by 1 check numbers + * that are being used for validation. + * @copyright (c) 21/08/2018 13:14, Cleiton da Silva Mendonça + * @author Cleiton da Silva Mendonça + * @link http://gitlab.com/csmendonca Gitlab of Cleiton da Silva Mendonça + * @link http://github.com/csmendonca Github of Cleiton da Silva Mendonça + */ +$.validator.addMethod( "nisBR", function( value ) { + var number; + var cn; + var sum = 0; + var dv; + var count; + var multiplier; + + // Removing special characters from value + value = value.replace( /([~!@#$%^&*()_+=`{}\[\]\-|\\:;'<>,.\/? ])+/g, "" ); + + // Checking value to have 11 digits only + if ( value.length !== 11 ) { + return false; + } + + //Get check number of value + cn = parseInt( value.substring( 10, 11 ), 10 ); + + //Get number with 10 digits of the value + number = parseInt( value.substring( 0, 10 ), 10 ); + + for ( count = 2; count < 12; count++ ) { + multiplier = count; + if ( count === 10 ) { + multiplier = 2; + } + if ( count === 11 ) { + multiplier = 3; + } + sum += ( ( number % 10 ) * multiplier ); + number = parseInt( number / 10, 10 ); + } + dv = ( sum % 11 ); + + if ( dv > 1 ) { + dv = ( 11 - dv ); + } else { + dv = 0; + } + + if ( cn === dv ) { + return true; + } else { + return false; + } +}, "Please specify a valid NIS/PIS number." ); + $.validator.addMethod( "notEqualTo", function( value, element, param ) { return this.optional( element ) || !$.validator.methods.equalTo.call( this, value, element, param ); }, "Please enter a different value, values must not be the same." ); $.validator.addMethod( "nowhitespace", function( value, element ) { return this.optional( element ) || /^\S+$/i.test( value ); -}, "No white space please" ); +}, "No white space please." ); /** * Return true if the field value matches the given format RegExp @@ -842,6 +1172,30 @@ $.validator.addMethod( "phoneNL", function( value, element ) { return this.optional( element ) || /^((\+|00(\s|\s?\-\s?)?)31(\s|\s?\-\s?)?(\(0\)[\-\s]?)?|0)[1-9]((\s|\s?\-\s?)?[0-9]){8}$/.test( value ); }, "Please specify a valid phone number." ); +/** + * Polish telephone numbers have 9 digits. + * + * Mobile phone numbers starts with following digits: + * 45, 50, 51, 53, 57, 60, 66, 69, 72, 73, 78, 79, 88. + * + * Fixed-line numbers starts with area codes: + * 12, 13, 14, 15, 16, 17, 18, 22, 23, 24, 25, 29, 32, 33, + * 34, 41, 42, 43, 44, 46, 48, 52, 54, 55, 56, 58, 59, 61, + * 62, 63, 65, 67, 68, 71, 74, 75, 76, 77, 81, 82, 83, 84, + * 85, 86, 87, 89, 91, 94, 95. + * + * Ministry of National Defence numbers and VoIP numbers starts with 26 and 39. + * + * Excludes intelligent networks (premium rate, shared cost, free phone numbers). + * + * Poland National Numbering Plan http://www.itu.int/oth/T02020000A8/en + */ +$.validator.addMethod( "phonePL", function( phone_number, element ) { + phone_number = phone_number.replace( /\s+/g, "" ); + var regexp = /^(?:(?:(?:\+|00)?48)|(?:\(\+?48\)))?(?:1[2-8]|2[2-69]|3[2-49]|4[1-68]|5[0-9]|6[0-35-9]|[7-8][1-9]|9[145])\d{7}$/; + return this.optional( element ) || regexp.test( phone_number ); +}, "Please specify a valid phone number." ); + /* For UK phone functions, do the following server side processing: * Compare original input with this RegEx pattern: * ^\(?(?:(?:00\)?[\s\-]?\(?|\+)(44)\)?[\s\-]?\(?(?:0\)?[\s\-]?\(?)?|0)([1-9]\d{1,4}\)?[\s\d\-]+)$ @@ -856,7 +1210,7 @@ $.validator.addMethod( "phonesUK", function( phone_number, element ) { phone_number = phone_number.replace( /\(|\)|\s+|-/g, "" ); return this.optional( element ) || phone_number.length > 9 && phone_number.match( /^(?:(?:(?:00\s?|\+)44\s?|0)(?:1\d{8,9}|[23]\d{9}|7(?:[1345789]\d{8}|624\d{6})))$/ ); -}, "Please specify a valid uk phone number" ); +}, "Please specify a valid uk phone number." ); /* For UK phone functions, do the following server side processing: * Compare original input with this RegEx pattern: @@ -870,7 +1224,7 @@ $.validator.addMethod( "phoneUK", function( phone_number, element ) { phone_number = phone_number.replace( /\(|\)|\s+|-/g, "" ); return this.optional( element ) || phone_number.length > 9 && phone_number.match( /^(?:(?:(?:00\s?|\+)44\s?)|(?:\(?0))(?:\d{2}\)?\s?\d{4}\s?\d{4}|\d{3}\)?\s?\d{3}\s?\d{3,4}|\d{4}\)?\s?(?:\d{5}|\d{3}\s?\d{3})|\d{5}\)?\s?\d{4,5})$/ ); -}, "Please specify a valid phone number" ); +}, "Please specify a valid phone number." ); /** * Matches US phone number format @@ -891,8 +1245,8 @@ $.validator.addMethod( "phoneUK", function( phone_number, element ) { $.validator.addMethod( "phoneUS", function( phone_number, element ) { phone_number = phone_number.replace( /\s+/g, "" ); return this.optional( element ) || phone_number.length > 9 && - phone_number.match( /^(\+?1-?)?(\([2-9]([02-9]\d|1[02-9])\)|[2-9]([02-9]\d|1[02-9]))-?[2-9]([02-9]\d|1[02-9])-?\d{4}$/ ); -}, "Please specify a valid phone number" ); + phone_number.match( /^(\+?1-?)?(\([2-9]([02-9]\d|1[02-9])\)|[2-9]([02-9]\d|1[02-9]))-?[2-9]\d{2}-?\d{4}$/ ); +}, "Please specify a valid phone number." ); /* * Valida CEPs do brasileiros: @@ -921,21 +1275,21 @@ $.validator.addMethod( "postalcodeBR", function( cep_value, element ) { */ $.validator.addMethod( "postalCodeCA", function( value, element ) { return this.optional( element ) || /^[ABCEGHJKLMNPRSTVXY]\d[ABCEGHJKLMNPRSTVWXYZ] *\d[ABCEGHJKLMNPRSTVWXYZ]\d$/i.test( value ); -}, "Please specify a valid postal code" ); +}, "Please specify a valid postal code." ); /* Matches Italian postcode (CAP) */ $.validator.addMethod( "postalcodeIT", function( value, element ) { return this.optional( element ) || /^\d{5}$/.test( value ); -}, "Please specify a valid postal code" ); +}, "Please specify a valid postal code." ); $.validator.addMethod( "postalcodeNL", function( value, element ) { return this.optional( element ) || /^[1-9][0-9]{3}\s?[a-zA-Z]{2}$/.test( value ); -}, "Please specify a valid postal code" ); +}, "Please specify a valid postal code." ); // Matches UK postcode. Does not match to UK Channel Islands that have their own postcodes (non standard UK) $.validator.addMethod( "postcodeUK", function( value, element ) { return this.optional( element ) || /^((([A-PR-UWYZ][0-9])|([A-PR-UWYZ][0-9][0-9])|([A-PR-UWYZ][A-HK-Y][0-9])|([A-PR-UWYZ][A-HK-Y][0-9][0-9])|([A-PR-UWYZ][0-9][A-HJKSTUW])|([A-PR-UWYZ][A-HK-Y][0-9][ABEHMNPRVWXY]))\s?([0-9][ABD-HJLNP-UW-Z]{2})|(GIR)\s?(0AA))$/i.test( value ); -}, "Please specify a valid UK postcode" ); +}, "Please specify a valid UK postcode." ); /* * Lets you say "at least X inputs that match selector Y must be filled." @@ -1072,24 +1426,24 @@ $.validator.addMethod( "stateUS", function( value, element, options ) { regex = caseSensitive ? new RegExp( regex ) : new RegExp( regex, "i" ); return this.optional( element ) || regex.test( value ); -}, "Please specify a valid state" ); +}, "Please specify a valid state." ); // TODO check if value starts with <, otherwise don't try stripping anything $.validator.addMethod( "strippedminlength", function( value, element, param ) { return $( value ).text().length >= param; -}, $.validator.format( "Please enter at least {0} characters" ) ); +}, $.validator.format( "Please enter at least {0} characters." ) ); $.validator.addMethod( "time", function( value, element ) { return this.optional( element ) || /^([01]\d|2[0-3]|[0-9])(:[0-5]\d){1,2}$/.test( value ); -}, "Please enter a valid time, between 00:00 and 23:59" ); +}, "Please enter a valid time, between 00:00 and 23:59." ); $.validator.addMethod( "time12h", function( value, element ) { return this.optional( element ) || /^((0?[1-9]|1[012])(:[0-5]\d){1,2}(\ ?[AP]M))$/i.test( value ); -}, "Please enter a valid time in 12-hour am/pm format" ); +}, "Please enter a valid time in 12-hour am/pm format." ); // Same as url, but TLD is optional $.validator.addMethod( "url2", function( value, element ) { - return this.optional( element ) || /^(https?|ftp):\/\/(((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:)*@)?(((\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5]))|((([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.)*(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.?)(:\d*)?)(\/((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)+(\/(([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)*)*)?)?(\?((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|[\uE000-\uF8FF]|\/|\?)*)?(#((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|\/|\?)*)?$/i.test( value ); + return this.optional( element ) || /^(?:(?:(?:https?|ftp):)?\/\/)(?:(?:[^\]\[?\/<~#`!@$^&*()+=}|:";',>{ ]|%[0-9A-Fa-f]{2})+(?::(?:[^\]\[?\/<~#`!@$^&*()+=}|:";',>{ ]|%[0-9A-Fa-f]{2})*)?@)?(?:(?!(?:10|127)(?:\.\d{1,3}){3})(?!(?:169\.254|192\.168)(?:\.\d{1,3}){2})(?!172\.(?:1[6-9]|2\d|3[0-1])(?:\.\d{1,3}){2})(?:[1-9]\d?|1\d\d|2[01]\d|22[0-3])(?:\.(?:1?\d{1,2}|2[0-4]\d|25[0-5])){2}(?:\.(?:[1-9]\d?|1\d\d|2[0-4]\d|25[0-4]))|(?:(?:[a-z0-9\u00a1-\uffff][a-z0-9\u00a1-\uffff_-]{0,62})?[a-z0-9\u00a1-\uffff]\.)+(?:[a-z\u00a1-\uffff]{2,}\.?)|(?:(?:[a-z0-9\u00a1-\uffff][a-z0-9\u00a1-\uffff_-]{0,62})?[a-z0-9\u00a1-\uffff])|(?:(?:[a-z0-9\u00a1-\uffff][a-z0-9\u00a1-\uffff_-]{0,62}\.)))(?::\d{2,5})?(?:[/?#]\S*)?$/i.test( value ); }, $.validator.messages.url ); /** @@ -1149,10 +1503,10 @@ $.validator.addMethod( "vinUS", function( v ) { $.validator.addMethod( "zipcodeUS", function( value, element ) { return this.optional( element ) || /^\d{5}(-\d{4})?$/.test( value ); -}, "The specified US ZIP Code is invalid" ); +}, "The specified US ZIP Code is invalid." ); $.validator.addMethod( "ziprange", function( value, element ) { return this.optional( element ) || /^90[2-5]\d\{2\}-\d{4}$/.test( value ); -}, "Your ZIP-code must be in the range 902xx-xxxx to 905xx-xxxx" ); +}, "Your ZIP-code must be in the range 902xx-xxxx to 905xx-xxxx." ); return $; })); \ No newline at end of file diff --git a/src/Identity/testassets/Identity.DefaultUI.WebSite/wwwroot/lib/jquery-validation/dist/additional-methods.min.js b/src/Identity/testassets/Identity.DefaultUI.WebSite/wwwroot/lib/jquery-validation/dist/additional-methods.min.js index 6767f24f6b12..80f14b58c2e1 100644 --- a/src/Identity/testassets/Identity.DefaultUI.WebSite/wwwroot/lib/jquery-validation/dist/additional-methods.min.js +++ b/src/Identity/testassets/Identity.DefaultUI.WebSite/wwwroot/lib/jquery-validation/dist/additional-methods.min.js @@ -1,4 +1,4 @@ -/*! jQuery Validation Plugin - v1.17.0 - 7/29/2017 +/*! jQuery Validation Plugin - v1.19.5 - 7/1/2022 * https://jqueryvalidation.org/ - * Copyright (c) 2017 Jörn Zaefferer; Licensed MIT */ -!function(a){"function"==typeof define&&define.amd?define(["jquery","./jquery.validate.min"],a):"object"==typeof module&&module.exports?module.exports=a(require("jquery")):a(jQuery)}(function(a){return function(){function b(a){return a.replace(/<.[^<>]*?>/g," ").replace(/ | /gi," ").replace(/[.(),;:!?%#$'\"_+=\/\-“”’]*/g,"")}a.validator.addMethod("maxWords",function(a,c,d){return this.optional(c)||b(a).match(/\b\w+\b/g).length<=d},a.validator.format("Please enter {0} words or less.")),a.validator.addMethod("minWords",function(a,c,d){return this.optional(c)||b(a).match(/\b\w+\b/g).length>=d},a.validator.format("Please enter at least {0} words.")),a.validator.addMethod("rangeWords",function(a,c,d){var e=b(a),f=/\b\w+\b/g;return this.optional(c)||e.match(f).length>=d[0]&&e.match(f).length<=d[1]},a.validator.format("Please enter between {0} and {1} words."))}(),a.validator.addMethod("accept",function(b,c,d){var e,f,g,h="string"==typeof d?d.replace(/\s/g,""):"image/*",i=this.optional(c);if(i)return i;if("file"===a(c).attr("type")&&(h=h.replace(/[\-\[\]\/\{\}\(\)\+\?\.\\\^\$\|]/g,"\\$&").replace(/,/g,"|").replace(/\/\*/g,"/.*"),c.files&&c.files.length))for(g=new RegExp(".?("+h+")$","i"),e=0;e9?"0":f,g="JABCDEFGHI".substr(f,1).toString(),i.match(/[ABEH]/)?k===f:i.match(/[KPQS]/)?k===g:k===f||k===g},"Please specify a valid CIF number."),a.validator.addMethod("cpfBR",function(a){if(a=a.replace(/([~!@#$%^&*()_+=`{}\[\]\-|\\:;'<>,.\/? ])+/g,""),11!==a.length)return!1;var b,c,d,e,f=0;if(b=parseInt(a.substring(9,10),10),c=parseInt(a.substring(10,11),10),d=function(a,b){var c=10*a%11;return 10!==c&&11!==c||(c=0),c===b},""===a||"00000000000"===a||"11111111111"===a||"22222222222"===a||"33333333333"===a||"44444444444"===a||"55555555555"===a||"66666666666"===a||"77777777777"===a||"88888888888"===a||"99999999999"===a)return!1;for(e=1;e<=9;e++)f+=parseInt(a.substring(e-1,e),10)*(11-e);if(d(f,b)){for(f=0,e=1;e<=10;e++)f+=parseInt(a.substring(e-1,e),10)*(12-e);return d(f,c)}return!1},"Please specify a valid CPF number"),a.validator.addMethod("creditcard",function(a,b){if(this.optional(b))return"dependency-mismatch";if(/[^0-9 \-]+/.test(a))return!1;var c,d,e=0,f=0,g=!1;if(a=a.replace(/\D/g,""),a.length<13||a.length>19)return!1;for(c=a.length-1;c>=0;c--)d=a.charAt(c),f=parseInt(d,10),g&&(f*=2)>9&&(f-=9),e+=f,g=!g;return e%10===0},"Please enter a valid credit card number."),a.validator.addMethod("creditcardtypes",function(a,b,c){if(/[^0-9\-]+/.test(a))return!1;a=a.replace(/\D/g,"");var d=0;return c.mastercard&&(d|=1),c.visa&&(d|=2),c.amex&&(d|=4),c.dinersclub&&(d|=8),c.enroute&&(d|=16),c.discover&&(d|=32),c.jcb&&(d|=64),c.unknown&&(d|=128),c.all&&(d=255),1&d&&/^(5[12345])/.test(a)?16===a.length:2&d&&/^(4)/.test(a)?16===a.length:4&d&&/^(3[47])/.test(a)?15===a.length:8&d&&/^(3(0[012345]|[68]))/.test(a)?14===a.length:16&d&&/^(2(014|149))/.test(a)?15===a.length:32&d&&/^(6011)/.test(a)?16===a.length:64&d&&/^(3)/.test(a)?16===a.length:64&d&&/^(2131|1800)/.test(a)?15===a.length:!!(128&d)},"Please enter a valid credit card number."),a.validator.addMethod("currency",function(a,b,c){var d,e="string"==typeof c,f=e?c:c[0],g=!!e||c[1];return f=f.replace(/,/g,""),f=g?f+"]":f+"]?",d="^["+f+"([1-9]{1}[0-9]{0,2}(\\,[0-9]{3})*(\\.[0-9]{0,2})?|[1-9]{1}[0-9]{0,}(\\.[0-9]{0,2})?|0(\\.[0-9]{0,2})?|(\\.[0-9]{1,2})?)$",d=new RegExp(d),this.optional(b)||d.test(a)},"Please specify a valid currency"),a.validator.addMethod("dateFA",function(a,b){return this.optional(b)||/^[1-4]\d{3}\/((0?[1-6]\/((3[0-1])|([1-2][0-9])|(0?[1-9])))|((1[0-2]|(0?[7-9]))\/(30|([1-2][0-9])|(0?[1-9]))))$/.test(a)},a.validator.messages.date),a.validator.addMethod("dateITA",function(a,b){var c,d,e,f,g,h=!1,i=/^\d{1,2}\/\d{1,2}\/\d{4}$/;return i.test(a)?(c=a.split("/"),d=parseInt(c[0],10),e=parseInt(c[1],10),f=parseInt(c[2],10),g=new Date(Date.UTC(f,e-1,d,12,0,0,0)),h=g.getUTCFullYear()===f&&g.getUTCMonth()===e-1&&g.getUTCDate()===d):h=!1,this.optional(b)||h},a.validator.messages.date),a.validator.addMethod("dateNL",function(a,b){return this.optional(b)||/^(0?[1-9]|[12]\d|3[01])[\.\/\-](0?[1-9]|1[012])[\.\/\-]([12]\d)?(\d\d)$/.test(a)},a.validator.messages.date),a.validator.addMethod("extension",function(a,b,c){return c="string"==typeof c?c.replace(/,/g,"|"):"png|jpe?g|gif",this.optional(b)||a.match(new RegExp("\\.("+c+")$","i"))},a.validator.format("Please enter a value with a valid extension.")),a.validator.addMethod("giroaccountNL",function(a,b){return this.optional(b)||/^[0-9]{1,7}$/.test(a)},"Please specify a valid giro account number"),a.validator.addMethod("iban",function(a,b){if(this.optional(b))return!0;var c,d,e,f,g,h,i,j,k,l=a.replace(/ /g,"").toUpperCase(),m="",n=!0,o="",p="",q=5;if(l.length9&&a.match(/^(?:(?:(?:00\s?|\+)44\s?|0)7(?:[1345789]\d{2}|624)\s?\d{3}\s?\d{3})$/)},"Please specify a valid mobile number"),a.validator.addMethod("netmask",function(a,b){return this.optional(b)||/^(254|252|248|240|224|192|128)\.0\.0\.0|255\.(254|252|248|240|224|192|128|0)\.0\.0|255\.255\.(254|252|248|240|224|192|128|0)\.0|255\.255\.255\.(254|252|248|240|224|192|128|0)/i.test(a)},"Please enter a valid netmask."),a.validator.addMethod("nieES",function(a,b){"use strict";if(this.optional(b))return!0;var c,d=new RegExp(/^[MXYZ]{1}[0-9]{7,8}[TRWAGMYFPDXBNJZSQVHLCKET]{1}$/gi),e="TRWAGMYFPDXBNJZSQVHLCKET",f=a.substr(a.length-1).toUpperCase();return a=a.toString().toUpperCase(),!(a.length>10||a.length<9||!d.test(a))&&(a=a.replace(/^[X]/,"0").replace(/^[Y]/,"1").replace(/^[Z]/,"2"),c=9===a.length?a.substr(0,8):a.substr(0,9),e.charAt(parseInt(c,10)%23)===f)},"Please specify a valid NIE number."),a.validator.addMethod("nifES",function(a,b){"use strict";return!!this.optional(b)||(a=a.toUpperCase(),!!a.match("((^[A-Z]{1}[0-9]{7}[A-Z0-9]{1}$|^[T]{1}[A-Z0-9]{8}$)|^[0-9]{8}[A-Z]{1}$)")&&(/^[0-9]{8}[A-Z]{1}$/.test(a)?"TRWAGMYFPDXBNJZSQVHLCKE".charAt(a.substring(8,0)%23)===a.charAt(8):!!/^[KLM]{1}/.test(a)&&a[8]==="TRWAGMYFPDXBNJZSQVHLCKE".charAt(a.substring(8,1)%23)))},"Please specify a valid NIF number."),a.validator.addMethod("nipPL",function(a){"use strict";if(a=a.replace(/[^0-9]/g,""),10!==a.length)return!1;for(var b=[6,5,7,2,3,4,5,6,7],c=0,d=0;d<9;d++)c+=b[d]*a[d];var e=c%11,f=10===e?0:e;return f===parseInt(a[9],10)},"Please specify a valid NIP number."),a.validator.addMethod("notEqualTo",function(b,c,d){return this.optional(c)||!a.validator.methods.equalTo.call(this,b,c,d)},"Please enter a different value, values must not be the same."),a.validator.addMethod("nowhitespace",function(a,b){return this.optional(b)||/^\S+$/i.test(a)},"No white space please"),a.validator.addMethod("pattern",function(a,b,c){return!!this.optional(b)||("string"==typeof c&&(c=new RegExp("^(?:"+c+")$")),c.test(a))},"Invalid format."),a.validator.addMethod("phoneNL",function(a,b){return this.optional(b)||/^((\+|00(\s|\s?\-\s?)?)31(\s|\s?\-\s?)?(\(0\)[\-\s]?)?|0)[1-9]((\s|\s?\-\s?)?[0-9]){8}$/.test(a)},"Please specify a valid phone number."),a.validator.addMethod("phonesUK",function(a,b){return a=a.replace(/\(|\)|\s+|-/g,""),this.optional(b)||a.length>9&&a.match(/^(?:(?:(?:00\s?|\+)44\s?|0)(?:1\d{8,9}|[23]\d{9}|7(?:[1345789]\d{8}|624\d{6})))$/)},"Please specify a valid uk phone number"),a.validator.addMethod("phoneUK",function(a,b){return a=a.replace(/\(|\)|\s+|-/g,""),this.optional(b)||a.length>9&&a.match(/^(?:(?:(?:00\s?|\+)44\s?)|(?:\(?0))(?:\d{2}\)?\s?\d{4}\s?\d{4}|\d{3}\)?\s?\d{3}\s?\d{3,4}|\d{4}\)?\s?(?:\d{5}|\d{3}\s?\d{3})|\d{5}\)?\s?\d{4,5})$/)},"Please specify a valid phone number"),a.validator.addMethod("phoneUS",function(a,b){return a=a.replace(/\s+/g,""),this.optional(b)||a.length>9&&a.match(/^(\+?1-?)?(\([2-9]([02-9]\d|1[02-9])\)|[2-9]([02-9]\d|1[02-9]))-?[2-9]([02-9]\d|1[02-9])-?\d{4}$/)},"Please specify a valid phone number"),a.validator.addMethod("postalcodeBR",function(a,b){return this.optional(b)||/^\d{2}.\d{3}-\d{3}?$|^\d{5}-?\d{3}?$/.test(a)},"Informe um CEP válido."),a.validator.addMethod("postalCodeCA",function(a,b){return this.optional(b)||/^[ABCEGHJKLMNPRSTVXY]\d[ABCEGHJKLMNPRSTVWXYZ] *\d[ABCEGHJKLMNPRSTVWXYZ]\d$/i.test(a)},"Please specify a valid postal code"),a.validator.addMethod("postalcodeIT",function(a,b){return this.optional(b)||/^\d{5}$/.test(a)},"Please specify a valid postal code"),a.validator.addMethod("postalcodeNL",function(a,b){return this.optional(b)||/^[1-9][0-9]{3}\s?[a-zA-Z]{2}$/.test(a)},"Please specify a valid postal code"),a.validator.addMethod("postcodeUK",function(a,b){return this.optional(b)||/^((([A-PR-UWYZ][0-9])|([A-PR-UWYZ][0-9][0-9])|([A-PR-UWYZ][A-HK-Y][0-9])|([A-PR-UWYZ][A-HK-Y][0-9][0-9])|([A-PR-UWYZ][0-9][A-HJKSTUW])|([A-PR-UWYZ][A-HK-Y][0-9][ABEHMNPRVWXY]))\s?([0-9][ABD-HJLNP-UW-Z]{2})|(GIR)\s?(0AA))$/i.test(a)},"Please specify a valid UK postcode"),a.validator.addMethod("require_from_group",function(b,c,d){var e=a(d[1],c.form),f=e.eq(0),g=f.data("valid_req_grp")?f.data("valid_req_grp"):a.extend({},this),h=e.filter(function(){return g.elementValue(this)}).length>=d[0];return f.data("valid_req_grp",g),a(c).data("being_validated")||(e.data("being_validated",!0),e.each(function(){g.element(this)}),e.data("being_validated",!1)),h},a.validator.format("Please fill at least {0} of these fields.")),a.validator.addMethod("skip_or_fill_minimum",function(b,c,d){var e=a(d[1],c.form),f=e.eq(0),g=f.data("valid_skip")?f.data("valid_skip"):a.extend({},this),h=e.filter(function(){return g.elementValue(this)}).length,i=0===h||h>=d[0];return f.data("valid_skip",g),a(c).data("being_validated")||(e.data("being_validated",!0),e.each(function(){g.element(this)}),e.data("being_validated",!1)),i},a.validator.format("Please either skip these fields or fill at least {0} of them.")),a.validator.addMethod("stateUS",function(a,b,c){var d,e="undefined"==typeof c,f=!e&&"undefined"!=typeof c.caseSensitive&&c.caseSensitive,g=!e&&"undefined"!=typeof c.includeTerritories&&c.includeTerritories,h=!e&&"undefined"!=typeof c.includeMilitary&&c.includeMilitary;return d=g||h?g&&h?"^(A[AEKLPRSZ]|C[AOT]|D[CE]|FL|G[AU]|HI|I[ADLN]|K[SY]|LA|M[ADEINOPST]|N[CDEHJMVY]|O[HKR]|P[AR]|RI|S[CD]|T[NX]|UT|V[AIT]|W[AIVY])$":g?"^(A[KLRSZ]|C[AOT]|D[CE]|FL|G[AU]|HI|I[ADLN]|K[SY]|LA|M[ADEINOPST]|N[CDEHJMVY]|O[HKR]|P[AR]|RI|S[CD]|T[NX]|UT|V[AIT]|W[AIVY])$":"^(A[AEKLPRZ]|C[AOT]|D[CE]|FL|GA|HI|I[ADLN]|K[SY]|LA|M[ADEINOST]|N[CDEHJMVY]|O[HKR]|PA|RI|S[CD]|T[NX]|UT|V[AT]|W[AIVY])$":"^(A[KLRZ]|C[AOT]|D[CE]|FL|GA|HI|I[ADLN]|K[SY]|LA|M[ADEINOST]|N[CDEHJMVY]|O[HKR]|PA|RI|S[CD]|T[NX]|UT|V[AT]|W[AIVY])$",d=f?new RegExp(d):new RegExp(d,"i"),this.optional(b)||d.test(a)},"Please specify a valid state"),a.validator.addMethod("strippedminlength",function(b,c,d){return a(b).text().length>=d},a.validator.format("Please enter at least {0} characters")),a.validator.addMethod("time",function(a,b){return this.optional(b)||/^([01]\d|2[0-3]|[0-9])(:[0-5]\d){1,2}$/.test(a)},"Please enter a valid time, between 00:00 and 23:59"),a.validator.addMethod("time12h",function(a,b){return this.optional(b)||/^((0?[1-9]|1[012])(:[0-5]\d){1,2}(\ ?[AP]M))$/i.test(a)},"Please enter a valid time in 12-hour am/pm format"),a.validator.addMethod("url2",function(a,b){return this.optional(b)||/^(https?|ftp):\/\/(((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:)*@)?(((\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5]))|((([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.)*(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.?)(:\d*)?)(\/((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)+(\/(([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)*)*)?)?(\?((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|[\uE000-\uF8FF]|\/|\?)*)?(#((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|\/|\?)*)?$/i.test(a)},a.validator.messages.url),a.validator.addMethod("vinUS",function(a){if(17!==a.length)return!1;var b,c,d,e,f,g,h=["A","B","C","D","E","F","G","H","J","K","L","M","N","P","R","S","T","U","V","W","X","Y","Z"],i=[1,2,3,4,5,6,7,8,1,2,3,4,5,7,9,2,3,4,5,6,7,8,9],j=[8,7,6,5,4,3,2,10,0,9,8,7,6,5,4,3,2],k=0;for(b=0;b<17;b++){if(e=j[b],d=a.slice(b,b+1),8===b&&(g=d),isNaN(d)){for(c=0;c]*?>/g," ").replace(/ | /gi," ").replace(/[.(),;:!?%#$'\"_+=\/\-“”’]*/g,"")}a.validator.addMethod("maxWords",function(a,c,d){return this.optional(c)||b(a).match(/\b\w+\b/g).length<=d},a.validator.format("Please enter {0} words or less.")),a.validator.addMethod("minWords",function(a,c,d){return this.optional(c)||b(a).match(/\b\w+\b/g).length>=d},a.validator.format("Please enter at least {0} words.")),a.validator.addMethod("rangeWords",function(a,c,d){var e=b(a),f=/\b\w+\b/g;return this.optional(c)||e.match(f).length>=d[0]&&e.match(f).length<=d[1]},a.validator.format("Please enter between {0} and {1} words."))}(),a.validator.addMethod("abaRoutingNumber",function(a){var b=0,c=a.split(""),d=c.length;if(9!==d)return!1;for(var e=0;e9?"0":f,g="JABCDEFGHI".substr(f,1).toString(),i.match(/[ABEH]/)?k===f:i.match(/[KPQS]/)?k===g:k===f||k===g},"Please specify a valid CIF number."),a.validator.addMethod("cnhBR",function(a){if(a=a.replace(/([~!@#$%^&*()_+=`{}\[\]\-|\\:;'<>,.\/? ])+/g,""),11!==a.length)return!1;var b,c,d,e,f,g,h=0,i=0;if(b=a.charAt(0),new Array(12).join(b)===a)return!1;for(e=0,f=9,g=0;e<9;++e,--f)h+=+(a.charAt(e)*f);for(c=h%11,c>=10&&(c=0,i=2),h=0,e=0,f=1,g=0;e<9;++e,++f)h+=+(a.charAt(e)*f);return d=h%11,d>=10?d=0:d-=i,String(c).concat(d)===a.substr(-2)},"Please specify a valid CNH number."),a.validator.addMethod("cnpjBR",function(a,b){"use strict";if(this.optional(b))return!0;if(a=a.replace(/[^\d]+/g,""),14!==a.length)return!1;if("00000000000000"===a||"11111111111111"===a||"22222222222222"===a||"33333333333333"===a||"44444444444444"===a||"55555555555555"===a||"66666666666666"===a||"77777777777777"===a||"88888888888888"===a||"99999999999999"===a)return!1;for(var c=a.length-2,d=a.substring(0,c),e=a.substring(c),f=0,g=c-7,h=c;h>=1;h--)f+=d.charAt(c-h)*g--,g<2&&(g=9);var i=f%11<2?0:11-f%11;if(i!==parseInt(e.charAt(0),10))return!1;c+=1,d=a.substring(0,c),f=0,g=c-7;for(var j=c;j>=1;j--)f+=d.charAt(c-j)*g--,g<2&&(g=9);return i=f%11<2?0:11-f%11,i===parseInt(e.charAt(1),10)},"Please specify a CNPJ value number."),a.validator.addMethod("cpfBR",function(a,b){"use strict";if(this.optional(b))return!0;if(a=a.replace(/([~!@#$%^&*()_+=`{}\[\]\-|\\:;'<>,.\/? ])+/g,""),11!==a.length)return!1;var c,d,e,f,g=0;if(c=parseInt(a.substring(9,10),10),d=parseInt(a.substring(10,11),10),e=function(a,b){var c=10*a%11;return 10!==c&&11!==c||(c=0),c===b},""===a||"00000000000"===a||"11111111111"===a||"22222222222"===a||"33333333333"===a||"44444444444"===a||"55555555555"===a||"66666666666"===a||"77777777777"===a||"88888888888"===a||"99999999999"===a)return!1;for(f=1;f<=9;f++)g+=parseInt(a.substring(f-1,f),10)*(11-f);if(e(g,c)){for(g=0,f=1;f<=10;f++)g+=parseInt(a.substring(f-1,f),10)*(12-f);return e(g,d)}return!1},"Please specify a valid CPF number."),a.validator.addMethod("creditcard",function(a,b){if(this.optional(b))return"dependency-mismatch";if(/[^0-9 \-]+/.test(a))return!1;var c,d,e=0,f=0,g=!1;if(a=a.replace(/\D/g,""),a.length<13||a.length>19)return!1;for(c=a.length-1;c>=0;c--)d=a.charAt(c),f=parseInt(d,10),g&&(f*=2)>9&&(f-=9),e+=f,g=!g;return e%10===0},"Please enter a valid credit card number."),a.validator.addMethod("creditcardtypes",function(a,b,c){if(/[^0-9\-]+/.test(a))return!1;a=a.replace(/\D/g,"");var d=0;return c.mastercard&&(d|=1),c.visa&&(d|=2),c.amex&&(d|=4),c.dinersclub&&(d|=8),c.enroute&&(d|=16),c.discover&&(d|=32),c.jcb&&(d|=64),c.unknown&&(d|=128),c.all&&(d=255),1&d&&(/^(5[12345])/.test(a)||/^(2[234567])/.test(a))?16===a.length:2&d&&/^(4)/.test(a)?16===a.length:4&d&&/^(3[47])/.test(a)?15===a.length:8&d&&/^(3(0[012345]|[68]))/.test(a)?14===a.length:16&d&&/^(2(014|149))/.test(a)?15===a.length:32&d&&/^(6011)/.test(a)?16===a.length:64&d&&/^(3)/.test(a)?16===a.length:64&d&&/^(2131|1800)/.test(a)?15===a.length:!!(128&d)},"Please enter a valid credit card number."),a.validator.addMethod("currency",function(a,b,c){var d,e="string"==typeof c,f=e?c:c[0],g=!!e||c[1];return f=f.replace(/,/g,""),f=g?f+"]":f+"]?",d="^["+f+"([1-9]{1}[0-9]{0,2}(\\,[0-9]{3})*(\\.[0-9]{0,2})?|[1-9]{1}[0-9]{0,}(\\.[0-9]{0,2})?|0(\\.[0-9]{0,2})?|(\\.[0-9]{1,2})?)$",d=new RegExp(d),this.optional(b)||d.test(a)},"Please specify a valid currency."),a.validator.addMethod("dateFA",function(a,b){return this.optional(b)||/^[1-4]\d{3}\/((0?[1-6]\/((3[0-1])|([1-2][0-9])|(0?[1-9])))|((1[0-2]|(0?[7-9]))\/(30|([1-2][0-9])|(0?[1-9]))))$/.test(a)},a.validator.messages.date),a.validator.addMethod("dateITA",function(a,b){var c,d,e,f,g,h=!1,i=/^\d{1,2}\/\d{1,2}\/\d{4}$/;return i.test(a)?(c=a.split("/"),d=parseInt(c[0],10),e=parseInt(c[1],10),f=parseInt(c[2],10),g=new Date(Date.UTC(f,e-1,d,12,0,0,0)),h=g.getUTCFullYear()===f&&g.getUTCMonth()===e-1&&g.getUTCDate()===d):h=!1,this.optional(b)||h},a.validator.messages.date),a.validator.addMethod("dateNL",function(a,b){return this.optional(b)||/^(0?[1-9]|[12]\d|3[01])[\.\/\-](0?[1-9]|1[012])[\.\/\-]([12]\d)?(\d\d)$/.test(a)},a.validator.messages.date),a.validator.addMethod("extension",function(a,b,c){return c="string"==typeof c?c.replace(/,/g,"|"):"png|jpe?g|gif",this.optional(b)||a.match(new RegExp("\\.("+c+")$","i"))},a.validator.format("Please enter a value with a valid extension.")),a.validator.addMethod("giroaccountNL",function(a,b){return this.optional(b)||/^[0-9]{1,7}$/.test(a)},"Please specify a valid giro account number."),a.validator.addMethod("greaterThan",function(b,c,d){var e=a(d);return this.settings.onfocusout&&e.not(".validate-greaterThan-blur").length&&e.addClass("validate-greaterThan-blur").on("blur.validate-greaterThan",function(){a(c).valid()}),b>e.val()},"Please enter a greater value."),a.validator.addMethod("greaterThanEqual",function(b,c,d){var e=a(d);return this.settings.onfocusout&&e.not(".validate-greaterThanEqual-blur").length&&e.addClass("validate-greaterThanEqual-blur").on("blur.validate-greaterThanEqual",function(){a(c).valid()}),b>=e.val()},"Please enter a greater value."),a.validator.addMethod("iban",function(a,b){if(this.optional(b))return!0;var c,d,e,f,g,h,i,j,k,l=a.replace(/ /g,"").toUpperCase(),m="",n=!0,o="",p="",q=5;if(l.lengthd)},a.validator.format("Please select no more than {0} files.")),a.validator.addMethod("maxsize",function(b,c,d){if(this.optional(c))return!0;if("file"===a(c).attr("type")&&c.files&&c.files.length)for(var e=0;ed)return!1;return!0},a.validator.format("File size must not exceed {0} bytes each.")),a.validator.addMethod("maxsizetotal",function(b,c,d){if(this.optional(c))return!0;if("file"===a(c).attr("type")&&c.files&&c.files.length)for(var e=0,f=0;fd)return!1;return!0},a.validator.format("Total size of all files must not exceed {0} bytes.")),a.validator.addMethod("mobileNL",function(a,b){return this.optional(b)||/^((\+|00(\s|\s?\-\s?)?)31(\s|\s?\-\s?)?(\(0\)[\-\s]?)?|0)6((\s|\s?\-\s?)?[0-9]){8}$/.test(a)},"Please specify a valid mobile number."),a.validator.addMethod("mobileRU",function(a,b){var c=a.replace(/\(|\)|\s+|-/g,"");return this.optional(b)||c.length>9&&/^((\+7|7|8)+([0-9]){10})$/.test(c)},"Please specify a valid mobile number."),a.validator.addMethod("mobileUK",function(a,b){return a=a.replace(/\(|\)|\s+|-/g,""),this.optional(b)||a.length>9&&a.match(/^(?:(?:(?:00\s?|\+)44\s?|0)7(?:[1345789]\d{2}|624)\s?\d{3}\s?\d{3})$/)},"Please specify a valid mobile number."),a.validator.addMethod("netmask",function(a,b){return this.optional(b)||/^(254|252|248|240|224|192|128)\.0\.0\.0|255\.(254|252|248|240|224|192|128|0)\.0\.0|255\.255\.(254|252|248|240|224|192|128|0)\.0|255\.255\.255\.(254|252|248|240|224|192|128|0)/i.test(a)},"Please enter a valid netmask."),a.validator.addMethod("nieES",function(a,b){"use strict";if(this.optional(b))return!0;var c,d=new RegExp(/^[MXYZ]{1}[0-9]{7,8}[TRWAGMYFPDXBNJZSQVHLCKET]{1}$/gi),e="TRWAGMYFPDXBNJZSQVHLCKET",f=a.substr(a.length-1).toUpperCase();return a=a.toString().toUpperCase(),!(a.length>10||a.length<9||!d.test(a))&&(a=a.replace(/^[X]/,"0").replace(/^[Y]/,"1").replace(/^[Z]/,"2"),c=9===a.length?a.substr(0,8):a.substr(0,9),e.charAt(parseInt(c,10)%23)===f)},"Please specify a valid NIE number."),a.validator.addMethod("nifES",function(a,b){"use strict";return!!this.optional(b)||(a=a.toUpperCase(),!!a.match("((^[A-Z]{1}[0-9]{7}[A-Z0-9]{1}$|^[T]{1}[A-Z0-9]{8}$)|^[0-9]{8}[A-Z]{1}$)")&&(/^[0-9]{8}[A-Z]{1}$/.test(a)?"TRWAGMYFPDXBNJZSQVHLCKE".charAt(a.substring(8,0)%23)===a.charAt(8):!!/^[KLM]{1}/.test(a)&&a[8]==="TRWAGMYFPDXBNJZSQVHLCKE".charAt(a.substring(8,1)%23)))},"Please specify a valid NIF number."),a.validator.addMethod("nipPL",function(a){"use strict";if(a=a.replace(/[^0-9]/g,""),10!==a.length)return!1;for(var b=[6,5,7,2,3,4,5,6,7],c=0,d=0;d<9;d++)c+=b[d]*a[d];var e=c%11,f=10===e?0:e;return f===parseInt(a[9],10)},"Please specify a valid NIP number."),a.validator.addMethod("nisBR",function(a){var b,c,d,e,f,g=0;if(a=a.replace(/([~!@#$%^&*()_+=`{}\[\]\-|\\:;'<>,.\/? ])+/g,""),11!==a.length)return!1;for(c=parseInt(a.substring(10,11),10),b=parseInt(a.substring(0,10),10),e=2;e<12;e++)f=e,10===e&&(f=2),11===e&&(f=3),g+=b%10*f,b=parseInt(b/10,10);return d=g%11,d=d>1?11-d:0,c===d},"Please specify a valid NIS/PIS number."),a.validator.addMethod("notEqualTo",function(b,c,d){return this.optional(c)||!a.validator.methods.equalTo.call(this,b,c,d)},"Please enter a different value, values must not be the same."),a.validator.addMethod("nowhitespace",function(a,b){return this.optional(b)||/^\S+$/i.test(a)},"No white space please."),a.validator.addMethod("pattern",function(a,b,c){return!!this.optional(b)||("string"==typeof c&&(c=new RegExp("^(?:"+c+")$")),c.test(a))},"Invalid format."),a.validator.addMethod("phoneNL",function(a,b){return this.optional(b)||/^((\+|00(\s|\s?\-\s?)?)31(\s|\s?\-\s?)?(\(0\)[\-\s]?)?|0)[1-9]((\s|\s?\-\s?)?[0-9]){8}$/.test(a)},"Please specify a valid phone number."),a.validator.addMethod("phonePL",function(a,b){a=a.replace(/\s+/g,"");var c=/^(?:(?:(?:\+|00)?48)|(?:\(\+?48\)))?(?:1[2-8]|2[2-69]|3[2-49]|4[1-68]|5[0-9]|6[0-35-9]|[7-8][1-9]|9[145])\d{7}$/;return this.optional(b)||c.test(a)},"Please specify a valid phone number."),a.validator.addMethod("phonesUK",function(a,b){return a=a.replace(/\(|\)|\s+|-/g,""),this.optional(b)||a.length>9&&a.match(/^(?:(?:(?:00\s?|\+)44\s?|0)(?:1\d{8,9}|[23]\d{9}|7(?:[1345789]\d{8}|624\d{6})))$/)},"Please specify a valid uk phone number."),a.validator.addMethod("phoneUK",function(a,b){return a=a.replace(/\(|\)|\s+|-/g,""),this.optional(b)||a.length>9&&a.match(/^(?:(?:(?:00\s?|\+)44\s?)|(?:\(?0))(?:\d{2}\)?\s?\d{4}\s?\d{4}|\d{3}\)?\s?\d{3}\s?\d{3,4}|\d{4}\)?\s?(?:\d{5}|\d{3}\s?\d{3})|\d{5}\)?\s?\d{4,5})$/)},"Please specify a valid phone number."),a.validator.addMethod("phoneUS",function(a,b){return a=a.replace(/\s+/g,""),this.optional(b)||a.length>9&&a.match(/^(\+?1-?)?(\([2-9]([02-9]\d|1[02-9])\)|[2-9]([02-9]\d|1[02-9]))-?[2-9]\d{2}-?\d{4}$/)},"Please specify a valid phone number."),a.validator.addMethod("postalcodeBR",function(a,b){return this.optional(b)||/^\d{2}.\d{3}-\d{3}?$|^\d{5}-?\d{3}?$/.test(a)},"Informe um CEP válido."),a.validator.addMethod("postalCodeCA",function(a,b){return this.optional(b)||/^[ABCEGHJKLMNPRSTVXY]\d[ABCEGHJKLMNPRSTVWXYZ] *\d[ABCEGHJKLMNPRSTVWXYZ]\d$/i.test(a)},"Please specify a valid postal code."),a.validator.addMethod("postalcodeIT",function(a,b){return this.optional(b)||/^\d{5}$/.test(a)},"Please specify a valid postal code."),a.validator.addMethod("postalcodeNL",function(a,b){return this.optional(b)||/^[1-9][0-9]{3}\s?[a-zA-Z]{2}$/.test(a)},"Please specify a valid postal code."),a.validator.addMethod("postcodeUK",function(a,b){return this.optional(b)||/^((([A-PR-UWYZ][0-9])|([A-PR-UWYZ][0-9][0-9])|([A-PR-UWYZ][A-HK-Y][0-9])|([A-PR-UWYZ][A-HK-Y][0-9][0-9])|([A-PR-UWYZ][0-9][A-HJKSTUW])|([A-PR-UWYZ][A-HK-Y][0-9][ABEHMNPRVWXY]))\s?([0-9][ABD-HJLNP-UW-Z]{2})|(GIR)\s?(0AA))$/i.test(a)},"Please specify a valid UK postcode."),a.validator.addMethod("require_from_group",function(b,c,d){var e=a(d[1],c.form),f=e.eq(0),g=f.data("valid_req_grp")?f.data("valid_req_grp"):a.extend({},this),h=e.filter(function(){return g.elementValue(this)}).length>=d[0];return f.data("valid_req_grp",g),a(c).data("being_validated")||(e.data("being_validated",!0),e.each(function(){g.element(this)}),e.data("being_validated",!1)),h},a.validator.format("Please fill at least {0} of these fields.")),a.validator.addMethod("skip_or_fill_minimum",function(b,c,d){var e=a(d[1],c.form),f=e.eq(0),g=f.data("valid_skip")?f.data("valid_skip"):a.extend({},this),h=e.filter(function(){return g.elementValue(this)}).length,i=0===h||h>=d[0];return f.data("valid_skip",g),a(c).data("being_validated")||(e.data("being_validated",!0),e.each(function(){g.element(this)}),e.data("being_validated",!1)),i},a.validator.format("Please either skip these fields or fill at least {0} of them.")),a.validator.addMethod("stateUS",function(a,b,c){var d,e="undefined"==typeof c,f=!e&&"undefined"!=typeof c.caseSensitive&&c.caseSensitive,g=!e&&"undefined"!=typeof c.includeTerritories&&c.includeTerritories,h=!e&&"undefined"!=typeof c.includeMilitary&&c.includeMilitary;return d=g||h?g&&h?"^(A[AEKLPRSZ]|C[AOT]|D[CE]|FL|G[AU]|HI|I[ADLN]|K[SY]|LA|M[ADEINOPST]|N[CDEHJMVY]|O[HKR]|P[AR]|RI|S[CD]|T[NX]|UT|V[AIT]|W[AIVY])$":g?"^(A[KLRSZ]|C[AOT]|D[CE]|FL|G[AU]|HI|I[ADLN]|K[SY]|LA|M[ADEINOPST]|N[CDEHJMVY]|O[HKR]|P[AR]|RI|S[CD]|T[NX]|UT|V[AIT]|W[AIVY])$":"^(A[AEKLPRZ]|C[AOT]|D[CE]|FL|GA|HI|I[ADLN]|K[SY]|LA|M[ADEINOST]|N[CDEHJMVY]|O[HKR]|PA|RI|S[CD]|T[NX]|UT|V[AT]|W[AIVY])$":"^(A[KLRZ]|C[AOT]|D[CE]|FL|GA|HI|I[ADLN]|K[SY]|LA|M[ADEINOST]|N[CDEHJMVY]|O[HKR]|PA|RI|S[CD]|T[NX]|UT|V[AT]|W[AIVY])$",d=f?new RegExp(d):new RegExp(d,"i"),this.optional(b)||d.test(a)},"Please specify a valid state."),a.validator.addMethod("strippedminlength",function(b,c,d){return a(b).text().length>=d},a.validator.format("Please enter at least {0} characters.")),a.validator.addMethod("time",function(a,b){return this.optional(b)||/^([01]\d|2[0-3]|[0-9])(:[0-5]\d){1,2}$/.test(a)},"Please enter a valid time, between 00:00 and 23:59."),a.validator.addMethod("time12h",function(a,b){return this.optional(b)||/^((0?[1-9]|1[012])(:[0-5]\d){1,2}(\ ?[AP]M))$/i.test(a)},"Please enter a valid time in 12-hour am/pm format."),a.validator.addMethod("url2",function(a,b){return this.optional(b)||/^(?:(?:(?:https?|ftp):)?\/\/)(?:(?:[^\]\[?\/<~#`!@$^&*()+=}|:";',>{ ]|%[0-9A-Fa-f]{2})+(?::(?:[^\]\[?\/<~#`!@$^&*()+=}|:";',>{ ]|%[0-9A-Fa-f]{2})*)?@)?(?:(?!(?:10|127)(?:\.\d{1,3}){3})(?!(?:169\.254|192\.168)(?:\.\d{1,3}){2})(?!172\.(?:1[6-9]|2\d|3[0-1])(?:\.\d{1,3}){2})(?:[1-9]\d?|1\d\d|2[01]\d|22[0-3])(?:\.(?:1?\d{1,2}|2[0-4]\d|25[0-5])){2}(?:\.(?:[1-9]\d?|1\d\d|2[0-4]\d|25[0-4]))|(?:(?:[a-z0-9\u00a1-\uffff][a-z0-9\u00a1-\uffff_-]{0,62})?[a-z0-9\u00a1-\uffff]\.)+(?:[a-z\u00a1-\uffff]{2,}\.?)|(?:(?:[a-z0-9\u00a1-\uffff][a-z0-9\u00a1-\uffff_-]{0,62})?[a-z0-9\u00a1-\uffff])|(?:(?:[a-z0-9\u00a1-\uffff][a-z0-9\u00a1-\uffff_-]{0,62}\.)))(?::\d{2,5})?(?:[/?#]\S*)?$/i.test(a)},a.validator.messages.url),a.validator.addMethod("vinUS",function(a){if(17!==a.length)return!1;var b,c,d,e,f,g,h=["A","B","C","D","E","F","G","H","J","K","L","M","N","P","R","S","T","U","V","W","X","Y","Z"],i=[1,2,3,4,5,6,7,8,1,2,3,4,5,7,9,2,3,4,5,6,7,8,9],j=[8,7,6,5,4,3,2,10,0,9,8,7,6,5,4,3,2],k=0;for(b=0;b<17;b++){if(e=j[b],d=a.slice(b,b+1),8===b&&(g=d),isNaN(d)){for(c=0;c - - https://github.com/dotnet/runtime - 301ba1ee5d1cfff28a8866924733603f3adf4936 + + https://dev.azure.com/dnceng/internal/_git/dotnet-runtime + e0f0de876a67755a2c6cd2dc730c13f5959bdea8 https://dev.azure.com/dnceng/internal/_git/dotnet-runtime @@ -246,32 +246,32 @@ 4822e3c3aa77eb82b2fb33c9321f923cf11ddde6 - https://github.com/dotnet/runtime - 301ba1ee5d1cfff28a8866924733603f3adf4936 + https://dev.azure.com/dnceng/internal/_git/dotnet-runtime + e0f0de876a67755a2c6cd2dc730c13f5959bdea8 - https://github.com/dotnet/runtime - 301ba1ee5d1cfff28a8866924733603f3adf4936 + https://dev.azure.com/dnceng/internal/_git/dotnet-runtime + e0f0de876a67755a2c6cd2dc730c13f5959bdea8 - https://github.com/dotnet/runtime - 301ba1ee5d1cfff28a8866924733603f3adf4936 + https://dev.azure.com/dnceng/internal/_git/dotnet-runtime + e0f0de876a67755a2c6cd2dc730c13f5959bdea8 - https://github.com/dotnet/runtime - 301ba1ee5d1cfff28a8866924733603f3adf4936 + https://dev.azure.com/dnceng/internal/_git/dotnet-runtime + e0f0de876a67755a2c6cd2dc730c13f5959bdea8 - https://github.com/dotnet/runtime - 301ba1ee5d1cfff28a8866924733603f3adf4936 + https://dev.azure.com/dnceng/internal/_git/dotnet-runtime + e0f0de876a67755a2c6cd2dc730c13f5959bdea8 - - https://github.com/dotnet/runtime - 301ba1ee5d1cfff28a8866924733603f3adf4936 + + https://dev.azure.com/dnceng/internal/_git/dotnet-runtime + e0f0de876a67755a2c6cd2dc730c13f5959bdea8 diff --git a/eng/Versions.props b/eng/Versions.props index 5c43c68802dd..a17f408f20d2 100644 --- a/eng/Versions.props +++ b/eng/Versions.props @@ -68,7 +68,7 @@ 6.0.23 6.0.23 6.0.23 - 6.0.23-servicing.23479.5 + 6.0.23-servicing.23480.2 6.0.0 6.0.1 6.0.0 @@ -103,7 +103,7 @@ 6.0.0 6.0.0 6.0.0 - 6.0.23-servicing.23479.5 + 6.0.23-servicing.23480.2 6.0.1 6.0.0 6.0.2 From 97956e17688a7bc6a2958da867de5e1032e024eb Mon Sep 17 00:00:00 2001 From: wtgodbe Date: Tue, 10 Oct 2023 14:41:57 -0700 Subject: [PATCH 10/10] Update baseline, SDK --- eng/Baseline.Designer.props | 444 ++++++++++++++++++------------------ eng/Baseline.xml | 214 ++++++++--------- eng/Versions.props | 2 +- global.json | 4 +- 4 files changed, 332 insertions(+), 332 deletions(-) diff --git a/eng/Baseline.Designer.props b/eng/Baseline.Designer.props index 0b962449d9f1..0ca47e957b58 100644 --- a/eng/Baseline.Designer.props +++ b/eng/Baseline.Designer.props @@ -2,28 +2,28 @@ $(MSBuildAllProjects);$(MSBuildThisFileFullPath) - 6.0.22 + 6.0.23 - 6.0.22 + 6.0.23 - 6.0.22 + 6.0.23 - 6.0.22 + 6.0.23 - 6.0.22 + 6.0.23 - - - + + + @@ -34,120 +34,120 @@ - 6.0.22 + 6.0.23 - 6.0.22 + 6.0.23 - 6.0.22 + 6.0.23 - 6.0.22 + 6.0.23 - 6.0.22 + 6.0.23 - 6.0.22 + 6.0.23 - 6.0.22 + 6.0.23 - 6.0.22 + 6.0.23 - 6.0.22 + 6.0.23 - 6.0.22 + 6.0.23 - 6.0.22 + 6.0.23 - 6.0.22 + 6.0.23 - 6.0.22 + 6.0.23 - 6.0.22 + 6.0.23 - - + + - 6.0.22 + 6.0.23 - - + + - 6.0.22 + 6.0.23 - 6.0.22 + 6.0.23 - 6.0.22 + 6.0.23 - 6.0.22 + 6.0.23 - 6.0.22 + 6.0.23 - 6.0.22 + 6.0.23 - + - 6.0.22 + 6.0.23 - 6.0.22 + 6.0.23 - 6.0.22 + 6.0.23 @@ -155,114 +155,114 @@ - 6.0.22 + 6.0.23 - + - + - + - 6.0.22 + 6.0.23 - + - 6.0.22 + 6.0.23 - 6.0.22 + 6.0.23 - + - 6.0.22 + 6.0.23 - - + + - 6.0.22 + 6.0.23 - 6.0.22 + 6.0.23 - - + + - 6.0.22 + 6.0.23 - + - 6.0.22 + 6.0.23 - - - + + + - 6.0.22 + 6.0.23 - - + + - 6.0.22 + 6.0.23 - - + + - 6.0.22 + 6.0.23 - 6.0.22 + 6.0.23 - 6.0.22 + 6.0.23 - - + + @@ -270,7 +270,7 @@ - 6.0.22 + 6.0.23 @@ -278,50 +278,50 @@ - 6.0.22 + 6.0.23 - + - + - + - + - 6.0.22 + 6.0.23 - 6.0.22 + 6.0.23 - + - + - + - 6.0.22 + 6.0.23 - - + + @@ -331,8 +331,8 @@ - - + + @@ -340,8 +340,8 @@ - - + + @@ -352,58 +352,58 @@ - 6.0.22 + 6.0.23 - 6.0.22 + 6.0.23 - - + + - 6.0.22 + 6.0.23 - + - + - + - 6.0.22 + 6.0.23 - + - + - + - 6.0.22 + 6.0.23 - + - 6.0.22 + 6.0.23 @@ -411,71 +411,71 @@ - 6.0.22 + 6.0.23 - 6.0.22 + 6.0.23 - + - + - + - + - 6.0.22 + 6.0.23 - + - + - + - 6.0.22 + 6.0.23 - - + + - 6.0.22 + 6.0.23 - - + + - 6.0.22 + 6.0.23 @@ -491,195 +491,195 @@ - 6.0.22 + 6.0.23 - 6.0.22 + 6.0.23 - 6.0.22 + 6.0.23 - + - 6.0.22 + 6.0.23 - - + + - 6.0.22 + 6.0.23 - - + + - 6.0.22 + 6.0.23 - + - 6.0.22 + 6.0.23 - 6.0.22 + 6.0.23 - 6.0.22 + 6.0.23 - + - 6.0.22 + 6.0.23 - - + + - - + + - - + + - 6.0.22 + 6.0.23 - - + + - - + + - - + + - - + + - 6.0.22 + 6.0.23 - + - + - + - 6.0.22 + 6.0.23 - + - + - + - 6.0.22 + 6.0.23 - + - + - + - 6.0.22 + 6.0.23 - + - + - + - 6.0.22 + 6.0.23 - - - - + + + + - 6.0.22 + 6.0.23 @@ -688,69 +688,69 @@ - 6.0.22 + 6.0.23 - 6.0.22 + 6.0.23 - 6.0.22 + 6.0.23 - 6.0.22 + 6.0.23 - + - 6.0.22 + 6.0.23 - + - 6.0.22 + 6.0.23 - 6.0.22 + 6.0.23 - 6.0.22 + 6.0.23 - 6.0.22 + 6.0.23 - 6.0.22 + 6.0.23 - 6.0.22 + 6.0.23 - 6.0.22 + 6.0.23 - 6.0.22 + 6.0.23 @@ -769,7 +769,7 @@ - 6.0.22 + 6.0.23 @@ -788,7 +788,7 @@ - 6.0.22 + 6.0.23 @@ -804,46 +804,46 @@ - 6.0.22 + 6.0.23 - + - + - + - 6.0.22 + 6.0.23 - 6.0.22 + 6.0.23 - - - + + + - 6.0.22 + 6.0.23 - 6.0.22 + 6.0.23 @@ -853,7 +853,7 @@ - 6.0.22 + 6.0.23 @@ -862,73 +862,73 @@ - 6.0.22 + 6.0.23 - + - + - + - 6.0.22 + 6.0.23 - + - + - + - 6.0.22 + 6.0.23 - + - + - + - 6.0.22 + 6.0.23 - 6.0.22 + 6.0.23 @@ -957,11 +957,11 @@ - 6.0.22 + 6.0.23 - 6.0.22 + 6.0.23 @@ -979,13 +979,13 @@ - 6.0.22 + 6.0.23 - 6.0.22 + 6.0.23 - + \ No newline at end of file diff --git a/eng/Baseline.xml b/eng/Baseline.xml index 2984eef6c6e4..749cc484d04a 100644 --- a/eng/Baseline.xml +++ b/eng/Baseline.xml @@ -4,111 +4,111 @@ This file contains a list of all the packages and their versions which were rele Update this list when preparing for a new patch. --> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/eng/Versions.props b/eng/Versions.props index 2635b6b431f9..2186c0e1d1eb 100644 --- a/eng/Versions.props +++ b/eng/Versions.props @@ -9,7 +9,7 @@ 6 0 24 - false + true diff --git a/global.json b/global.json index 4cc2acb633b1..83661f95122b 100644 --- a/global.json +++ b/global.json @@ -1,9 +1,9 @@ { "sdk": { - "version": "6.0.122" + "version": "6.0.123" }, "tools": { - "dotnet": "6.0.122", + "dotnet": "6.0.123", "runtimes": { "dotnet/x64": [ "2.1.30",