public static MockWebUI ConfigureMockWebUI( IPlatformProxy platformProxy, AuthorizationResult authorizationResult, Dictionary <string, string> queryParamsToValidate) { return(ConfigureMockWebUI(platformProxy, authorizationResult, queryParamsToValidate, null)); }
public void TestInitialize() { TestCommon.ResetInternalStaticCaches(); _tcpInterceptor = Substitute.For <ITcpInterceptor>(); _platformProxy = Substitute.For <IPlatformProxy>(); _logger = Substitute.For <ICoreLogger>(); }
public LoginController(IPlatformProxy platformProxy,IPlatformRoutes platformRoutes,IApplicationSettings applicationSettings, IAppWallServices appWallServices) { _platformProxy = platformProxy; _platformRoutes = platformRoutes; _applicationSettings = applicationSettings; _appWallServices = appWallServices; }
public static void ConfigureMockWebUI(IPlatformProxy platformProxy, IWebUI webUi = null) { IWebUIFactory mockFactory = Substitute.For <IWebUIFactory>(); mockFactory.CreateAuthenticationDialog(Arg.Any <CoreUIParent>(), Arg.Any <RequestContext>()).Returns(webUi); platformProxy.SetWebUiFactory(mockFactory); }
public override void TestInitialize() { base.TestInitialize(); _tcpInterceptor = Substitute.For <IUriInterceptor>(); _platformProxy = Substitute.For <IPlatformProxy>(); _logger = Substitute.For <ICoreLogger>(); }
public LandingController(IPlatformProxy platformProxy, IBoardsRepository boardsRepository, IPlatformSettings platformSettings, IApplicationSettings applicationSettings) { _platformProxy = platformProxy; _boardsRepository = boardsRepository; _platformSettings = platformSettings; _applicationSettings = applicationSettings; }
public void Initialize() { TestCommon.ResetInternalStaticCaches(); _serviceBundle = TestCommon.CreateServiceBundleWithCustomHttpManager(null, clientId: ClientId); _logger = _serviceBundle.ApplicationLogger; _platformProxy = _serviceBundle.PlatformProxy; _crypto = _platformProxy.CryptographyManager; }
public HomeController(IPlatformProxy platformProxy, IPlatformSettings platformSettings, IImageService imageService, IBoardsRepository boardsRepository, IBoardItemsRepository boardItemsRepository) { _platformProxy = platformProxy; _platformSettings = platformSettings; _imageService = imageService; _boardsRepository = boardsRepository; _boardItemsRepository = boardItemsRepository; }
public AppLinksService(IPlatformProxy platformProxy, IApplicationSettings applicationSettings, IHashService hashService, IEntitiesRepository entitiesRepository, ILog log) { _platformProxy = platformProxy; _applicationSettings = applicationSettings; _hashService = hashService; _entitiesRepository = entitiesRepository; _log = log; _servicePath = _applicationSettings.AppLinkPath; }
public static string GetUploadEventName(IPlatformProxy platformProxy, EventType eventType, string appName) { string eventName = MatsConverter.AsString(eventType); string osPlatform = platformProxy.GetMatsOsPlatform(); return(GetUploadEventNameGeneric( eventName.ToUpperInvariant(), appName.ToUpperInvariant(), osPlatform.ToUpperInvariant())); }
public UserService(IPlatformProxy platformProxy, IApplicationSettings applicationSettings, IAuthService authService, IHashService hashService, ILog logger) { _platformProxy = platformProxy; _applicationSettings = applicationSettings; _authService = authService; _hashService = hashService; _logger = logger; _servicePath = _applicationSettings.UsersPath; }
public DefaultOsBrowserWebUi( IPlatformProxy proxy, ICoreLogger logger, /* for test */ ITcpInterceptor tcpInterceptor = null) { _logger = logger ?? throw new ArgumentNullException(nameof(logger)); _platformProxy = proxy ?? throw new ArgumentNullException(nameof(proxy)); _tcpInterceptor = tcpInterceptor ?? new TcpInterceptor(_logger); }
public void Initialize() { TestCommon.ResetInternalStaticCaches(); _myReceiver = new MyReceiver(); _serviceBundle = TestCommon.CreateServiceBundleWithCustomHttpManager(null, clientId: ClientId); _logger = _serviceBundle.DefaultLogger; _platformProxy = _serviceBundle.PlatformProxy; _crypto = _platformProxy.CryptographyManager; _telemetryManager = new TelemetryManager(_serviceBundle.Config, _platformProxy, _myReceiver.HandleTelemetryEvents); }
public PostLoginController(IPlatformProxy platformProxy, IApplicationSettings applicationSettings, IPlatformTokenProvider platformTokenProvider, IPlatformSettings platformSettings, IPlatformRoutes platformRoutes, IUsersApi usersApi, IGroupMemberRepository groupMemberRepository) { _platformTokenProvider = platformTokenProvider; _platformProxy = platformProxy; _applicationSettings = applicationSettings; _platformSettings = platformSettings; _platformRoutes = platformRoutes; _usersApi = usersApi; _groupMemberRepository = groupMemberRepository; }
public TelemetryManager( ApplicationConfiguration applicationConfiguration, IPlatformProxy platformProxy, TelemetryCallback telemetryCallback, bool onlySendFailureTelemetry = false) { _applicationConfiguration = applicationConfiguration; _platformProxy = platformProxy; Callback = telemetryCallback; _onlySendFailureTelemetry = onlySendFailureTelemetry; }
public DefaultOsBrowserWebUi( IPlatformProxy proxy, ICoreLogger logger, SystemWebViewOptions webViewOptions, /* for test */ IUriInterceptor uriInterceptor = null) { _logger = logger ?? throw new ArgumentNullException(nameof(logger)); _webViewOptions = webViewOptions; _platformProxy = proxy ?? throw new ArgumentNullException(nameof(proxy)); _uriInterceptor = uriInterceptor ?? new HttpListenerInterceptor(_logger); }
public TelemetryManager( IApplicationConfiguration applicationConfiguration, IPlatformProxy platformProxy, TelemetryCallback telemetryCallback, bool onlySendFailureTelemetry = false) { _mostRecentStoppedApiEvent = null; _applicationConfiguration = applicationConfiguration; _platformProxy = platformProxy; Callback = telemetryCallback; _onlySendFailureTelemetry = onlySendFailureTelemetry; }
public DefaultEvent(IPlatformProxy platformProxy, string correlationId, string clientId, IDictionary <string, int> eventCount) : base(EventNamePrefix + "default_event", correlationId) { this[EventNamePrefix + "client_id"] = clientId; this[EventNamePrefix + "sdk_platform"] = platformProxy.GetProductName()?.ToLowerInvariant(); this[EventNamePrefix + "sdk_version"] = MsalIdHelper.GetMsalVersion(); this[EventNamePrefix + "application_name"] = HashPersonalIdentifier(platformProxy.CryptographyManager, platformProxy.GetCallingApplicationName()?.ToLowerInvariant()); this[EventNamePrefix + "application_version"] = HashPersonalIdentifier(platformProxy.CryptographyManager, platformProxy.GetCallingApplicationVersion()?.ToLowerInvariant()); this[EventNamePrefix + "device_id"] = HashPersonalIdentifier(platformProxy.CryptographyManager, platformProxy.GetDeviceId()?.ToLowerInvariant()); this[MsalTelemetryBlobEventNames.UiEventCountTelemetryBatchKey] = GetEventCount(EventNamePrefix + "ui_event", eventCount); this[MsalTelemetryBlobEventNames.HttpEventCountTelemetryBatchKey] = GetEventCount(EventNamePrefix + "http_event", eventCount); this[MsalTelemetryBlobEventNames.CacheEventCountConstStrKey] = GetEventCount(EventNamePrefix + "cache_event", eventCount); }
public static T WithCachePartitioningAsserts <T>( this AbstractApplicationBuilder <T> builder, IPlatformProxy platformProxy) where T : AbstractApplicationBuilder <T> { (platformProxy as AbstractPlatformProxy).UserTokenCacheAccessorForTest = new UserAccessorWithPartitionAsserts(new NullLogger(), null); (platformProxy as AbstractPlatformProxy).AppTokenCacheAccessorForTest = new AppAccessorWithPartitionAsserts(new NullLogger(), null); builder.Config.PlatformProxy = platformProxy; return((T)builder); }
public static void ConfigureMockWebUI( IPlatformProxy platformProxy, AuthorizationResult authorizationResult, Dictionary <string, string> queryParamsToValidate, string environment) { MockWebUI webUi = new MockWebUI { QueryParamsToValidate = queryParamsToValidate, MockResult = authorizationResult, ExpectedEnvironment = environment }; ConfigureMockWebUI(platformProxy, webUi); }
public void SendTrackInformationIsBeingSent() { IPlatformProxy proxy = IntegrationProxy.GetInstance(new IntegrationProxyArgs.IntegrationProxyArgsBuilder().BuildDefault()).Proxy; var input = new OrderTrackingInformation() { Order_id = 12, Event = new OrderTrackingEvent() { Date = DateTime.Now, Status_id = 1 } }; Assert.True(proxy.SendTrackNotification(input).IsSuccess); }
internal PublicClientApplication( IHttpManager httpManager, IStorageManager storageManager, IBrowserFactory browserFactory, IGuidService guidService, ITelemetryManager telemetryManager, EnvironmentMetadata environmentMetadata, MsalClientConfiguration msalClientConfiguration) { _platformProxy = PlatformProxyFactory.GetPlatformProxy(); _httpManager = httpManager ?? new HttpManager(new HttpClientFactory(), msalClientConfiguration); _storageManager = storageManager ?? _platformProxy.CreateStorageManager(); _browserFactory = browserFactory ?? _platformProxy.CreateBrowserFactory(); _guidService = guidService ?? new GuidService(); _telemetryManager = telemetryManager ?? new TelemetryManager(msalClientConfiguration); _environmentMetadata = environmentMetadata ?? new EnvironmentMetadata(); _msalClientConfiguration = msalClientConfiguration; }
private TelemetryClient( IApplicationConfiguration applicationConfiguration, IPlatformProxy platformProxy, IErrorStore errorStore, IUploader uploader, IActionStore actionStore, IScenarioStore scenarioStore, ContextStore contextStore, bool isScenarioUploadDisabled) { TelemetryManager = new TelemetryManager(applicationConfiguration, platformProxy, ProcessTelemetryCallback); _errorStore = errorStore; _uploader = uploader; _actionStore = actionStore; _scenarioStore = scenarioStore; _contextStore = contextStore; _isScenarioUploadDisabled = isScenarioUploadDisabled; }
public ApiNewsfeedService(IPlatformProxy platformProxy) { _platformProxy = platformProxy; }
public static ITelemetryClient CreateMats( IApplicationConfiguration applicationConfiguration, IPlatformProxy platformProxy, ITelemetryConfig telemetryConfig) { string dpti = platformProxy.GetDevicePlatformTelemetryId(); if (!IsDeviceEnabled(telemetryConfig.AudienceType, dpti)) { return(null); } string deviceNetworkState = platformProxy.GetDeviceNetworkState(); int osPlatformCode = platformProxy.GetMatsOsPlatformCode(); bool enableAggregation = true; IEventFilter eventFilter = new EventFilter(enableAggregation); var errorStore = new ErrorStore(); var scenarioStore = new ScenarioStore(TimeConstants.ScenarioTimeoutMilliseconds, errorStore); var allowedScopes = new HashSet <string>(); // TODO: need to determine what MATS was doing with the AllowedScopes and DeniedScopes values in the C++ impl // and possibly expose this value in the ITelemetryConfig interface. //if (telemetryConfig.AllowedScopes != null) //{ // foreach (string s in telemetryConfig.AllowedScopes) // { // allowedScopes.Add(s); // } //} var actionStore = new ActionStore( TimeConstants.ActionTimeoutMilliseconds, TimeConstants.AggregationWindowMilliseconds, errorStore, eventFilter, allowedScopes); var contextStore = ContextStore.CreateContextStore( telemetryConfig.AudienceType, applicationConfiguration.ClientName, applicationConfiguration.ClientVersion, dpti, deviceNetworkState, telemetryConfig.SessionId, osPlatformCode); IUploader uploader = new TelemetryUploader(telemetryConfig.DispatchAction, platformProxy, applicationConfiguration.ClientName); // it's this way in mats c++ bool isScenarioUploadDisabled = true; return(new TelemetryClient( applicationConfiguration, platformProxy, errorStore, uploader, actionStore, scenarioStore, contextStore, isScenarioUploadDisabled)); }
public ApiUsersService(IPlatformProxy platformProxy) { _platformProxy = platformProxy; }
public LandingController(IPlatformProxy platformProxy,IPlatformRoutes platformRoutes) { _platformProxy = platformProxy; _platformRoutes = platformRoutes; }
public static MockWebUI ConfigureMockWebUI(IPlatformProxy platformProxy, AuthorizationResult authorizationResult) { return(ConfigureMockWebUI(platformProxy, authorizationResult, new Dictionary <string, string>())); }
public TelemetryUploader(Action <ITelemetryEventPayload> dispatchAction, IPlatformProxy platformProxy, string appName) { _dispatchAction = dispatchAction; _platformProxy = platformProxy; AppName = appName; }
public StorageManager(IPlatformProxy platformProxy, IStorageWorker storageWorker, IAdalLegacyCacheManager adalLegacyCacheManager = null) { _storageWorker = storageWorker; AdalLegacyCacheManager = adalLegacyCacheManager ?? new AdalLegacyCacheManager(platformProxy.CreateLegacyCachePersistence()); }
public static IMatsTelemetryClient CreateMats(IApplicationConfiguration applicationConfiguration, IPlatformProxy platformProxy, IMatsConfig matsConfig) { string dpti = platformProxy.GetDevicePlatformTelemetryId(); if (!IsDeviceEnabled(matsConfig.AudienceType, dpti)) { return(null); } string deviceNetworkState = platformProxy.GetDeviceNetworkState(); int osPlatformCode = platformProxy.GetMatsOsPlatformCode(); bool enableAggregation = true; IEventFilter eventFilter = new EventFilter(enableAggregation); var errorStore = new ErrorStore(); var scenarioStore = new ScenarioStore(TimeConstants.ScenarioTimeoutMilliseconds, errorStore); var allowedScopes = new HashSet <string>(); if (matsConfig.AllowedScopes != null) { foreach (string s in matsConfig.AllowedScopes) { allowedScopes.Add(s); } } var actionStore = new ActionStore( TimeConstants.ActionTimeoutMilliseconds, TimeConstants.AggregationWindowMilliseconds, errorStore, eventFilter, allowedScopes); var contextStore = ContextStore.CreateContextStore( matsConfig.AudienceType, applicationConfiguration.ClientName, applicationConfiguration.ClientVersion, dpti, deviceNetworkState, matsConfig.SessionId, osPlatformCode); IUploader uploader = new TelemetryUploader(matsConfig.DispatchAction, platformProxy, applicationConfiguration.ClientName); // it's this way in mats c++ bool isScenarioUploadDisabled = true; return(new MatsTelemetryClient( applicationConfiguration, platformProxy, errorStore, uploader, actionStore, scenarioStore, contextStore, isScenarioUploadDisabled)); }
public AppService(IPlatformProxy platformProxy, IApplicationSettings applicationSettings) { _platformProxy = platformProxy; _applicationSettings = applicationSettings; _servicePath = _applicationSettings.AppPath; }
public AppWallServices(IPlatformProxy platformProxy) { _platformProxy = platformProxy; }
public UsersApi(IPlatformProxy platformProxy) : base(platformProxy) { }
public AuthApi(IPlatformProxy platformProxy) : base(platformProxy) { }
public ApiProductsService(IPlatformProxy platformProxy) { _platformProxy = platformProxy; }
internal T WithPlatformProxy(IPlatformProxy platformProxy) { Config.PlatformProxy = platformProxy; return((T)this); }
public void SetPlatformProxyForTest(IPlatformProxy platformProxy) { PlatformProxy = platformProxy; }
public HomeController(IPlatformProxy platformProxy, IApplicationSettings applicationSettings, IPlatformSettings platformSettings) { _platformProxy = platformProxy; _applicationSettings = applicationSettings; _platformSettings = platformSettings; }
public TagController(IPlatformProxy platformProxy) { _platformProxy = platformProxy; }
public TelemetryUploader(Action <IMatsTelemetryBatch> dispatchAction, IPlatformProxy platformProxy, string appName) { _dispatchAction = dispatchAction; _platformProxy = platformProxy; AppName = appName; }