Giter Site home page Giter Site logo

moria's Introduction

jamesjmeyer210

This site is hosted at jamesjmeyer210.github.io. It contains my resume, written in HTML and CSS as well as a series of blog posts which I am gradually updating.

moria's People

Contributors

james-meyer-784110 avatar jamesjmeyer210 avatar

Stargazers

 avatar

Watchers

 avatar  avatar

Forkers

duzhanyuan

moria's Issues

Provide ProxyServer and Authenticator modules

The source code ought to be modularized further so that the lib.rs may provide useful exports. There are two types to focus on exporting: ProxyServer and Authenticator. The Authenticator validates for the proxy server and ought be injected into the ProxyServer. This way, custom middleware implementations can take advantage of the validation behavior without needing to run the actual ProxyServer.

Add Dynamic Path Resolution

Currently all the paths defined in endpoints.json have to be explicitly defined. But this doesn't reflect how API's actually operate. Because of this, urls with options need to be mapped. Initially, the following combinations should be considered:

  • /* using * as a wildcard
  • api/{x} where x is some url variables within the {}
  • api/{x}/{y} where x and y are url variables
  • api/{x}/foo/{y}
  • api/{x}/foo/{y}/bar

Add Logging

Currently the Moria is just using println!. A logger will need to be added if this is to be production ready.

Dynamically Reconfigurable

  • The endpoints.json file needs to be dynamically reconfigurable
  • The config.json file needs to dynamically reconfigurable

Shrink Memory Usage

Currently the memory footprint is very small at startup, but it appears to grow as the application runs. This is likely due to the usage of config.clone() and auth_map.clone(). There are two ways to immediately improve this that I can think of:

  1. Shrink the size of the HashMap<String,AuthObj> called auth_map by restructuring it into a different structure. Currently, it has redundant values, such as the groups, which could be put into a Vec<String> and referenced from a Vec<usize> (or in the case of less than 256 groups, possibly even Vec<u8>).
  2. Find a way to share the config and auth_map values between threads.

----- Edit -----

After doing some research, I've found that one way of rearing in this memory growth could be by explicitly defining the number of threads for actix-web to utilize.

  • Add the number of threads to config.json
  • If the number of threads is in config.json is zero, or some enormous number, print a warning and then use threads = (number of cores) * 2

This discovery doesn't invalidate the above code and in fact both configuration objects should probably be wrapped in Mutex so they can be updated while the service is running.

Reorganize SRC

Reorganize and modularize the /src folder, breaking it apart into smaller .rs files.

Add SSL

SSL needs to be added to incoming requests and forwarding.

Expand Integration Test Coverage

Currently there is a mock server that uses expressjs and has some basic throttling. This is perfectly fine for a testing mock, but it will need a wider variety of endpoints. Also, some kind of Javascript framework should be used for sending HTTP requests for the integration tests, rather than curl. Curl is nice and easy to use but bash is insufficient for the scale at which it will be needed. Also, more than one mock server will have to be defined, so that Moria's route inference can be tested more thoroughly.

  • Add more endpoints and behavior to existing mocks.
  • Add one or two additional mock servers.
  • Add a javascript sub-project for sending HTTP requests to Moria.
  • Enable ssl on all the above sub-projects.

Provide ProxyServer and Authenticator Exports from lib.rs

The source code ought to be modularized further so that the lib.rs may provide useful exports. There are two types to focus on exporting: ProxyServer and Authenticator. The Authenticator validates for the proxy server and ought be injected into the ProxyServer. This way, custom middleware implementations can take advantage of the validation behavior without needing to run the actual ProxyServer.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.