public WardenIterationController(IWardenService wardenService, 
     IOrganizationService organizationService,
     IApiKeyService apiKeyService,
     IUserService userService,
     ISignalRService signalRService)
     : base(apiKeyService, userService)
 {
     _wardenService = wardenService;
     _organizationService = organizationService;
     _signalRService = signalRService;
 }
Esempio n. 2
0
 public ApiKeyController(IApiKeyService apiKeyService, ApiKeyProvider apiKeyProvider, IImageService imageSerivice)
 {
     this.apiKeyService  = apiKeyService;
     this.apiKeyProvider = apiKeyProvider;
     this.imageService   = imageSerivice;
 }
Esempio n. 3
0
 public SettingsController(IUserService userService, IApiKeyService apiKeyService)
 {
     _userService   = userService;
     _apiKeyService = apiKeyService;
 }
Esempio n. 4
0
 public InitializationService(IApiKeyService apiKeyService, IUserRepository userRepository, IEncrypter encrypter)
 {
     _apiKeyService  = apiKeyService;
     _userRepository = userRepository;
     _encrypter      = encrypter;
 }
Esempio n. 5
0
 public MeetupService(IApiKeyService apiKeyService)
 {
     _apiKeyService = apiKeyService;
 }
Esempio n. 6
0
 protected ApiController(IApiKeyService apiKeyService, IUserService userService)
 {
     ApiKeyService = apiKeyService;
     UserService = userService;
 }
 public ApiKeyAuthorizeAsyncFilter(ILogger <ApiKeyAuthorizeAsyncFilter> logger, IApiKeyService apiKeyService)
 {
     _logger        = logger;
     _apiKeyService = apiKeyService;
 }
Esempio n. 8
0
 protected ApiController(IApiKeyService apiKeyService, IUserService userService)
 {
     ApiKeyService = apiKeyService;
     UserService   = userService;
 }
 public ApiKeyController(IApiKeyService service)
 {
     _service = service;
 }
Esempio n. 10
0
        public ServiceHttpTests()
        {
            var builder = new ConfigurationBuilder().AddUserSecrets <ServiceHttpTests>();

            _apiKeyService = new ApiKeyService(builder.Build());
        }
Esempio n. 11
0
        public ApiKeyAuthorizeAsyncFilter(ILogger <ApiKeyAuthorizeAsyncFilter> logger, IApiKeyService apiKeyService)
        {
            if (logger == null)
            {
                throw new ArgumentNullException(nameof(logger));
            }

            if (apiKeyService == null)
            {
                throw new ArgumentNullException(nameof(apiKeyService));
            }

            this.logger        = logger;
            this.apiKeyService = apiKeyService;
        }
Esempio n. 12
0
 public AbpNuGetIndexUrlService(IApiKeyService apiKeyService)
 {
     _apiKeyService = apiKeyService;
     Logger         = NullLogger <AbpNuGetIndexUrlService> .Instance;
 }
Esempio n. 13
0
 public WeatherService(IApiKeyService apiKeyService)
 {
     _apiKeyService = apiKeyService;
 }
 public ComputeHashOverride(ILoggingService loggingService, IApiKeyService apiKeyService, ICachingService cachingService)
     : base(loggingService, apiKeyService, cachingService)
 {
 }
Esempio n. 15
0
 public AuthController(ILogger <AuthController> logger, IApiKeyService service)
 {
     _logger  = logger;
     _service = service;
 }
Esempio n. 16
0
 public ApiKeyModule(IApiKeyService apiKeyService) : base("api-keys")
 {
     Get("", async args => await FetchCollection <BrowseApiKeys, ApiKey>
             (async x => await apiKeyService.BrowseAsync(x)).HandleAsync());
 }
Esempio n. 17
0
 public GetHeaderValuesOverride(ILoggingService loggingService, IApiKeyService apiKeyService, ICachingService cachingService)
     : base(loggingService, apiKeyService, cachingService)
 {
 }
 public IsValidRequestOverride(ILoggingService loggingService, IApiKeyService apiKeyService, ICachingService cachingService)
     : base(loggingService, apiKeyService, cachingService)
 {
 }
Esempio n. 19
0
 public CurrencyRateQueryService(IApiKeyService apiKeyService)
 {
     this.apiKeyService = apiKeyService;
 }
Esempio n. 20
0
 public SettingsController(IUserService userService, IApiKeyService apiKeyService)
 {
     _userService = userService;
     _apiKeyService = apiKeyService;
 }
