public async Task InvokeAsync(HttpContext context, IAesSerializer serializer)
        {
            var path = context.Request.Path;

            if (path.HasValue && ExclusionSegments.Any(s => path.StartsWithSegments(s)))
            {
                await _next.Invoke(context);
            }
            else
            {
                if (!serializer.HasKey)
                {
                    context.Response.Clear();
                    context.Response.StatusCode  = 503;
                    context.Response.ContentType = "application/json";
                    var json = ErrorResponse.Create(ErrorMessage).ToJson();
                    await context.Response.WriteAsync(json);

                    return;
                }

                await _next.Invoke(context);
            }
        }
예제 #2
0
 public EncryptionService(IAesSerializer serializer)
 {
     _serializer = serializer;
     _encryptedPropertiesCache = new ConcurrentDictionary <Type, List <PropertyInfo> >();
 }
 public EncryptionKeyController(IAesSerializer serializer, ILogFactory logFactory)
 {
     _serializer = serializer;
     _log        = logFactory.CreateLog(this);
 }