Beispiel #1
0
        public IApiObfuscatorBuilder ForRequest()
        {
            var sharedStare = new ApiSharedState <string>(_sharedState);

            IApiObfuscatorBuilder methodDefinition = new ApiObfuscatorBuilder(new ApiSharedState <string>(sharedStare) as IApiSharedState <string>);

            _methodDefinitions.Add(methodDefinition as IApiMethodDefinition);

            return(methodDefinition);
        }
 internal ApiSharedState(ApiSharedState sharedState)
 {
     ResponseSerializer = sharedState.ResponseSerializer;
     RequestType        = sharedState.RequestType;
     RequestContentType = sharedState.RequestContentType;
     WhenConditions     = new List <Parameter>(sharedState.WhenConditions);
     TamperRules        = new List <Parameter>(sharedState.TamperRules);
     AbortRequest       = sharedState.AbortRequest;
     StrTamperFunc      = sharedState.StrTamperFunc;
     StrWhenCondition   = sharedState.StrWhenCondition;
 }
Beispiel #3
0
        internal ApiBuilder()
        {
            _sharedState = new ApiSharedState()
            {
                ResponseSerializer = new JsonResponseSerializer(),
                WhenConditions     = new List <Parameter>(),
                TamperRules        = new List <Parameter>(),
                RequestContentType = RequestContentTypeEnum.Json,
            };

            _methodDefinitions = new List <IApiMethodDefinition>();
        }
Beispiel #4
0
        public IApiObfuscatorBuilder ForRequest(Func <string, bool> condition)
        {
            var sharedStare = new ApiSharedState(_sharedState)
            {
                StrWhenCondition = condition,
            };

            IApiObfuscatorBuilder methodDefinition = new ApiObfuscatorBuilder(new ApiSharedState <string>(sharedStare) as IApiSharedState <string>);

            _methodDefinitions.Add(methodDefinition as IApiMethodDefinition);

            return(methodDefinition);
        }
Beispiel #5
0
        public IApiObfuscatorBuilder <TRequest> ForRequest <TRequest>(Func <TRequest, bool> condition) where TRequest : class
        {
            var sharedStare = new ApiSharedState <TRequest>(_sharedState)
            {
                WhenCondition = condition,
                RequestType   = typeof(TRequest)
            };

            IApiObfuscatorBuilder <TRequest> methodDefinition = new ApiObfuscatorBuilder <TRequest>(new ApiSharedState <TRequest>(sharedStare));

            _methodDefinitions.Add(methodDefinition as IApiMethodDefinition);

            return(methodDefinition);
        }