Browse Source

Enabled xml doc generation

Ajay Bhargav Baaskaran 10 years ago
parent
commit
3007398648
20 changed files with 58 additions and 32 deletions
  1. 2 12
      NuGetPackageVerifier.json
  2. 3 1
      src/Microsoft.AspNetCore.Cryptography.Internal/project.json
  3. 3 1
      src/Microsoft.AspNetCore.Cryptography.KeyDerivation/project.json
  4. 1 1
      src/Microsoft.AspNetCore.DataProtection.Abstractions/DataProtectionExtensions.cs
  5. 1 1
      src/Microsoft.AspNetCore.DataProtection.Abstractions/IDataProtectionProvider.cs
  6. 1 1
      src/Microsoft.AspNetCore.DataProtection.Abstractions/IDataProtector.cs
  7. 3 1
      src/Microsoft.AspNetCore.DataProtection.Abstractions/project.json
  8. 1 1
      src/Microsoft.AspNetCore.DataProtection.Extensions/DataProtectionExtensions.cs
  9. 2 2
      src/Microsoft.AspNetCore.DataProtection.Extensions/ITimeLimitedDataProtector.cs
  10. 3 1
      src/Microsoft.AspNetCore.DataProtection.Extensions/project.json
  11. 3 1
      src/Microsoft.AspNetCore.DataProtection.SystemWeb/project.json
  12. 2 1
      src/Microsoft.AspNetCore.DataProtection/AuthenticatedEncryption/ConfigurationModel/ManagedAuthenticatedEncryptorConfiguration.cs
  13. 28 2
      src/Microsoft.AspNetCore.DataProtection/DataProtectionConfiguration.cs
  14. 1 1
      src/Microsoft.AspNetCore.DataProtection/RegistryPolicyResolver.cs
  15. 1 0
      src/Microsoft.AspNetCore.DataProtection/Repositories/RegistryXmlRepository.cs
  16. 0 1
      src/Microsoft.AspNetCore.DataProtection/XmlEncryption/DpapiNGXmlDecryptor.cs
  17. 0 1
      src/Microsoft.AspNetCore.DataProtection/XmlEncryption/DpapiXmlDecryptor.cs
  18. 0 1
      src/Microsoft.AspNetCore.DataProtection/XmlEncryption/EncryptedXmlDecryptor.cs
  19. 0 1
      src/Microsoft.AspNetCore.DataProtection/XmlEncryption/NullXmlDecryptor.cs
  20. 3 1
      src/Microsoft.AspNetCore.DataProtection/project.json

+ 2 - 12
NuGetPackageVerifier.json

@@ -1,12 +1,7 @@
 {
     "adx": { // Packages written by the ADX team and that ship on NuGet.org
         "rules": [
-            "AssemblyHasDocumentFileRule",
-            "AssemblyHasVersionAttributesRule",
-            "AssemblyHasServicingAttributeRule",
-            "AssemblyHasNeutralResourcesLanguageAttributeRule",
-            "SatellitePackageRule",
-            "StrictSemanticVersionValidationRule"
+            "AdxVerificationCompositeRule"
         ],
         "packages": {
             "Microsoft.AspNetCore.Cryptography.Internal": { },
@@ -25,12 +20,7 @@
     },
     "Default": { // Rules to run for packages not listed in any other set.
         "rules": [
-            "AssemblyHasDocumentFileRule",
-            "AssemblyHasVersionAttributesRule",
-            "AssemblyHasServicingAttributeRule",
-            "AssemblyHasNeutralResourcesLanguageAttributeRule",
-            "SatellitePackageRule",
-            "StrictSemanticVersionValidationRule"
+            "DefaultCompositeRule"
         ]
     }
 }

+ 3 - 1
src/Microsoft.AspNetCore.Cryptography.Internal/project.json

@@ -21,6 +21,8 @@
   "compilationOptions": {
     "allowUnsafe": true,
     "warningsAsErrors": true,
-    "keyFile": "../../tools/Key.snk"
+    "keyFile": "../../tools/Key.snk",
+    "nowarn": [ "CS1591" ],
+    "xmlDoc": true
   }
 }

+ 3 - 1
src/Microsoft.AspNetCore.Cryptography.KeyDerivation/project.json

@@ -21,6 +21,8 @@
   "compilationOptions": {
     "allowUnsafe": true,
     "warningsAsErrors": true,
-    "keyFile": "../../tools/Key.snk"
+    "keyFile": "../../tools/Key.snk",
+    "nowarn": [ "CS1591" ],
+    "xmlDoc": true
   }
 }

