public void Can_Create_Wrapper_With_DataLoaderContextProvider_Support() { var wrapper = UserContextWrapper.Create(new UserContextWithDataLoaderContextProvider(), new DependencyInjector()); Assert.IsNotNull(wrapper); Assert.IsInstanceOfType(wrapper, typeof(IDataLoaderContextProvider)); }
public TokenController(IBudgeterCache cache, IEnvironmentRequester environmentRequester, AuthContextWrapper authContext, UserContextWrapper userContext) { Cache = cache; EnvironmentRequester = environmentRequester; AuthContext = authContext; UserContext = userContext; }
public void Can_Create_Wrapper_Without_DataLoaderContextProvider_Support() { var wrapper = UserContextWrapper.Create(new UserContext(), new DependencyInjector()); Assert.IsNotNull(wrapper); Assert.IsFalse(wrapper is IDataLoaderContextProvider); }
public FederatedIdentityTokenLogic(IEnvironmentRequester environmentRequester, UserContextWrapper userContext, AuthContextWrapper authContext, IBudgeterCache cache) { EnvironmentRequester = environmentRequester; UserContext = userContext; AuthContext = authContext; Cache = cache; }
public UserController(IBudgeterCache cache, IBudgeterLock budgeterLock, ISettingRequester settingRequester) { Cache = cache; BudgeterLock = budgeterLock; SettingRequester = settingRequester; UserContext = new UserContextWrapper(); AuthContext = new AuthContextWrapper(); }
public TokenLogic(IEnvironmentRequester environmentRequester, IBudgeterCache cache, AuthContextWrapper authContext, UserContextWrapper userContext, string authHeader, TokenRequest tokenRequest) { EnvironmentRequester = environmentRequester; Cache = cache; AuthContext = authContext; UserContext = userContext; AuthHeader = authHeader; TokenRequest = tokenRequest; }
public TokenIssuer(IEnvironmentRequester environmentRequester, AuthContextWrapper authContext, UserContextWrapper userContext, IBudgeterCache cache) { AuthContext = authContext; UserContext = userContext; Cache = cache; SecretKey = environmentRequester.GetVariable("TokenSecretKey"); Issuer = environmentRequester.GetVariable("Issuer"); }
public RegistrationLogic(IBudgeterCache cache, IBudgeterLock budgeterLock, AuthContextWrapper authContext, UserContextWrapper userContext, ISettingRequester settingRequester, bool isAdmin) { Cache = cache; BudgeterLock = budgeterLock; SettingRequester = settingRequester; AuthContext = authContext; UserContext = userContext; IsAdmin = isAdmin; }
public GoogleAuthController(IGoogleOAuthClient googleOAuthClient, ISettingRequester settingRequester, IEnvironmentRequester environmentRequester, IBudgeterCache cache, IBudgeterLock budgeterLock) { GoogleOAuthClient = googleOAuthClient; SettingRequester = settingRequester; EnvironmentRequester = environmentRequester; Cache = cache; UserContext = new UserContextWrapper(); AuthContext = new AuthContextWrapper(); BudgeterLock = budgeterLock; }
public GoogleSSOLogic(IGoogleOAuthClient googleOAuthClient, IEnvironmentRequester environmentRequester, ISettingRequester settingRequester, IBudgeterCache cache, UserContextWrapper userContext, AuthContextWrapper authContext, IBudgeterLock budgeterLock) { GoogleOAuthClient = googleOAuthClient; EnvironmentRequester = environmentRequester; SettingRequester = settingRequester; Cache = cache; UserContext = userContext; AuthContext = authContext; BudgeterLock = budgeterLock; }
public async Task <ExecutionResult> ExecuteAsync(ExecutionContext context) { var outerUserContextWrapper = context.UserContext; var userContext = (context.UserContext as IUserContextAccessor)?.UserContext; try { context.UserContext = UserContextWrapper.Create(userContext, _injector); return(await _innerStrategy.ExecuteAsync(context)); } finally { context.UserContext = outerUserContextWrapper; } }
internal async Task <ExecutionResult> Execute( object rootObject, string query, string operationName, Inputs inputs, IUserContext userContext, IDependencyInjector dependencyInjector, ComplexityConfiguration complexityConfiguration, bool enableValidation = true, bool enableProfiling = false, IEnumerable <IValidationRule> rules = null, CancellationToken cancellationToken = default, IEnumerable <IDocumentExecutionListener> listeners = null) { if (!enableValidation) { rules = new[] { new NoopValidationRule() }; } var configuration = new ExecutionOptions { Schema = _schema, Root = rootObject, Query = query, OperationName = operationName, Inputs = inputs, UserContext = UserContextWrapper.Create(userContext, dependencyInjector ?? new WrappedDependencyInjector(_constructor.TypeResolutionDelegate)), ValidationRules = rules != null && rules.Any() ? rules : null, ComplexityConfiguration = complexityConfiguration, CancellationToken = cancellationToken, ExposeExceptions = _exposeExceptions }; if (listeners != null && listeners.Any()) { foreach (var listener in listeners) { configuration.Listeners.Add(listener); } } if (userContext is IDataLoaderContextProvider) { configuration.Listeners.Add(new DataLoaderListener()); } if (enableProfiling) { configuration.FieldMiddleware.Use <InstrumentFieldsMiddleware>(); } foreach (var middleware in _middleware) { configuration.FieldMiddleware.Use(middleware); } var result = await _documentExecutor.ExecuteAsync(configuration).ConfigureAwait(false); if (result.Errors != null && _errorTransformation != null) { result.Errors = _errorTransformation.Transform(result.Errors); } return(result); }
public UserRoleController(IBudgeterCache cache) { Cache = cache; Context = new UserContextWrapper(); }
public UserProfilePropertyController(IBudgeterCache cache, IBudgeterLock budgeterLock) { Cache = cache; BudgeterLock = budgeterLock; Context = new UserContextWrapper(); }
public ProfilePropertyController(IBudgeterCache cache) { Cache = cache; Context = new UserContextWrapper(); }
public void Should_Forward_DataLoaderContextProvider_FetchData_Call() { var wrapper = UserContextWrapper.Create(new UserContextWithDataLoaderContextProvider(), new DependencyInjector()); Assert.ThrowsException <FetchDataCalledException>(() => (wrapper as IDataLoaderContextProvider).FetchData(CancellationToken.None)); }
public UsernameController(IBudgeterCache cache, ISettingRequester settingRequester) { Cache = cache; SettingRequester = settingRequester; Context = new UserContextWrapper(); }
public SearchLogic(IBudgeterCache cache, UserContextWrapper context) { Context = context; Cache = cache; }
public UserGridLogic(UserContextWrapper context) { Context = context; }
internal async Task <ExecutionResult> Execute( object rootObject, string query, string operationName, Inputs inputs, IUserContext userContext, IDependencyInjector dependencyInjector, ComplexityConfiguration complexityConfiguration, bool enableValidation = true, bool enableProfiling = false, IEnumerable <IValidationRule> rules = null, CancellationToken cancellationToken = default(CancellationToken)) { if (!enableValidation) { rules = new[] { new NoopValidationRule() }; } var configuration = new ExecutionOptions { Schema = _schema, Root = rootObject, Query = query, OperationName = operationName, Inputs = inputs, UserContext = UserContextWrapper.Create(userContext, dependencyInjector ?? new WrappedDependencyInjector(_constructor.TypeResolutionDelegate)), ValidationRules = rules != null && rules.Any() ? rules : null, ComplexityConfiguration = complexityConfiguration, CancellationToken = cancellationToken, }; if (userContext is IDataLoaderContextProvider) { configuration.Listeners.Add(new DataLoaderListener()); } if (enableProfiling) { configuration.FieldMiddleware.Use <InstrumentFieldsMiddleware>(); } foreach (var middleware in _middleware) { configuration.FieldMiddleware.Use(middleware); } var result = await _documentExecutor.ExecuteAsync(configuration).ConfigureAwait(false); if (result.Errors != null) { var errors = new ExecutionErrors(); foreach (var executionError in result.Errors) { var exception = new FieldResolutionException(executionError); var error = new ExecutionError(exception.Message, exception); foreach (var location in executionError.Locations ?? new ErrorLocation[0]) { error.AddLocation(location.Line, location.Column); } error.Path.AddRange(executionError.Path); errors.Add(error); } result.Errors = errors; } return(result); }
public SearchController(IBudgeterCache cache) { Cache = cache; Context = new UserContextWrapper(); }
public UserRoleLogic(IBudgeterCache cache, UserContextWrapper context) { Cache = cache; Context = context; }
public UsernameLogic(IBudgeterCache cache, ISettingRequester settingRequester, UserContextWrapper context) { Context = context; Cache = cache; SettingRequester = settingRequester; }
public PasswordResetLogic(IBudgeterCache cache, AuthContextWrapper authContext, UserContextWrapper userContext) { AuthContext = authContext; UserContext = userContext; Cache = cache; }
public UserProfileUpdater(IBudgeterCache cache, IBudgeterLock budgeterLock, UserContextWrapper context) { Cache = cache; BudgeterLock = budgeterLock; Context = context; }
public UserProfilePropertyLogic(IBudgeterCache cache, UserContextWrapper context) { Cache = cache; Context = context; }
public PasswordController(IBudgeterCache cache) { UserContext = new UserContextWrapper(); AuthContext = new AuthContextWrapper(); Cache = cache; }