public RequestBootstrapModule(IConfiguration config, IRootPathProvider pathProvider, ILogFactory log, IBootstrapController bootstrap)
        {
            this._pathProvider = pathProvider;
            this._cfg          = config;
            this._logger       = log.NewScope <RequestBootstrapModule>("RequestBootstrapModule");
            //this._sess = sess;

            this._controller = bootstrap;

            this.Get[UrlPrefixBootstrap + "/new", true] = async(x, ct) =>
            {
                NewBootstrapRequest req = new NewBootstrapRequest()
                {
                };
                NewBootstrapReqResponse ret = await _controller.CreateNewBootstrapRequestAsync(req);

                return(this.Response.AsJson(ret));
            };
            this.Get[UrlPrefixBootstrap + "/get/{requestId}", true] = async(x, ct) =>
            {
                GetBootstrapRequest req = new GetBootstrapRequest()
                {
                    RequestId = x.requestId
                };
                GetBootstrapReqResponse ret = await _controller.GetBootstrapRequestAsync(req);

                return(this.Response.AsJson(ret));
            };
        }
예제 #2
0
 public SecureBootstrapListenerService(IConfiguration cfg, ILogFactory log, IDBController db)
 {
     this._cfg    = cfg;
     this._logger = log.NewScope <SecureBootstrapListenerService>("SecurityGatewayListenerService");
     _db          = db;
 }