示例#1
0
 public PageViewModel(
     IBlogConfig blogConfig,
     IHttpContextAccessor httpContextAccessor,
     IAesEncryptor aceEncryptor)
     : base(blogConfig, httpContextAccessor, aceEncryptor)
 {
 }
 public RegisterUserCommandHandler(IUserRepository userRepository, IValidator <RegisterUserCommand> validator, IEcdsa ecdsa, IAesEncryptor encryptor)
 {
     _userRepository = userRepository;
     _validator      = validator;
     _ecdsa          = ecdsa;
     _encryptor      = encryptor;
 }
示例#3
0
 public CommonFactory(
     ILogger <CommonFactory> logger,
     IOptions <AppSettings> settings,
     IMapper mapper,
     IBlogConfig blogConfig,
     IAesEncryptor aesEncryption,
     IHttpContextAccessor httpContextAccessor)
 {
     if (logger != null)
     {
         this.Logger = logger;
     }
     if (settings != null)
     {
         this.Settings = settings;
     }
     if (mapper != null)
     {
         this.Mapper = mapper;
     }
     if (blogConfig != null)
     {
         this.BlogConfig = blogConfig;
     }
     if (aesEncryption != null)
     {
         this.AesEncryption = aesEncryption;
     }
     if (httpContextAccessor != null)
     {
         this.HttpContextAccessor = httpContextAccessor;
     }
 }
示例#4
0
 public SignShareFileCommandHandler(IShareRepository shareRepository, IUserRepository userRepository, IFileRepository fileRepository, IAesEncryptor encryptor, IEcdsa ecdsa)
 {
     _shareRepository = shareRepository;
     _userRepository  = userRepository;
     _fileRepository  = fileRepository;
     _encryptor       = encryptor;
     _ecdsa           = ecdsa;
 }
示例#5
0
 public PostViewViewModel(
     IBlogConfig blogConfig,
     IHttpContextAccessor httpContextAccessor,
     IAesEncryptor aceEncryptor)
     : base(blogConfig, httpContextAccessor, aceEncryptor)
 {
     RelatedPosts = new List <RelatedPostViewModel>();
 }
示例#6
0
        public BlogConfig(
            ILogger <BlogConfig> logger,
            IAesEncryptor encryptionService,
            IConfiguration configuration)
        {
            _encryptionService = encryptionService;
            _logger            = logger;

            BlogOwnerSettings = new BlogOwnerSettings();
            ContentSettings   = new ContentSettings();
            GeneralSettings   = new GeneralSettings();
            EmailSettings     = new EmailSettings();
            FeedSettings      = new FeedSettings();
            WatermarkSettings = new WatermarkSettings();

            Initialize();
        }
示例#7
0
        public BaseVM(IBlogConfig blogConfig, IHttpContextAccessor httpContextAccessor, IAesEncryptor aceEncryptor)
        {
            _blogConfig          = blogConfig;
            _httpContextAccessor = httpContextAccessor;
            this._aceEncryptor   = aceEncryptor;
            var data = new TokenValidateViewModel
            {
                SessionId = Guid.NewGuid(),
                Time      = DateTime.Now.ToFileTime(),
                Token     = CodeMazeConfiguration.TokenValidatePost
            };

            MazeToken = _aceEncryptor.Encrypt(JsonConvert.SerializeObject(data));

            if (_httpContextAccessor.HttpContext.Session.HasValue(SessionHelper.SessionLogin))
            {
                UserClaim = _httpContextAccessor.HttpContext.Session.Get <UserClaim>(SessionHelper.SessionLogin);
            }
        }
示例#8
0
 /// <summary>
 /// Initializes a new instance of the <see cref="DataOperator"/> class.
 /// </summary>
 /// <param name="Encryptor">The encryptor.</param>
 /// <param name="source">The source.</param>
 /// <exception cref="ArgumentNullException">source</exception>
 public DataOperator(IAesEncryptor Encryptor, string source)
 {
     _Encryptor = Encryptor ?? null;
     Source     = source ?? throw new ArgumentNullException(nameof(source));
 }
示例#9
0
 public UserMapper(IAesEncryptor encryptor)
 {
     _encryptor = encryptor;
 }
示例#10
0
 public UserRepository(IAesEncryptor encryptor)
 {
     _encryptor = encryptor;
 }