Exemplo n.º 1
0
        public PublishModule(IPublishService publishService, IAuthoriser authoriser)
            : base(authoriser, "/services/publish")
        {
            _publishService = publishService;

            Post["/{mode}"] = InvokePublishing;
            Post["/listofitems"] = InvokePublishingOfListOfItems;
            Get["/lastcompleted"] = LastCompleted;
            Get["/lastcompleted/{source}/{target}/{language}"] = LastCompleted;
        }
Exemplo n.º 2
0
 public AuthorisationMiddleware(RequestDelegate next,
                                IRequestScopedDataRepository requestScopedDataRepository,
                                IAuthoriser authoriser,
                                IOcelotLoggerFactory loggerFactory)
     : base(requestScopedDataRepository)
 {
     _next       = next;
     _authoriser = authoriser;
     _logger     = loggerFactory.CreateLogger <AuthorisationMiddleware>();
 }
Exemplo n.º 3
0
        public PublishModule(IPublishService publishService, IAuthoriser authoriser)
            : base(authoriser, "/services/publish")
        {
            _publishService = publishService;

            Post["/{mode}"]       = InvokePublishing;
            Post["/listofitems"]  = InvokePublishingOfListOfItems;
            Get["/lastcompleted"] = LastCompleted;
            Get["/lastcompleted/{source}/{target}/{language}"] = LastCompleted;
        }
Exemplo n.º 4
0
        public InstallerModule(IPackageRepository repository, IAuthoriser authoriser, ITempPackager tempPackager, IInstallationRecorder installationRecorder)
            : base(authoriser, "/services")
        {
            _repository           = repository;
            _tempPackager         = tempPackager;
            _installationRecorder = installationRecorder;

            Post["/package/install/fileupload"] = InstallUploadPackage;

            Post["/package/install"] = InstallPackage;

            Get["/package/latestversion"] = LatestVersion;
        }
Exemplo n.º 5
0
        public InstallerModule(IPackageRepository repository, IAuthoriser authoriser, ITempPackager tempPackager, IInstallationRecorder installationRecorder)
            : base(authoriser, "/services")
        {
            _repository = repository;
            _tempPackager = tempPackager;
            _installationRecorder = installationRecorder;

            Post["/package/install/fileupload"] = InstallUploadPackage;

            Post["/package/install"] = InstallPackage;

            Get["/package/latestversion"] = LatestVersion;
        }
Exemplo n.º 6
0
        protected ShipBaseModule(IAuthoriser authoriser, string modulePath)
            : base(modulePath)
        {
            _authoriser = authoriser;

            Before += AuthoriseRequest;

            Before += ctx =>
            {
                ctx.Items.Add(StartTime, DateTime.UtcNow);
                return(null);
            };

            After += AddProcessingTimeToResponse;
        }
Exemplo n.º 7
0
        protected ShipBaseModule(IAuthoriser authoriser, string modulePath)
            : base(modulePath)
        {
            _authoriser = authoriser;

            Before += AuthoriseRequest;

            Before += ctx =>
            {
                ctx.Items.Add(StartTime, DateTime.UtcNow);
                return null;
            };

            After += AddProcessingTimeToResponse;
        }
Exemplo n.º 8
0
        public InstallerModule(IPackageRepository repository, IAuthoriser authoriser, ITempPackager tempPackager, IInstallationRecorder installationRecorder)
            : base("/services")
        {
            _repository = repository;
            _authoriser = authoriser;
            _tempPackager = tempPackager;
            _installationRecorder = installationRecorder;

            Before += AuthoriseRequest; 
            
            Before += ctx =>
            {
                ctx.Items.Add(StartTime, DateTime.UtcNow);
                return null;
            };

            After += AddProcessingTimeToResponse;

            Post["/package/install/fileupload"] = InstallUploadPackage;

            Post["/package/install"] = InstallPackage;

            Get["/package/latestversion"] = LatestVersion;
        }
Exemplo n.º 9
0
 public RepositoryBase(IRepository <T, TKeyType> crud, IValidator <T, TKeyType> validator, IAuthoriser <T, TKeyType> authoriser)
 {
     this.crud       = crud;
     this.validator  = validator;
     this.authoriser = authoriser;
 }
Exemplo n.º 10
0
 protected BaseHttpHandler(IAuthoriser authoriser)
 {
     _authoriser = authoriser;
 }
Exemplo n.º 11
0
 public UserRepo(ICrud <User, Guid> crud, IValidator <User, Guid> validator, IAuthoriser <User, Guid> authoriser) : base(crud, validator, authoriser)
 {
 }
 public AuthoriserDecoratorForQueries(IQueryHandler <TQuery, TResult> handler, IAuthoriser <TQuery> authoriser)
 {
     _authoriser = authoriser;
     _handler    = handler;
 }
Exemplo n.º 13
0
 public ToDoRepo(ICrud <ToDoItem, Guid> crud, IValidator <ToDoItem, Guid> validator, IAuthoriser <ToDoItem, Guid> authoriser) : base(crud, validator, authoriser)
 {
 }
Exemplo n.º 14
0
 public AuthoriserDecorator(ICommandHandler <T> handler, IAuthoriser <T> authoriser)
 {
     _authoriser = authoriser;
     _handler    = handler;
 }
Exemplo n.º 15
0
 protected BaseHttpHandler(IAuthoriser authoriser)
 {
     _authoriser = authoriser;
 }
 public void SetUp()
 {
     _context = HttpContextBuilder.MockHttpContext();
     _configurationProvider = new Mock<IConfigurationProvider<PackageInstallationSettings>>();
     _authoriser = new HttpRequestAuthoriser(_context.Object, _configurationProvider.Object);
 }
Exemplo n.º 17
0
 public PackageInstaller(HttpContextBase context, IAuthoriser requestAuthoriser, IDictionary<string, Action<HttpContextBase>> httpMethodActions)
 {
     _context = context;
     _requestAuthoriser = requestAuthoriser;
     _methodActions = httpMethodActions;
 }
Exemplo n.º 18
0
 public AboutModule(IAuthoriser authoriser)
     : base(authoriser, "/services/about")
 {
     Get["/"] = parameters => View["about.html"];
 }
Exemplo n.º 19
0
 public SampleHandler(IAuthoriser authoriser)
     : base(authoriser)
 {
 }