public MongoDbClientStoreSettingsTests() { _sut = new MongoDbClientStoreSettings { ConnectionString = "mongodb://localhost:27017/DbForTests?connectTimeoutMS=60000", CollectionName = "signatureclients", ClientCacheEntryExpiration = TimeSpan.FromMinutes(3) }; }
/// <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="clientStoreSettings">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 AddMongoDbClientStore(this IServiceCollection services, MongoDbClientStoreSettings clientStoreSettings) { if (services == null) { throw new ArgumentNullException(nameof(services)); } if (clientStoreSettings == null) { throw new ArgumentNullException(nameof(clientStoreSettings)); } return(services.AddMongoDbClientStore(prov => clientStoreSettings)); }
public static IHttpMessageSigningVerificationBuilder UseMongoDbClientStore(this IHttpMessageSigningVerificationBuilder builder, MongoDbClientStoreSettings clientStoreSettings) { if (builder == null) { throw new ArgumentNullException(nameof(builder)); } if (clientStoreSettings == null) { throw new ArgumentNullException(nameof(clientStoreSettings)); } return(builder.UseMongoDbClientStore(prov => clientStoreSettings)); }