コード例 #1
0
ファイル: RestAPI.cs プロジェクト: Logeshkumar/Projects
        /// <summary>
        /// Constructor for initialization 
        /// </summary>
        public RestAPI()
        {
            // Logger.LogWrite(EskimoDBLogLevel.Verbose, "Creating");
            DependencyInjection di = DependencyInjection.GetInstance();

            mockRootServer = (IRootServer)di.CreateObject("root", new object[]{
                this,new WSDualHttpBinding(),"http://localhost:8080/root"});
            mockAuthServer = (IAuthServer)di.CreateObject("auth", new object[]{
                null,new BasicHttpBinding(),"http://149.119.196.45:8080/IComm"});

            m_PutDataSetCalled = false;
            m_PutQueryInfoCalled = false;
            m_QueryResult = new QueryResult(0, null, null);
            m_id = null;
            m_QueryDataset = new QueryDataset(new System.Collections.Generic.List<Type>(), new System.Collections.Generic.List<string>());
            m_lines = 0;

            m_IterateToTheEnd = 0;
            m_CallGetResult = true;
            m_startLine = 0;
            m_RowsPerTime = 5;
            m_IterateIndex = 0;
            m_FinalLines = 0;
            m_Table = new Tables();

        }
コード例 #2
0
ファイル: AuthCommTest.cs プロジェクト: Logeshkumar/Projects
 public TestAuthComm(string url)
 {
     Startup();
     Thread.Sleep(1000);
     Console.Write("\n\n");
     DependencyInjection di = DependencyInjection.GetInstance();
     di.SetConfig("config.xml");
     Console.WriteLine("Demo AuthComm");
     Console.WriteLine("-----------------------------");
     result = new List<string>();
     authR = new AuthResult();
     m_MsgList = new List<Message>();
     // Logger.LogWrite(EskimoDBLogLevel.Verbose, "Creating");
     try
     {
         channel1 = (IAuthServer)di.CreateObject("authserv", new object[]{
         null,new BasicHttpBinding(),url});
         channel2 = (IAuthValidate)di.CreateObject("authvalid", new object[]{
         null,new BasicHttpBinding(),url});
         Console.WriteLine("Connecting to the server!");
     }
     catch (Exception ex)
     {
         Console.WriteLine(ex);
         Console.WriteLine("Fail to connect the server!");
     }
 }
コード例 #3
0
        public void Configure(
            IApplicationBuilder app
            , IAuthServer auth2Server
            )
        {
            app.UseReverseProxy();

            app.UseSimpleInjector(_container);

            if (HostEnvironment.IsDevelopment())
            {
                app.UseDeveloperExceptionPage();
            }
            else
            {
                app.UseExceptionHandler("/Home/Error");
            }
            app.UseStaticFiles();

            app.UseRouting();

            app.UseAuthentication();
            app.UseAuthorization();

            app.UseEndpoints(endpoints =>
            {
                endpoints.MapPost("/connect/token", auth2Server.TokenRequestHandler);
                endpoints.MapGet("/connect/authorize", auth2Server.AuthorizeRequestHandler);
                endpoints.MapGet("/connect/endsession", auth2Server.EndSessionRequestHandler);
                endpoints.MapPost("/connect/endsession", auth2Server.ClearTokenRequestHandler);

                endpoints.MapControllerRoute(
                    name: "default",
                    pattern: "{controller=Home}/{action=Index}/{id?}");
            });

            _container.Verify();
        }
コード例 #4
0
ファイル: ClientAPI.cs プロジェクト: Logeshkumar/Projects
    /// <summary>
    /// Configuring the client api by creating objects using the dependency framework
    /// </summary>
    public void ConfigClient()
    {
      Logger.LogWrite("Creating instance of DI to cinfigure client api");
      di = DependencyInjection.GetInstance();
      mockRootServer = (IRootServer)di.CreateObject("root", new object[]{
                this,new WSDualHttpBinding(),rootHostAddress});
      mockAuthServer = (IAuthServer)di.CreateObject("auth", new object[]{
                null,new BasicHttpBinding(),authHostAddress});

    }