Coder Social home page Coder Social logo

docker_compose_app's Introduction

#URL_lookup

Write a small web service, using the technology of your choice, that responds to GET requests where the caller passes in a URL and the service responds with some information about that URL.

The GET requests would look like this:

GET /urlinfo/1/{hostname_and_port}/{original_path_and_query_string}

  • App is developed using python ,Web framework Flask and mysql as an backend database
  • URL_lookup.py lookup for malicious URL in database and alert user accordingly
  • database_update.py populate database with data from malicious_url.txt

How to use:

Requirements

  • mysql.connector for python
  • flask for python
  • Virtual env would be preferable for running app
  • mysql server
  • python

How to run:

  • Clone the directory and move to directory

  • python database_update.py -This will going to populate the data

  • Then run python URL_lookup.py -This will going to start local web server

  • From your work station run **curl http://127.0.0.1:5000/urlinfo/1/<http://domain.com> some of the acceptable formats are:

    *http://www.google.com*         #Valid
    
    *http://google.com*             #Invalid
     
    *www.google*                    #Invalid 
    
    *http://www.google.com/images*  #Valid
    

How to run unit test:

  • move to test directory and make sure python mock and flask libraries are installed

  • Run it using python

  • Version control plan:Going to use Tags for versoning and topic branches for adding features

  • Going to write unittest for it using python mock library

  • [] Dockerize app to remove dependencies

  • [] Bonus Tasks

Security notes

  • Regex check is done on the URL input to prevent various injections and to also save time in querying the database if the URL is not a valid URL
  • Credentials are not hardcoded in the source code but put in a config file stored in a separate folder ( access to which should be protected )

Change Log

  • 0.1.0

Initial release version

Author

Urllookup service created by Manpreet Singh

docker_compose_app's People

Contributors

manpreetsingh001 avatar

Watchers

 avatar  avatar

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.