+ 1 - 1
src/Microsoft.AspNetCore.DataProtection.Abstractions/DataProtectionExtensions.cs

@@ -248,7 +248,7 @@ namespace Microsoft.AspNetCore.DataProtection
         /// <param name="protector">The data protector to use for this operation.</param>
         /// <param name="protectedData">The protected data to unprotect.</param>
         /// <returns>The plaintext form of the protected data.</returns>
-        /// <exception cref="CryptographicException">
+        /// <exception cref="System.Security.Cryptography.CryptographicException">
         /// Thrown if <paramref name="protectedData"/> is invalid or malformed.
         /// </exception>
         public static string Unprotect(this IDataProtector protector, string protectedData)

+ 1 - 1
src/Microsoft.AspNetCore.DataProtection.Abstractions/IDataProtectionProvider.cs

@@ -11,7 +11,7 @@ namespace Microsoft.AspNetCore.DataProtection
         /// <summary>
         /// Creates an <see cref="IDataProtector"/> given a purpose.
         /// </summary>
-        /// <param name="purposes">
+        /// <param name="purpose">
         /// The purpose to be assigned to the newly-created <see cref="IDataProtector"/>.
         /// </param>
         /// <returns>An IDataProtector tied to the provided purpose.</returns>

+ 1 - 1
src/Microsoft.AspNetCore.DataProtection.Abstractions/IDataProtector.cs

@@ -20,7 +20,7 @@ namespace Microsoft.AspNetCore.DataProtection
         /// </summary>
         /// <param name="protectedData">The protected data to unprotect.</param>
         /// <returns>The plaintext form of the protected data.</returns>
-        /// <exception cref="CryptographicException">
+        /// <exception cref="System.Security.Cryptography.CryptographicException">
         /// Thrown if the protected data is invalid or malformed.
         /// </exception>
         byte[] Unprotect(byte[] protectedData);

+ 3 - 1
src/Microsoft.AspNetCore.DataProtection.Abstractions/project.json

@@ -23,6 +23,8 @@
   },
   "compilationOptions": {
     "warningsAsErrors": true,
-    "keyFile": "../../tools/Key.snk"
+    "keyFile": "../../tools/Key.snk",
+    "nowarn": [ "CS1591" ],
+    "xmlDoc": true
   }
 }

+ 1 - 1
src/Microsoft.AspNetCore.DataProtection.Extensions/DataProtectionExtensions.cs

@@ -101,7 +101,7 @@ namespace Microsoft.AspNetCore.DataProtection
         /// <param name="expiration">An 'out' parameter which upon a successful unprotect
         /// operation receives the expiration date of the payload.</param>
         /// <returns>The plaintext form of the protected data.</returns>
-        /// <exception cref="CryptographicException">
+        /// <exception cref="System.Security.Cryptography.CryptographicException">
         /// Thrown if <paramref name="protectedData"/> is invalid, malformed, or expired.
         /// </exception>
         public static string Unprotect(this ITimeLimitedDataProtector protector, string protectedData, out DateTimeOffset expiration)

+ 2 - 2
src/Microsoft.AspNetCore.DataProtection.Extensions/ITimeLimitedDataProtector.cs

@@ -19,7 +19,7 @@ namespace Microsoft.AspNetCore.DataProtection
         /// <summary>
         /// Creates an <see cref="ITimeLimitedDataProtector"/> given a purpose.
         /// </summary>
-        /// <param name="purposes">
+        /// <param name="purpose">
         /// The purpose to be assigned to the newly-created <see cref="ITimeLimitedDataProtector"/>.
         /// </param>
         /// <returns>An <see cref="ITimeLimitedDataProtector"/> tied to the provided purpose.</returns>
@@ -47,7 +47,7 @@ namespace Microsoft.AspNetCore.DataProtection
         /// <param name="expiration">An 'out' parameter which upon a successful unprotect
         /// operation receives the expiration date of the payload.</param>
         /// <returns>The plaintext form of the protected data.</returns>
-        /// <exception cref="CryptographicException">
+        /// <exception cref="System.Security.Cryptography.CryptographicException">
         /// Thrown if <paramref name="protectedData"/> is invalid, malformed, or expired.
         /// </exception>
         byte[] Unprotect(byte[] protectedData, out DateTimeOffset expiration);

