Ejemplo n.º 1
0
 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;
 }
Ejemplo n.º 2
0
        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));
        }
Ejemplo n.º 3
0
 public static int GetCacheMaxAgeSecondsOrDefault(this HikkabaConfiguration settings)
 {
     if (settings == null || settings.CacheMaxAgeSeconds <= 0)
     {
         return(Convert.ToInt32(TimeSpan.FromDays(365).TotalSeconds));
     }
     else
     {
         return(settings.CacheMaxAgeSeconds);
     }
 }
Ejemplo n.º 4
0
 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;
 }
Ejemplo n.º 5
0
 public AttachmentCategorizer(IOptions <HikkabaConfiguration> settings)
 {
     _hikkabaConfiguration = settings.Value;
 }