Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
19 commits
Select commit Hold shift + click to select a range
8c528bd
Update dependencies from https://github.com/dotnet/source-build-refer…
dotnet-maestro[bot] Sep 2, 2023
7ac89dd
[release/8.0] Update dependencies from dotnet/extensions dotnet/efcor…
dotnet-maestro[bot] Sep 3, 2023
fc69e7b
Update dependencies from https://github.com/dotnet/extensions build 2…
dotnet-maestro[bot] Sep 4, 2023
78249bb
Update dependencies from https://github.com/dotnet/arcade build 20230…
dotnet-maestro[bot] Sep 4, 2023
a295f95
Update dependencies from https://github.com/dotnet/winforms build 202…
dotnet-maestro[bot] Sep 4, 2023
175f7d7
Update dependencies from https://github.com/dotnet/efcore build 20230…
dotnet-maestro[bot] Sep 4, 2023
51367f6
[SignalR] Error if multiple service attributes are on a single parame…
BrennanConroy Sep 5, 2023
4f601ab
[release/8.0] Update dependencies from dotnet/efcore dotnet/extension…
dotnet-maestro[bot] Sep 5, 2023
3c9eb38
Update dependencies from https://github.com/dotnet/source-build-exter…
dotnet-maestro[bot] Sep 5, 2023
2772a78
[Blazor] Update selenium versions (#50511)
javiercn Sep 5, 2023
3f3107a
Update jquery-validation to v1.19.5 (#50482)
github-actions[bot] Sep 6, 2023
564a94d
Revert "[Blazor] Update selenium versions (#50511)" (#50556)
captainsafia Sep 6, 2023
716bfef
Tidy up aka.ms links in data protection error messages (#50465)
amcasey Sep 6, 2023
a93ba07
[release/8.0] Update dependencies from dotnet/efcore (#50532)
dotnet-maestro[bot] Sep 6, 2023
f97172c
Update dependencies from https://github.com/dotnet/efcore build 20230…
dotnet-maestro[bot] Sep 6, 2023
7f076c7
Update dependencies from https://github.com/dotnet/runtime build 2023…
dotnet-maestro[bot] Sep 7, 2023
415e7f7
[release/8.0] Update dependencies from dotnet/source-build-reference-…
dotnet-maestro[bot] Sep 7, 2023
f8cdb58
Update Microsoft.IdentityModel to 7.0.0-preview5 (#50538)
eerhardt Sep 7, 2023
846f161
Merge branch 'release/8.0'
BrennanConroy Sep 7, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
284 changes: 142 additions & 142 deletions eng/Version.Details.xml

Large diffs are not rendered by default.

144 changes: 72 additions & 72 deletions eng/Versions.props

Large diffs are not rendered by default.

8 changes: 4 additions & 4 deletions src/DataProtection/Abstractions/src/Resources.resx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Expand Down Expand Up @@ -118,15 +118,15 @@
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<data name="CryptCommon_PayloadInvalid" xml:space="preserve">
<value>The payload was invalid.</value>
<value>The payload was invalid. For more information go to https://aka.ms/aspnet/dataprotectionwarning</value>
</data>
<data name="DataProtectionExtensions_NullPurposesCollection" xml:space="preserve">
<value>The purposes collection cannot be null or empty and cannot contain null elements.</value>
</data>
<data name="CryptCommon_GenericError" xml:space="preserve">
<value>An error occurred during a cryptographic operation.</value>
<value>An error occurred during a cryptographic operation. Refer to the inner exception for more information.</value>
</data>
<data name="DataProtectionExtensions_NoService" xml:space="preserve">
<value>No service for type '{0}' has been registered.</value>
</data>
</root>
</root>
4 changes: 2 additions & 2 deletions src/DataProtection/DataProtection/src/LoggingExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@ private static bool IsLogLevelEnabledCore([NotNullWhen(true)] ILogger? logger, L
[LoggerMessage(48, LogLevel.Error, "An error occurred while reading the key ring.", EventName = "ErrorOccurredWhileReadingKeyRing")]
public static partial void ErrorOccurredWhileReadingKeyRing(this ILogger logger, Exception exception);

[LoggerMessage(49, LogLevel.Error, "The key ring does not contain a valid default key, and the key manager is configured with auto-generation of keys disabled.", EventName = "KeyRingDoesNotContainValidDefaultKey")]
[LoggerMessage(49, LogLevel.Error, "The key ring does not contain a valid default protection key. The data protection system cannot create a new key because auto-generation of keys is disabled. For more information go to http://aka.ms/dataprotectionwarning", EventName = "KeyRingDoesNotContainValidDefaultKey")]
public static partial void KeyRingDoesNotContainValidDefaultKey(this ILogger logger);

[LoggerMessage(50, LogLevel.Warning, "Using an in-memory repository. Keys will not be persisted to storage.", EventName = "UsingInMemoryRepository")]
Expand Down Expand Up @@ -235,6 +235,6 @@ private static bool IsLogLevelEnabledCore([NotNullWhen(true)] ILogger? logger, L
[LoggerMessage(66, LogLevel.Information, "Key ring failed to load during application startup.", EventName = "KeyRingFailedToLoadOnStartup")]
public static partial void KeyRingFailedToLoadOnStartup(this ILogger logger, Exception innerException);

[LoggerMessage(60, LogLevel.Warning, "Storing keys in a directory '{path}' that may not be persisted outside of the container. Protected data will be unavailable when container is destroyed.", EventName = "UsingEphemeralFileSystemLocationInContainer")]
[LoggerMessage(60, LogLevel.Warning, "Storing keys in a directory '{path}' that may not be persisted outside of the container. Protected data will be unavailable when container is destroyed. For more information go to https://aka.ms/aspnet/dataprotectionwarning", EventName = "UsingEphemeralFileSystemLocationInContainer")]
public static partial void UsingEphemeralFileSystemLocationInContainer(this ILogger logger, string path);
}
46 changes: 24 additions & 22 deletions src/DataProtection/DataProtection/src/Resources.resx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Expand Down Expand Up @@ -118,34 +118,34 @@
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<data name="CryptCommon_GenericError" xml:space="preserve">
<value>An error occurred during a cryptographic operation. For more information go to http://aka.ms/dataprotectionwarning</value>
<value>An error occurred during a cryptographic operation. Refer to the inner exception for more information.</value>
</data>
<data name="Common_BufferIncorrectlySized" xml:space="preserve">
<value>The provided buffer is of length {0} byte(s). It must instead be exactly {1} byte(s) in length. For more information go to http://aka.ms/dataprotectionwarning</value>
<value>The provided buffer is of length {0} byte(s). It must instead be exactly {1} byte(s) in length.</value>
</data>
<data name="CryptCommon_PayloadInvalid" xml:space="preserve">
<value>The payload was invalid. For more information go to http://aka.ms/dataprotectionwarning</value>
<value>The payload was invalid. For more information go to https://aka.ms/aspnet/dataprotectionwarning</value>
</data>
<data name="Common_PropertyCannotBeNullOrEmpty" xml:space="preserve">
<value>Property {0} cannot be null or empty.</value>
</data>
<data name="Common_DecryptionFailed" xml:space="preserve">
<value>The provided payload could not be decrypted. Refer to the inner exception for more information. For more information go to http://aka.ms/dataprotectionwarning</value>
<value>The provided payload could not be decrypted. Refer to the inner exception for more information.</value>
</data>
<data name="Common_EncryptionFailed" xml:space="preserve">
<value>An error occurred while trying to encrypt the provided data. Refer to the inner exception for more information. For more information go to http://aka.ms/dataprotectionwarning</value>
<value>An error occurred while trying to encrypt the provided data. Refer to the inner exception for more information.</value>
</data>
<data name="Common_KeyNotFound" xml:space="preserve">
<value>The key {0:B} was not found in the key ring. For more information go to http://aka.ms/dataprotectionwarning</value>
<value>The key {0:B} was not found in the key ring. For more information go to https://aka.ms/aspnet/dataprotectionwarning</value>
</data>
<data name="Common_KeyRevoked" xml:space="preserve">
<value>The key {0:B} has been revoked. For more information go to http://aka.ms/dataprotectionwarning</value>
<value>The key {0:B} has been revoked. For more information go to https://aka.ms/aspnet/dataprotectionwarning</value>
</data>
<data name="ProtectionProvider_BadMagicHeader" xml:space="preserve">
<value>The provided payload cannot be decrypted because it was not protected with this protection provider. For more information go to http://aka.ms/dataprotectionwarning</value>
<value>The provided payload cannot be decrypted because it was not protected with this protection provider. For more information go to https://aka.ms/aspnet/dataprotectionwarning</value>
</data>
<data name="ProtectionProvider_BadVersion" xml:space="preserve">
<value>The provided payload cannot be decrypted because it was protected with a newer version of the protection provider. For more information go to http://aka.ms/dataprotectionwarning</value>
<value>The provided payload cannot be decrypted because it was protected with a newer version of the protection provider.</value>
</data>
<data name="Common_ValueMustBeNonNegative" xml:space="preserve">
<value>Value must be non-negative.</value>
Expand All @@ -154,42 +154,44 @@
<value>The type '{1}' is not assignable to '{0}'.</value>
</data>
<data name="KeyManagementOptions_MinNewKeyLifetimeViolated" xml:space="preserve">
<value>The new key lifetime must be at least one week. For more information go to http://aka.ms/dataprotectionwarning</value>
<value>The new key lifetime must be at least one week. For more information go to https://aka.ms/aspnet/dataprotectionwarning</value>
</data>
<data name="XmlKeyManager_DuplicateKey" xml:space="preserve">
<value>The key {0:B} already exists in the keyring. For more information go to http://aka.ms/dataprotectionwarning</value>
<value>The key {0:B} already exists in the keyring. For more information go to https://aka.ms/aspnet/dataprotectionwarning</value>
</data>
<data name="Common_ArgumentCannotBeNullOrEmpty" xml:space="preserve">
<value>Argument cannot be null or empty.</value>
</data>
<data name="Common_PropertyMustBeNonNegative" xml:space="preserve">
<value>Property {0} must have a non-negative value. For more information go to http://aka.ms/dataprotectionwarning</value>
<value>Property {0} must have a non-negative value.</value>
</data>
<data name="Platform_WindowsRequiredForGcm" xml:space="preserve">
<value>GCM algorithms require the Windows platform. For more information go to http://aka.ms/dataprotectionwarning</value>
<value>GCM algorithms require the Windows platform. For more information go to https://aka.ms/aspnet/dataprotectionwarning</value>
</data>
<data name="CertificateXmlEncryptor_CertificateNotFound" xml:space="preserve">
<value>A certificate with the thumbprint '{0}' could not be found. For more information go to http://aka.ms/dataprotectionwarning</value>
<value>A certificate with the thumbprint '{0}' could not be found. For more information go to https://aka.ms/aspnet/dataprotectionwarning</value>
</data>
<!-- This is no longer used -->
<data name="EncryptedXmlDecryptor_DoesNotWorkOnCoreClr" xml:space="preserve">
<value>Decrypting EncryptedXml-encapsulated payloads is not yet supported on Core CLR. For more information go to http://aka.ms/dataprotectionwarning</value>
<value>Decrypting EncryptedXml-encapsulated payloads is not yet supported on Core CLR. For more information go to https://aka.ms/aspnet/dataprotectionwarning</value>
</data>
<data name="AlgorithmAssert_BadBlockSize" xml:space="preserve">
<value>The symmetric algorithm block size of {0} bits is invalid. The block size must be between 64 and 2048 bits, inclusive, and it must be a multiple of 8 bits. For more information go to http://aka.ms/dataprotectionwarning</value>
<value>The symmetric algorithm block size of {0} bits is invalid. The block size must be between 64 and 2048 bits, inclusive, and it must be a multiple of 8 bits.</value>
</data>
<data name="AlgorithmAssert_BadDigestSize" xml:space="preserve">
<value>The validation algorithm digest size of {0} bits is invalid. The digest size must be between 128 and 2048 bits, inclusive, and it must be a multiple of 8 bits. For more information go to http://aka.ms/dataprotectionwarning</value>
<value>The validation algorithm digest size of {0} bits is invalid. The digest size must be between 128 and 2048 bits, inclusive, and it must be a multiple of 8 bits.</value>
</data>
<data name="AlgorithmAssert_BadKeySize" xml:space="preserve">
<value>The symmetric algorithm key size of {0} bits is invalid. The key size must be between 128 and 2048 bits, inclusive, and it must be a multiple of 8 bits. For more information go to http://aka.ms/dataprotectionwarning</value>
<value>The symmetric algorithm key size of {0} bits is invalid. The key size must be between 128 and 2048 bits, inclusive, and it must be a multiple of 8 bits.</value>
</data>
<data name="KeyRingProvider_NoDefaultKey_AutoGenerateDisabled" xml:space="preserve">
<value>The key ring does not contain a valid default protection key. The data protection system cannot create a new key because auto-generation of keys is disabled. For more information go to http://aka.ms/dataprotectionwarning</value>
<value>The key ring does not contain a valid default protection key. The data protection system cannot create a new key because auto-generation of keys is disabled. For more information go to https://aka.ms/aspnet/dataprotectionwarning</value>
</data>
<data name="LifetimeMustNotBeNegative" xml:space="preserve">
<value>{0} must not be negative. For more information go to http://aka.ms/dataprotectionwarning</value>
<value>{0} must not be negative.</value>
</data>
<!-- This is only used to test LoggingExtensions.UsingEphemeralFileSystemLocationInContainer -->
<data name="FileSystem_EphemeralKeysLocationInContainer" xml:space="preserve">
<value>Storing keys in a directory '{path}' that may not be persisted outside of the container. Protected data will be unavailable when container is destroyed. For more information go to http://aka.ms/dataprotectionwarning</value>
<value>Storing keys in a directory '{path}' that may not be persisted outside of the container. Protected data will be unavailable when container is destroyed. For more information go to https://aka.ms/aspnet/dataprotectionwarning</value>
</data>
</root>
8 changes: 4 additions & 4 deletions src/DataProtection/Extensions/src/Resources.resx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Expand Down Expand Up @@ -118,12 +118,12 @@
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<data name="CryptCommon_GenericError" xml:space="preserve">
<value>An error occurred during a cryptographic operation. For more information go to http://aka.ms/dataprotectionwarning</value>
<value>An error occurred during a cryptographic operation. Refer to the inner exception for more information.</value>
</data>
<data name="TimeLimitedDataProtector_PayloadExpired" xml:space="preserve">
<value>The payload expired at {0}. For more information go to http://aka.ms/dataprotectionwarning</value>
<value>The payload expired at {0}.</value>
</data>
<data name="TimeLimitedDataProtector_PayloadInvalid" xml:space="preserve">
<value>The payload is invalid. For more information go to http://aka.ms/dataprotectionwarning</value>
<value>The payload is invalid. For more information go to https://aka.ms/aspnet/dataprotectionwarning</value>
</data>
</root>
19 changes: 15 additions & 4 deletions src/Security/Authentication/test/JwtBearerTests.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.

using System.Globalization;
using System.IdentityModel.Tokens.Jwt;
using System.Net;
using System.Net.Http;
Expand Down Expand Up @@ -958,15 +959,15 @@ public async Task ExpirationAndIssuedSetOnAuthenticateResult()
}

[Fact]
public async Task ExpirationAndIssuedNullWhenMinOrMaxValue()
public async Task ExpirationAndIssuedWhenMinOrMaxValue()
{
var key = new SymmetricSecurityKey(Encoding.UTF8.GetBytes(new string('a', 128)));
var creds = new SigningCredentials(key, SecurityAlgorithms.HmacSha256);

var claims = new[]
{
new Claim(ClaimTypes.NameIdentifier, "Bob")
};
new Claim(ClaimTypes.NameIdentifier, "Bob")
};

var token = new JwtSecurityToken(
issuer: "issuer.contoso.com",
Expand Down Expand Up @@ -995,8 +996,18 @@ public async Task ExpirationAndIssuedNullWhenMinOrMaxValue()
Assert.Equal(HttpStatusCode.OK, response.Response.StatusCode);
var responseBody = await response.Response.Content.ReadAsStringAsync();
using var dom = JsonDocument.Parse(responseBody);
Assert.Equal(JsonValueKind.Null, dom.RootElement.GetProperty("expires").ValueKind);
Assert.Equal(JsonValueKind.Null, dom.RootElement.GetProperty("issued").ValueKind);

var expiresElement = dom.RootElement.GetProperty("expires");
Assert.Equal(JsonValueKind.String, expiresElement.ValueKind);

var elementValue = DateTime.Parse(expiresElement.GetString(), CultureInfo.InvariantCulture);
var elementValueUtc = elementValue.ToUniversalTime();
// roundtrip DateTime.MaxValue through parsing because it is lossy and we
// need equivalent values to compare against.
var max = DateTime.Parse(DateTime.MaxValue.ToString(CultureInfo.InvariantCulture), CultureInfo.InvariantCulture);

Assert.Equal(max, elementValueUtc);
}

[Fact]
Expand Down
43 changes: 37 additions & 6 deletions src/SignalR/server/Core/src/Internal/HubMethodDescriptor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -81,22 +81,53 @@ public HubMethodDescriptor(ObjectMethodExecutor methodExecutor, IServiceProvider
}
else if (p.CustomAttributes.Any())
{
var markedParameter = false;
foreach (var attribute in p.GetCustomAttributes(true))
{
if (attribute is IFromServiceMetadata)
{
return MarkServiceParameter(index);
ThrowIfMarked(markedParameter);
markedParameter = true;
MarkServiceParameter(index);
}
else if (attribute is FromKeyedServicesAttribute keyedServicesAttribute)
{
if (serviceProviderIsService is IServiceProviderIsKeyedService keyedServiceProvider &&
keyedServiceProvider.IsKeyedService(GetServiceType(p.ParameterType), keyedServicesAttribute.Key))
ThrowIfMarked(markedParameter);
markedParameter = true;

if (serviceProviderIsService is IServiceProviderIsKeyedService keyedServiceProvider)
{
if (keyedServiceProvider.IsKeyedService(GetServiceType(p.ParameterType), keyedServicesAttribute.Key))
{
KeyedServiceKeys ??= new List<(int, object)>();
KeyedServiceKeys.Add((index, keyedServicesAttribute.Key));
MarkServiceParameter(index);
}
else
{
throw new InvalidOperationException($"'{p.ParameterType}' is not in DI as a keyed service.");
}
}
else
{
KeyedServiceKeys ??= new List<(int, object)>();
KeyedServiceKeys.Add((index, keyedServicesAttribute.Key));
return MarkServiceParameter(index);
throw new InvalidOperationException($"This service provider doesn't support keyed services.");
}
}

void ThrowIfMarked(bool marked)
{
if (marked)
{
throw new InvalidOperationException(
$"{methodExecutor.MethodInfo.DeclaringType?.Name}.{methodExecutor.MethodInfo.Name}: The {nameof(FromKeyedServicesAttribute)} is not supported on parameters that are also annotated with {nameof(IFromServiceMetadata)}.");
}
}
}

if (markedParameter)
{
// If the parameter is marked because of being a service, we don't want to consider it for method parameters during deserialization
return false;
}
}
else if (serviceProviderIsService?.IsService(GetServiceType(p.ParameterType)) == true)
Expand Down
Loading