예제 #1
0
        public void Start()
        {
            AppDomain.CurrentDomain.UnhandledException += (s, e) => _logger.Error("Unhandled", new LogItem("Exception", e.ExceptionObject.ToString));
            Thread.CurrentThread.Name = $"{ServiceInfo.Name} Main Thread";

            _service.Start();
            _activityAuthorisationManager.Initialise();
        }
예제 #2
0
        public void Start()
        {
            AppDomain.CurrentDomain.UnhandledException += (s, e) => _logger.Error("Unhandled", new LogItem("Exception", e.ExceptionObject.ToString));
            Thread.CurrentThread.Name = $"{ServiceInfo.Name} Main Thread";
            Core.HttpServerAspNet.AspNetHttp.Configure(options =>
            {
                options.Filters.Add(new AuthorizeFilter(
                                        new AuthorizationPolicyBuilder().AddRequirements(new ActivityAuthorizationRequirement()).Build()));
                options.Filters.Add(typeof(ActionDurationActionFilter));
                options.AuthorizationHandlers.Add(typeof(ActivityAuthorizationHandler));
                options.SwaggerOperationFilters.Add(typeof(ActivityAuthorisationOperationFilter));
                options.MvcApplicationPartAssemblies.Add(Assembly.GetExecutingAssembly());
                options.IdentityServerOptions.RequireHttps = _configurationManager.Get("IdentityServerRequireHttps", true);
            });

            _service.Start();
            _activityAuthorisationManager.Initialise();
        }