示例#1
0
        public static BaseValueSegmentProxy GetBaseValueSegmentProxy()
        {
            var securityConfiguration = new SecurityConfiguration();
            var logger                = new InternalLogger(securityConfiguration);
            var webContext            = new WebContext();
            var jwtTokenRequestClient = new JwtTokenRequestClient(securityConfiguration, logger, new UserProfileId(webContext, logger), new JwtTokenCache(webContext));

            var securityTokenServiceProxy = new SecurityTokenServiceProxy(jwtTokenRequestClient, securityConfiguration);
            var httpClientProxy           = new HttpClientProxy(securityTokenServiceProxy);
            var configuration             = new Configuration();
            var restClient = new RestClient(configuration, httpClientProxy);

            return(new BaseValueSegmentProxy(httpClientProxy, new UrlServices(restClient, configuration)));
        }
示例#2
0
        private static (HttpClientProxy httpClientProxy, Configuration configuration, RestClientWithSecurity restClient) GetHttpClientProxyConfigurationRestClient()
        {
            var securityConfiguration = new SecurityConfiguration();
            var logger                = new InternalLogger(securityConfiguration);
            var webContext            = new WebContext();
            var jwtTokenRequestClient = new JwtTokenRequestClient(securityConfiguration, logger, new UserProfileId(webContext, logger), new JwtTokenCache(webContext));

            var securityTokenServiceProxy = new SecurityTokenServiceProxy(jwtTokenRequestClient, securityConfiguration);
            var httpClientProxy           = new HttpClientProxy(securityTokenServiceProxy);
            var configuration             = new Configuration();
            var restClient = new RestClientWithSecurity(configuration, httpClientProxy);

            return(httpClientProxy, configuration, restClient);
        }
示例#3
0
        public static bool IsFeatureToggleEnabled(Features feature)
        {
            var            securityConfiguration = new SecurityConfiguration();
            var            internalLogger        = new InternalLogger(securityConfiguration);
            var            webContext            = new WebContext();
            IUserProfileId userProfileId         = new UserProfileId(webContext, internalLogger);

            var jwt = new JwtTokenRequestClient(securityConfiguration, internalLogger, userProfileId, new JwtTokenCache(webContext));

            var securityTokenServiceProxy = new SecurityTokenServiceProxy(jwt, securityConfiguration);
            var httpClientProxy           = new HttpClientProxy(securityTokenServiceProxy);
            var configuration             = new Configuration();
            var restClient    = new RestClient(configuration, httpClientProxy);
            var featureToggle = new FeatureToggle(restClient);

            return(featureToggle.IsEnabled(feature));
        }