public MongoDbNonceStoreSettingsTests()
 {
     _sut = new MongoDbNonceStoreSettings {
         ConnectionString = "mongodb://localhost:27017/DbForTests?connectTimeoutMS=60000",
         CollectionName   = "signaturenonces"
     };
 }
Ejemplo n.º 2
0
        public static IHttpMessageSigningVerificationBuilder UseMongoDbNonceStore(this IHttpMessageSigningVerificationBuilder builder, MongoDbNonceStoreSettings nonceStoreSettings)
        {
            if (builder == null)
            {
                throw new ArgumentNullException(nameof(builder));
            }
            if (nonceStoreSettings == null)
            {
                throw new ArgumentNullException(nameof(nonceStoreSettings));
            }

            return(builder.UseMongoDbNonceStore(prov => nonceStoreSettings));
        }
Ejemplo n.º 3
0
        /// <summary>
        ///     Adds http message signature verification registrations for MongoDb to the specified
        ///     <see cref="T:Microsoft.Extensions.DependencyInjection.IServiceCollection" />.
        /// </summary>
        /// <param name="services">
        ///     The <see cref="T:Microsoft.Extensions.DependencyInjection.IServiceCollection" /> to add the
        ///     registrations to.
        /// </param>
        /// <param name="nonceStoreSettings">The settings for the Mongo connection.</param>
        /// <returns>
        ///     The <see cref="T:Microsoft.Extensions.DependencyInjection.IServiceCollection" /> to which the registrations
        ///     were added.
        /// </returns>
        public static IServiceCollection AddMongoDbNonceStore(this IServiceCollection services, MongoDbNonceStoreSettings nonceStoreSettings)
        {
            if (services == null)
            {
                throw new ArgumentNullException(nameof(services));
            }
            if (nonceStoreSettings == null)
            {
                throw new ArgumentNullException(nameof(nonceStoreSettings));
            }

            return(services.AddMongoDbNonceStore(prov => nonceStoreSettings));
        }