Esempio n. 21
0
        public void Process(ScheduledTaskContext context)
        {
            if (context.Task.TaskType == TaskType)
            {
                try {
                    Logger.Information("ExternalContent task item #{0} version {1} scheduled at {2} utc",
                                       context.Task.ContentItem.Id,
                                       context.Task.ContentItem.Version,
                                       context.Task.ScheduledUtc);
                    var displayalias = context.Task.ContentItem.As <AutoroutePart>().DisplayAlias;
                    //    //   using (var wc = _  using (var wc = shellContext.LifetimeScope.Resolve<IWorkContextAccessor>().CreateWorkContextScope()) {
                    ////     var tenantSiteName = wc.Resolve<ISiteService>().GetSiteSettings().SiteName;
                    //     var wc = _workContextAccessor.CreateWorkContextScope();
                    //     var workcontext = WorkContextExtensions.GetWorkContext(wc);
                    ////     var tenantSiteName = wc.Resolve<ISiteService>().GetSiteSettings().SiteName;
                    //     var settings = workContext.Resolve<ShellSettings>();
                    //     _shellSettings.

                    //var httpContextAccessor = GlobalConfiguration.Configuration.DependencyResolver.GetService(typeof(IHttpContextAccessor)) as IHttpContextAccessor;
                    //var workContext = WorkContextExtensions.GetWorkContext(httpContextAccessor.Current().Request.RequestContext);
                    //return workContext.CurrentSite.BaseUrl;

                    string CallUrl = _orchardServices.WorkContext.CurrentSite.BaseUrl;
                    //var host = _shellSettings.RequestUrlHost;
                    var prefix = _shellSettings.RequestUrlPrefix;
                    //if (!string.IsNullOrEmpty(host))
                    //    CallUrl += host;
                    if (!string.IsNullOrEmpty(prefix) && prefix.ToLower() != "default")
                    {
                        CallUrl += "/" + prefix;
                    }
                    CallUrl += @"/Webservices/Alias?displayalias=" + displayalias;


                    // var urlHelper = new UrlHelper(wc.HttpContext.Request.RequestContext);
                    //      var CallUrl = urlHelper.ItemDisplayUrl(context.Task.ContentItem);
                    // HostingEnvironment.MapPath("~/") + _shellSettings.Name + "\\Webservices\\Alias?displayalias=" + displayalias;
                    WebClient myClient = new WebClient();

                    IApiKeyService apiKeyService = null;
                    if (_orchardServices.WorkContext.TryResolve <IApiKeyService>(out apiKeyService))
                    {
                        var iv  = GetRandomIV();
                        var key = apiKeyService.GetValidApiKey(iv);
                        // protezione attiva inserisco header
                        myClient.Headers.Set("ApiKey", key);
                        myClient.Headers.Set("AKIV", iv);
                    }
                    Stream response = myClient.OpenRead(CallUrl);
                    response.Close();
                }
                catch (Exception e) {
                    Logger.Error(e, e.Message);
                }
                finally {
                    try {
                        var   fields = context.Task.ContentItem.Parts.SelectMany(x => x.Fields.Where(f => f.FieldDefinition.Name == typeof(FieldExternal).Name)).Cast <FieldExternal>();
                        Int32 minuti = 0;
                        foreach (var field in fields)
                        {
                            var settings = field.PartFieldDefinition.Settings.GetModel <FieldExternalSetting>();
                            if (settings.ScheduledMinute > 0)
                            {
                                minuti = settings.ScheduledMinute;
                            }
                        }
                        if (minuti > 0)
                        {
                            _fieldExternalService.ScheduleNextTask(minuti, context.Task.ContentItem);
                        }
                    }
                    catch (Exception e) {
                        Logger.Error(e, e.Message);
                    }
                }
            }
        }
Esempio n. 22
0
 public UserService(IUserRepository userRepository, IApiKeyService apiKeyService, IEncrypter encrypter)
 {
     _userRepository = userRepository;
     _apiKeyService  = apiKeyService;
     _encrypter      = encrypter;
 }
Esempio n. 23
0
 public SuiteCommand(IApiKeyService apiKeyService)
 {
     _apiKeyService = apiKeyService;
     Logger         = NullLogger <SuiteCommand> .Instance;
 }
 public KeyAuthHandler(IApiKeyService apiKeyService,
                       IOptionsMonitor <KeyAuthOptions> options, ILoggerFactory logger, UrlEncoder encoder, ISystemClock clock)
     : base(options, logger, encoder, clock)
 {
     _apiKeyService = apiKeyService;
 }
Esempio n. 25
0
 public TenantController()
 {
     _tenantAppService = IocManager.Instance.Resolve <ITenantAppService>();
     _apiKeyService    = IocManager.Instance.Resolve <IApiKeyService>();
 }