+ 3 - 1
src/Microsoft.AspNetCore.DataProtection.Extensions/project.json

@@ -19,6 +19,8 @@
   },
   "compilationOptions": {
     "warningsAsErrors": true,
-    "keyFile": "../../tools/Key.snk"
+    "keyFile": "../../tools/Key.snk",
+    "nowarn": [ "CS1591" ],
+    "xmlDoc": true
   }
 }

+ 3 - 1
src/Microsoft.AspNetCore.DataProtection.SystemWeb/project.json

@@ -20,7 +20,9 @@
   },
   "compilationOptions": {
     "warningsAsErrors": true,
-    "keyFile": "../../tools/Key.snk"
+    "keyFile": "../../tools/Key.snk",
+    "nowarn": [ "CS1591" ],
+    "xmlDoc": true
   },
   "packInclude": {
     "content/net451/": "web.config.transform"

+ 2 - 1
src/Microsoft.AspNetCore.DataProtection/AuthenticatedEncryption/ConfigurationModel/ManagedAuthenticatedEncryptorConfiguration.cs

@@ -7,7 +7,8 @@ namespace Microsoft.AspNetCore.DataProtection.AuthenticatedEncryption.Configurat
 {
     /// <summary>
     /// Represents a configured authenticated encryption mechanism which uses
-    /// managed <see cref="SymmetricAlgorithm"/> and <see cref="KeyedHashAlgorithm"/> types.
+    /// managed <see cref="System.Security.Cryptography.SymmetricAlgorithm"/> and
+    /// <see cref="System.Security.Cryptography.KeyedHashAlgorithm"/> types.
     /// </summary>
     public sealed class ManagedAuthenticatedEncryptorConfiguration : IAuthenticatedEncryptorConfiguration, IInternalAuthenticatedEncryptorConfiguration
     {

+ 28 - 2
src/Microsoft.AspNetCore.DataProtection/DataProtectionConfiguration.cs

@@ -17,6 +17,7 @@ using System.Security.Cryptography.X509Certificates;
 
 namespace Microsoft.AspNetCore.DataProtection
 {
+#if !DOTNET5_4
     /// <summary>
     /// Provides access to configuration for the data protection system, which allows the
     /// developer to configure default cryptographic algorithms, key storage locations,
@@ -26,7 +27,7 @@ namespace Microsoft.AspNetCore.DataProtection
     /// <para>
     /// If the developer changes the at-rest key protection mechanism, it is intended that
     /// he also change the key storage location, and vice versa. For instance, a call to
-    /// <see cref="ProtectKeysWithCertificate(string)"/> should generally be accompanied by
+    /// <see cref="ProtectKeysWithCertificate(string)" /> should generally be accompanied by
     /// a call to <see cref="PersistKeysToFileSystem(DirectoryInfo)"/>, or exceptions may
     /// occur at runtime due to the data protection system not knowing where to persist keys.
     /// </para>
@@ -43,6 +44,31 @@ namespace Microsoft.AspNetCore.DataProtection
     /// contain existing keys that use older algorithms or protection mechanisms.
     /// </para>
     /// </remarks>
+#else
+    /// <summary>
+    /// Provides access to configuration for the data protection system, which allows the
+    /// developer to configure default cryptographic algorithms, key storage locations,
+    /// and the mechanism by which keys are protected at rest.
+    /// </summary>
+    /// <remarks>
+    /// <para>
+    /// If the developer changes the at-rest key protection mechanism, it is intended that
+    /// he also change the key storage location, and vice versa.
+    /// </para>
+    /// <para>
+    /// Similarly, when a developer modifies the default protected payload cryptographic
+    /// algorithms, it is intended that he also select an explitiy key storage location.
+    /// A call to <see cref="UseCryptographicAlgorithms(AuthenticatedEncryptionOptions)"/>
+    /// should therefore generally be paired with a call to <see cref="PersistKeysToFileSystem(DirectoryInfo)"/>,
+    /// for example.
+    /// </para>
+    /// <para>
+    /// When the default cryptographic algorithms or at-rest key protection mechanisms are
+    /// changed, they only affect <strong>new</strong> keys in the repository. The repository may
+    /// contain existing keys that use older algorithms or protection mechanisms.
+    /// </para>
+    /// </remarks>
+#endif
     public class DataProtectionConfiguration
     {
         /// <summary>
@@ -284,7 +310,7 @@ namespace Microsoft.AspNetCore.DataProtection
         /// <remarks>
         /// See https://msdn.microsoft.com/en-us/library/windows/desktop/hh769091(v=vs.85).aspx
         /// and https://msdn.microsoft.com/en-us/library/windows/desktop/hh706800(v=vs.85).aspx
-        /// for more information on valid values for the the <paramref name="descriptor"/>
+        /// for more information on valid values for the the <paramref name="protectionDescriptorRule"/>
         /// and <paramref name="flags"/> arguments.
         /// This API is only supported on Windows 8 / Windows Server 2012 and higher.
         /// </remarks>

+ 1 - 1
src/Microsoft.AspNetCore.DataProtection/RegistryPolicyResolver.cs

@@ -81,7 +81,7 @@ namespace Microsoft.AspNetCore.DataProtection
         }
 
         /// <summary>
-        /// Returns a <see cref="Policy"/> object from the default registry location.
+        /// Returns an array of <see cref="ServiceDescriptor"/>s from the default registry location.
         /// </summary>
         public static ServiceDescriptor[] ResolveDefaultPolicy()
         {

+ 1 - 0
src/Microsoft.AspNetCore.DataProtection/Repositories/RegistryXmlRepository.cs

@@ -39,6 +39,7 @@ namespace Microsoft.AspNetCore.DataProtection.Repositories
         /// Creates a <see cref="RegistryXmlRepository"/> with keys stored in the given registry key.
         /// </summary>
         /// <param name="registryKey">The registry key in which to persist key material.</param>
+        /// <param name="services">The <see cref="IServiceProvider"/> used to resolve services.</param>
         public RegistryXmlRepository(RegistryKey registryKey, IServiceProvider services)
         {
             if (registryKey == null)

+ 0 - 1
src/Microsoft.AspNetCore.DataProtection/XmlEncryption/DpapiNGXmlDecryptor.cs

@@ -43,7 +43,6 @@ namespace Microsoft.AspNetCore.DataProtection.XmlEncryption
         /// </summary>
         /// <param name="encryptedElement">An encrypted XML element.</param>
         /// <returns>The decrypted form of <paramref name="encryptedElement"/>.</returns>
-        /// <remarks>
         public XElement Decrypt(XElement encryptedElement)
         {
             if (encryptedElement == null)

+ 0 - 1
src/Microsoft.AspNetCore.DataProtection/XmlEncryption/DpapiXmlDecryptor.cs

@@ -40,7 +40,6 @@ namespace Microsoft.AspNetCore.DataProtection.XmlEncryption
         /// </summary>
         /// <param name="encryptedElement">An encrypted XML element.</param>
         /// <returns>The decrypted form of <paramref name="encryptedElement"/>.</returns>
-        /// <remarks>
         public XElement Decrypt(XElement encryptedElement)
         {
             if (encryptedElement == null)

+ 0 - 1
src/Microsoft.AspNetCore.DataProtection/XmlEncryption/EncryptedXmlDecryptor.cs

@@ -40,7 +40,6 @@ namespace Microsoft.AspNetCore.DataProtection.XmlEncryption
         /// </summary>
         /// <param name="encryptedElement">An encrypted XML element.</param>
         /// <returns>The decrypted form of <paramref name="encryptedElement"/>.</returns>
-        /// <remarks>
         public XElement Decrypt(XElement encryptedElement)
         {
             if (encryptedElement == null)

+ 0 - 1
src/Microsoft.AspNetCore.DataProtection/XmlEncryption/NullXmlDecryptor.cs

@@ -17,7 +17,6 @@ namespace Microsoft.AspNetCore.DataProtection.XmlEncryption
         /// </summary>
         /// <param name="encryptedElement">An encrypted XML element.</param>
         /// <returns>The decrypted form of <paramref name="encryptedElement"/>.</returns>
-        /// <remarks>
         public XElement Decrypt(XElement encryptedElement)
         {
             if (encryptedElement == null)

+ 3 - 1
src/Microsoft.AspNetCore.DataProtection/project.json

@@ -38,6 +38,8 @@
   "compilationOptions": {
     "allowUnsafe": true,
     "warningsAsErrors": true,
-    "keyFile": "../../tools/Key.snk"
+    "keyFile": "../../tools/Key.snk",
+    "nowarn": [ "CS1591" ],
+    "xmlDoc": true
   }
 }