Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
DataProtection
  • Loading branch information
BrennanConroy committed May 1, 2022
commit 53fda6f76d78d712fce7a049afe6b0d96724281b
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ private interface IActivator<out T>
Func<T> Creator { get; }
}

private class AlgorithmActivatorCore<T> : IActivator<T> where T : new()
private sealed class AlgorithmActivatorCore<T> : IActivator<T> where T : new()
{
public Func<T> Creator { get; } = Activator.CreateInstance<T>;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ namespace Microsoft.AspNetCore.DataProtection.Internal;
/// <summary>
/// Default implementation of <see cref="IDataProtectionBuilder"/>.
/// </summary>
internal class DataProtectionBuilder : IDataProtectionBuilder
internal sealed class DataProtectionBuilder : IDataProtectionBuilder
{
/// <summary>
/// Creates a new configuration object linked to a <see cref="IServiceCollection"/>.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

namespace Microsoft.AspNetCore.DataProtection.Internal;

internal class DataProtectionHostedService : IHostedService
internal sealed class DataProtectionHostedService : IHostedService
{
private readonly IKeyRingProvider _keyRingProvider;
private readonly ILogger<DataProtectionHostedService> _logger;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
// Licensed to the .NET Foundation under one or more agreements.
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.

using System;
using Microsoft.Extensions.Options;

namespace Microsoft.AspNetCore.DataProtection.Internal;

internal class DataProtectionOptionsSetup : IConfigureOptions<DataProtectionOptions>
internal sealed class DataProtectionOptionsSetup : IConfigureOptions<DataProtectionOptions>
{
private readonly IServiceProvider _services;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

namespace Microsoft.AspNetCore.DataProtection.Internal;

internal class HostingApplicationDiscriminator : IApplicationDiscriminator
internal sealed class HostingApplicationDiscriminator : IApplicationDiscriminator
{
private readonly IHostEnvironment? _hosting;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

namespace Microsoft.AspNetCore.DataProtection.Internal;

internal class KeyManagementOptionsSetup : IConfigureOptions<KeyManagementOptions>
internal sealed class KeyManagementOptionsSetup : IConfigureOptions<KeyManagementOptions>
{
private readonly IRegistryPolicyResolver? _registryPolicyResolver;
private readonly ILoggerFactory _loggerFactory;
Expand Down
2 changes: 1 addition & 1 deletion src/DataProtection/DataProtection/src/RegistryPolicy.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

namespace Microsoft.AspNetCore.DataProtection;

internal class RegistryPolicy
internal sealed class RegistryPolicy
{
public RegistryPolicy(
AlgorithmConfiguration? configuration,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ namespace Microsoft.AspNetCore.DataProtection.Repositories;
/// An ephemeral XML repository backed by process memory. This class must not be used for
/// anything other than dev scenarios as the keys will not be persisted to storage.
/// </summary>
internal class EphemeralXmlRepository : IXmlRepository
internal sealed class EphemeralXmlRepository : IXmlRepository
{
private readonly List<XElement> _storedElements = new List<XElement>();

Expand All @@ -23,7 +23,7 @@ public EphemeralXmlRepository(ILoggerFactory loggerFactory)
logger.UsingInmemoryRepository();
}

public virtual IReadOnlyCollection<XElement> GetAllElements()
public IReadOnlyCollection<XElement> GetAllElements()
{
// force complete enumeration under lock for thread safety
lock (_storedElements)
Expand All @@ -41,7 +41,7 @@ private IEnumerable<XElement> GetAllElementsCore()
}
}

public virtual void StoreElement(XElement element, string friendlyName)
public void StoreElement(XElement element, string friendlyName)
{
if (element == null)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,9 @@

namespace Microsoft.AspNetCore.DataProtection;

#pragma warning disable CA1852 // Seal internal types
internal class TypeForwardingActivator : SimpleActivator
#pragma warning restore CA1852 // Seal internal types
{
private const string OldNamespace = "Microsoft.AspNet.DataProtection";
private const string CurrentNamespace = "Microsoft.AspNetCore.DataProtection";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ void IInternalEncryptedXmlDecryptor.PerformPreDecryptionSetup(EncryptedXml encry
/// <summary>
/// Can decrypt the XML key data from an <see cref="X509Certificate2"/> that is not in stored in <see cref="X509Store"/>.
/// </summary>
private class EncryptedXmlWithCertificateKeys : EncryptedXml
private sealed class EncryptedXmlWithCertificateKeys : EncryptedXml
{
private readonly XmlKeyDecryptionOptions? _options;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ namespace Microsoft.AspNetCore.DataProtection.XmlEncryption;
/// <summary>
/// Specifies settings for how to decrypt XML keys.
/// </summary>
internal class XmlKeyDecryptionOptions
internal sealed class XmlKeyDecryptionOptions
{
private readonly Dictionary<string, List<X509Certificate2>> _certs = new Dictionary<string, List<X509Certificate2>>(StringComparer.Ordinal);

Expand Down