public PostService( IStorageProviderFactory storageProviderFactory, ILogger <PostService> logger, IOptions <HikkabaConfiguration> settings, IBanService banService, ICryptoService cryptoService, IAudioService audioService, IDocumentService documentService, IPictureService pictureService, IVideoService videoService, IThumbnailGenerator thumbnailGenerator, IAttachmentCategorizer attachmentCategorizer, IMapper mapper, ApplicationDbContext context, UserManager <ApplicationUser> userManager, ICategoryToModeratorService categoryToModeratorService) : base(mapper, context, userManager) { _storageProvider = storageProviderFactory.CreateStorageProvider(); _logger = logger; _banService = banService; _hikkabaConfiguration = settings.Value; _cryptoService = cryptoService; _audioService = audioService; _documentService = documentService; _pictureService = pictureService; _videoService = videoService; _thumbnailGenerator = thumbnailGenerator; _attachmentCategorizer = attachmentCategorizer; _categoryToModeratorService = categoryToModeratorService; }
public static X509Certificate2 LoadCertificate(HikkabaConfiguration configuration) { var certBase64 = configuration.AuthCertificateBase64; var certPass = configuration.AuthCertificatePassword; var certBytes = Convert.FromBase64String(certBase64); return(new X509Certificate2(certBytes, certPass, X509KeyStorageFlags.MachineKeySet)); }
public static int GetCacheMaxAgeSecondsOrDefault(this HikkabaConfiguration settings) { if (settings == null || settings.CacheMaxAgeSeconds <= 0) { return(Convert.ToInt32(TimeSpan.FromDays(365).TotalSeconds)); } else { return(settings.CacheMaxAgeSeconds); } }
public ThreadService(IMapper mapper, ApplicationDbContext context, IStorageProvider storageProvider, IOptions <HikkabaConfiguration> settings, ICategoryToModeratorService categoryToModeratorService, IBanService banService, ICryptoService cryptoService, IThumbnailGenerator thumbnailGenerator, IAttachmentCategorizer attachmentCategorizer) : base(mapper) { _mapper = mapper; _context = context; _storageProvider = storageProvider; _hikkabaConfiguration = settings.Value; _categoryToModeratorService = categoryToModeratorService; _banService = banService; _cryptoService = cryptoService; _thumbnailGenerator = thumbnailGenerator; _attachmentCategorizer = attachmentCategorizer; }
public AttachmentCategorizer(IOptions <HikkabaConfiguration> settings) { _hikkabaConfiguration = settings.Value; }